MODULE Shell32;
IMPORT SYSTEM, Kernel32, Modules;
CONST
SWNORMAL* = 1;
TYPE
LPCSTR* = Kernel32.ADDRESS;
HWND* = Kernel32.HANDLE;
HINSTANCE* = Kernel32.HINSTANCE;
INT* = LONGINT;
VAR
shell32: Kernel32.HMODULE;
ShellExecute-: PROCEDURE {WINAPI}
(hwnd: HWND; lpOperation, lpFile: ARRAY OF CHAR; lpParameters, lpDirectory: LPCSTR; nShowCmd: INT): HINSTANCE;
PROCEDURE TermMod;
BEGIN
IF shell32 # Kernel32.NULL THEN
Kernel32.FreeLibrary(shell32); shell32 := Kernel32.NULL
END
END TermMod;
PROCEDURE Init;
VAR str: ARRAY 32 OF CHAR;
BEGIN
str := "shell32.dll";
shell32 := Kernel32.LoadLibrary(str);
Kernel32.GetProcAddress(shell32, "ShellExecuteA", SYSTEM.VAL(LONGINT, ShellExecute));
Modules.InstallTermHandler(TermMod)
END Init;
BEGIN
Init()
END Shell32.