🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.program
Article #1743

Re: How to use API (FindWindow) in delphi?

#1743
From: ����~ ��������
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]
Technical Details
Message-ID: <980324.yHRfM$PBBS@bbs.ustc.edu.cn>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: fc86e,f2731efc4aa9cbef,start
X-Google-Attributes: gidfc86e,public
From: Sea_Boy@bbs.ustc.edu.cn (����~ ��������)
Subject: Re: How to use API (FindWindow) in delphi?
Date: 1998/03/24
Message-ID: <980324.yHRfM$PBBS@bbs.ustc.edu.cn>
X-Deja-AN: 337202671
Organization: �й�ƴ�BBSվ
Newsgroups: cn.bbs.comp.program