`
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
Printed October 24, 2026, 2:48 pm This article has been viewed/printed 36227 times. |