// compile the demo application, minimize delphi and run this.
var
i, i2: Longint;
wnd: Longint;
Lib: ResourcePointer;
Begin
if not LoadLibrary('user32.dll', Lib) then begin writeln('Failed');exit;end;
if not MapLibraryProc(Lib, 'FindWindowA', 'function FindWindow(C1, C2: PChar): Longint; stdcall;') then begin writeln('Failed');exit;end;
if not MapLibraryProc(Lib, 'ShowWindow', 'function ShowWindow(hWnd, nCmdShow: Longint): Integer; stdcall;') then begin writeln('Failed');exit;end;
if not MapLibraryProc(Lib, 'SetWindowTextA', 'function SetWindowText(hWnd: Longint; Text: PChar): Longint; stdcall;') then begin writeln('Failed');exit;end;
wnd := Findwindow('', 'Demo');
SetWindowText(Wnd, 'This is DLL demo, it calls some windows user32 routines. This will hide this window for a few seconds');