Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2000-11

Headed for Windows

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Luis R. Hilario B.

Hi,

Where I must put headed, like the following one?
Function RegDeleteKey(hKey: Longint; lpSubKey: String): Longint;
external 'advapi32' name 'RegDeleteKeyA';
|--------------------------| | Luis R. Hilario | | http://luisdigital.2y.net | |--------------------------|

Reply by email

Luis R. Hilario B.
to Marco van de Voort: Nowhere? It is simply in unit windows? Marco van de Voort ( or )
Marco van de Voort wrote 6 lines
> Where I must put headed, like the following one? > Function RegDeleteKey(hKey: Longint; lpSubKey: String): Longint; > external 'advapi32' name 'RegDeleteKeyA'; Nowhere? It is simply in unit windows?
Program key1;  //This program works.
Const
HKEY_LOCAL_MACHINE = $80000002;
Function RegDeleteKey(hKey: Longint; lpSubKey: String): Longint;
external
 'advapi32' name 'RegDeleteKeyA';
Var
 Val: LongInt;
Begin
 Val := RegDeleteKey(HKEY_LOCAL_MACHINE, 'Software\Luis Digital');
End.
============================================
Program Key2;  //This program does not work.
Uses windows;
Var
 Val: Long;
Begin
 Val := RegDeleteKeyW(HKEY_LOCAL_MACHINE, 'Software\Luis Digital');
End. // RegDeleteKeyW(HKEY,                LPCWSTR = ^Word);

There is an error in the declaration or I do not know to use the function?

|--------------------------| | Luis R. Hilario | | http://luisdigital.2y.net | |--------------------------|

Reply by email

Marco van de Voort
to Luis R. Hilario B.
Show quoted text 9 lines
Program key1; //This program works. Const HKEY_LOCAL_MACHINE = $80000002; Function RegDeleteKey(hKey: Longint; lpSubKey: String): Longint; external 'advapi32' name 'RegDeleteKeyA';

Here you use "RegDeleteKeyA"

Begin Val := RegDeleteKeyW(HKEY_LOCAL_MACHINE, 'Software\Luis Digital'); End. // RegDeleteKeyW(HKEY, LPCWSTR = ^Word);

Here you use RegDeleteKeyW (which is for widestrings)

There is an error in the declaration or I do not know to use the function?

Try to use RegDeleteKeyA or only RegDeleteKey in the second example.

Marco van de Voort ( or )

Reply by email

Luis R. Hilario B.
to Marco van de Voort: Here you use "RegDeleteKeyA" Here you use RegDeleteKeyW (which is for widestrings) Try to…
Marco van de Voort wrote 25 lines
> > Program key1; //This program works. > > Const > HKEY_LOCAL_MACHINE = $80000002; > > Function RegDeleteKey(hKey: Longint; lpSubKey: String): Longint; > external > 'advapi32' name 'RegDeleteKeyA'; Here you use "RegDeleteKeyA" > Begin > Val := RegDeleteKeyW(HKEY_LOCAL_MACHINE, 'Software\Luis Digital'); > End. // RegDeleteKeyW(HKEY, LPCWSTR = ^Word); Here you use RegDeleteKeyW (which is for widestrings) > There is an error in the declaration or I do not know to use the > function? Try to use RegDeleteKeyA or only RegDeleteKey in the second example.

Work.

Free Pascal has a unknown power...
Free Pascal is a diamond without exploring...

The best way to present it, is by means of the promotion: http://www.luis-digital.8m.com/FPC

Thanks.

|--------------------------| | Luis R. Hilario | | http://luisdigital.2y.net | |--------------------------|

Reply by email