` Check for multiple instances of a program (Steven Gallafent ) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Check for multiple instances of a program
1998-02-07 -- Steven Gallafent
 
You need to make three additions under global embeds: At "Inside the Global Map" add: MODULE('WINAPI') FindWindow(<*CSTRING>,*CSTRING),UNSIGNED,PASCAL,RAW, NAME('FindWindowA') SetForegroundWindow(UNSIGNED),SIGNED,PASCAL END At "Global Data" add: FindWindowName CSTRING(50) FindWindowHandle UNSIGNED At "Program Setup" add: FindWindowName = 'Peoples Favorite Colors' FindWindowHandle = FindWindow(,FindWindowName) IF FindWindowHandle SetForegroundWindow(FindWindowHandle) DctKill !Omit these two lines if not using ABC templates GlobalErrors.Kill !Omit these two lines if not using ABC templates RETURN END


Today is April 27, 2024, 10:25 am
This article has been viewed 35107 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: