home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 December / Chip_2001-12_cd1.bin / zkuste / delphi / kompon / d23456 / CAJSCRTP.ZIP / demo_del / dll2.ifs < prev    next >
Text File  |  2001-06-11  |  892b  |  22 lines

  1. Program IFSTest;
  2. // compile the demo application, minimize delphi and run this. 
  3. const
  4.   user32 = 'user32.dll';
  5. function FindWindow(C1, C2: PChar): Longint; external user32 name 'FindWindowA'; StdCall;
  6. function ShowWindow(hWnd, nCmdShow: Longint): Integer; external user32 name 'ShowWindow'; stdcall;
  7. function SetWindowText(hWnd: Longint; Text: PChar): Longint; external user32 name 'SetWindowTextA'; stdcall;
  8. var 
  9.   i, i2: Longint;
  10.   wnd: Longint;
  11. Begin
  12.   wnd := Findwindow('', 'Demo');
  13.   SetWindowText(Wnd, 'This is DLL demo, it calls some windows user32 routines. This will hide this window for a few seconds');
  14.   for i := 0 to 100000 do begin end;
  15.   ShowWindow(Wnd, 0); // hide it
  16.   for i := 0 to 100000 do begin end;
  17.   SetWindowText(Wnd, 'Wasn''t that nice?');
  18.   ShowWindow(Wnd, 5); // show it
  19.   for i := 0 to 100000 do begin end;
  20.   SetWindowText(Wnd, 'Demo');
  21. End.
  22.