Update pid type and fix windows err

This commit is contained in:
vCaesar 2017-07-13 22:40:56 +08:00
parent c8cfc1c2fe
commit 6e3a4db36a
2 changed files with 4 additions and 4 deletions

View File

@ -987,5 +987,5 @@ func FindIds(name string) ([]int32, error) {
// ActivePID window active by PID
func ActivePID(pid int32) {
C.active_PID(C.int32(pid))
C.active_PID(C.uintptr(pid))
}

View File

@ -57,15 +57,15 @@ void aSetActive(const MData win){
SetActive(win);
}
void active_PID(int32 pid){
void active_PID(uintptr pid){
MData win;
#if defined(IS_MACOSX)
// Handle to a AXUIElementRef
win.AxID = AXUIElementCreateApplication(pid);
#elif defined(USE_X11)
win.XWin = pid; // Handle to an X11 window
win.XWin = (Window) pid; // Handle to an X11 window
#elif defined(IS_WINDOWS)
win.HWnd = HWND(pid); // Handle to a window HWND
win.HWnd = (HWND) pid; // Handle to a window HWND
#endif
SetActive(win);
}