All pastes #972981 Raw Edit

Someone

public cpp v1 · immutable
·published 2008-04-05 21:10 UTC
rendered paste body
DWORD pID;HANDLE wHandle;int GetProcID(WindowName LPCTSTR, ClassName LPCTSTR){	HANDLE hWnd;	DWORD pid;	hWnd = FindWindow(ClassName, WindowName);	if(hWnd == NULL)	{		MessageBox(0, "FindWindow in GetProcID failed, Window not found", "Error", MB_OK);		return 1;	}	pid = GetProcessId(hWnd);	if(pid == NULL)	{		MessageBox(0, "GetProcessId in GetProcID failed", "Error", MB_OK);		return 2;	}	if(pid != NULL)		return pid;	else	{		MessageBox(0, "GetProcID failed", "Error", MB_OK);		return 3;	}return 4;}pID = GetProcID("MineSweeper", NULL);if(pID == 0 || 1 || 2 || 3 || 4)	MessageBox(0, "GetProcID Failure", "error", MB_OK);