🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: cn.bbs.comp.program
1 messages
1 total messages Started by ����~ �������� Tue, 24 Mar 1998 00:00
Re: How to use API (FindWindow) in delphi?
#1743
Author: ����~ ��������
Date: Tue, 24 Mar 1998 00:00
36 lines
1472 bytes
> ==> Bing_Jian(���)                          ˵��: 
>   For Example, a delphi project named project1 and its main form named form1, 
> how to use findwindow or other winapi in order to make project1 run only one  
> time? 
>    Protype of Function FindWindow as following: 
> HWND FindWindow( 
>     LPCTSTR  lpClassName,       // address of class name 
>     LPCTSTR  lpWindowName       // address of window name 
>    ); 
>    i dont know how to assign classname and windowname in delphi 
> program. 
>                     
 
    This is a sample show how to use FindWindow API in Delphi:

    This function will check whether your own application have been 
executed or not.

function IsInstance: boolean;
var
   MyOwnWindow: hWnd;
   sign: array [0..255] of char;
Begin
   StrPCopy(sign,Application.MainForm.Caption);
   MyOwnWindow:=FindWindow(nil, sign);
   if MyOwnWindow<>0 then
      result:=true
   else
      result:=false;
End;

   

--
�� ��Դ: �й�ƴ�BBSվ [bbs.ustc.edu.cn]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads