Member
Group: Members
Posts: 435
Member No.: 20
Joined: 20-May 04
|
with this code as program load point, you can restrict the program running instances to one (if already running, raises the program in foreground).
szDlgClass is a null terminated string with the name of the main dialog class. WinMain is the win main proc (WinMain proc hInst:HINSTANCE, hPrevInst:HINSTANCE, CmdLine:LPSTR, CmdShow:DWORD)
CODE | .code start: � �invoke FindWindow,offset szDlgClass,NULL � �.if eax != NULL � � � �push eax � � � �invoke ShowWindow,eax,SW_SHOWNORMAL � � � �pop �eax � � � �invoke SetForegroundWindow,eax � �.else � � � �invoke GetModuleHandle,NULL � � � �mov �hInstance,eax � � � �invoke GetCommandLine � � � �invoke WinMain, hInstance, NULL, eax, SW_SHOWDEFAULT � �.endif � �invoke ExitProcess,eax
|
|