private static void _current_WindowIntPtr_Get(object obj) { //string processname = null; Thread.Sleep(_intSleepTime); IntPtr hwnd = API_Windows.GetForegroundWindow(); delRtnIntPtr evt = obj as delRtnIntPtr; if (obj == null) { return; } evt(hwnd); }
/// <summary> /// 프로세스 IntPtr로 프로세스를 가져온다 /// </summary> /// <param name="hwnd"></param> /// <returns></returns> public static System.Diagnostics.Process WindowProcess_Get_byHWnd(IntPtr hwnd) { try { uint pid; API_Windows.GetWindowThreadProcessId(hwnd, out pid); System.Diagnostics.Process cur = System.Diagnostics.Process.GetProcessById((int)pid); if (cur == null) { return(null); } return(cur); } catch { return(null); } }
public static IntPtr Current_WindowIntPtr_Get() { //string processname = null; return(API_Windows.GetForegroundWindow()); }