File: dlltest.rops

package info (click to toggle)
lazarus 1.6.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 172,444 kB
  • ctags: 124,173
  • sloc: pascal: 1,528,777; xml: 260,232; sh: 3,008; java: 603; makefile: 512; perl: 297; sql: 222; ansic: 137
file content (19 lines) | stat: -rw-r--r-- 876 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Program IFSTest;
// compile the demo application, minimize delphi and run this. 
function FindWindow(C1, C2: PChar): Longint; external 'FindWindowA@user32.dll stdcall';
function ShowWindow(hWnd, nCmdShow: Longint): Integer; external 'ShowWindow@user32.dll stdcall';
function SetWindowText(hWnd: Longint; Text: PChar): Longint; external 'SetWindowTextA@user32.dll stdcall';
var 
  i: Longint;
  wnd: Longint;
Begin
  wnd := Findwindow('', 'Innerfuse Pascal Script III');
  SetWindowText(Wnd, 'This is DLL demo, it calls some windows user32 routines. This will hide this window for a few seconds');
  for i := 0 to 200000 do begin end;
  ShowWindow(Wnd, 0); // hide it
  for i := 0 to 200000 do begin end;
  SetWindowText(Wnd, 'Wasn''t that nice?');
  ShowWindow(Wnd, 5); // show it
  for i := 0 to 200000 do begin end;
  SetWindowText(Wnd, 'Innerfuse Pascal Script III');
End.