I was looking for some help with coding an application.

OK, I want to be able to edit code to check for other processes of the same exe and then not allow the additional instance to be launched.

I have used the following code to check on someones desktop to see if an exe is already running. I want to access the Terminal services and check to see if anyone connected to the server is running the same exe. Any ideas?

Procedure DoSwitch global string scaption
39821>>> local handle hwnd
39821>>> local integer ivoid isclen
39821>>> local string szCaption
39821>>> local pointer lpszCaption
39821>>> Length scaption to isclen
39822>>>>
39822>>> ZeroString 60 to szCaption
39823>>> GetAddress of szCaption to lpszCaption
39824>>>
39824>>> move (GetWindow(GetDesktopWindow(),GW_CHILD)) to hWnd Send Info_Box ("GW="*String(hwnd))
39825>>> while hWnd
39829>>> if (GetClassesName(hWnd) = 'DFFrameClass') Begin
39831>>> Move (GetWindowText(hWnd,lpszCaption,60)) to iVoid
39832>>>// Showln "Found: " scaption " = " (CString(szCaption))
39832>>> If (scaption = Left(CString(szCaption),isclen)) Begin
39834>>>// showln "Match2: " scaption " " (CString(szCaption))
39834>>>// inkey iVoid
39834>>> Send Info_Box (Trim(sCaption)+" is already loaded, switching to this application") "Error"
39835>>> Move (SetForeGroundWindow(hWnd)) to iVoid
39836>>> Abort
39837>>>>
39837>>> End
39837>>>>
39837>>> End
39837>>>>
39837>>> Move (GetWindow(hWnd, GW_HWNDNEXT)) to hWnd
39838>>> End
39839>>>>
39839>>>// Showln "Over"
39839>>>// Inkey iVoid
39839>>>End_Procedure