mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
Update pid type and fix windows err
This commit is contained in:
parent
c8cfc1c2fe
commit
6e3a4db36a
@ -987,5 +987,5 @@ func FindIds(name string) ([]int32, error) {
|
|||||||
|
|
||||||
// ActivePID window active by PID
|
// ActivePID window active by PID
|
||||||
func ActivePID(pid int32) {
|
func ActivePID(pid int32) {
|
||||||
C.active_PID(C.int32(pid))
|
C.active_PID(C.uintptr(pid))
|
||||||
}
|
}
|
||||||
|
@ -57,15 +57,15 @@ void aSetActive(const MData win){
|
|||||||
SetActive(win);
|
SetActive(win);
|
||||||
}
|
}
|
||||||
|
|
||||||
void active_PID(int32 pid){
|
void active_PID(uintptr pid){
|
||||||
MData win;
|
MData win;
|
||||||
#if defined(IS_MACOSX)
|
#if defined(IS_MACOSX)
|
||||||
// Handle to a AXUIElementRef
|
// Handle to a AXUIElementRef
|
||||||
win.AxID = AXUIElementCreateApplication(pid);
|
win.AxID = AXUIElementCreateApplication(pid);
|
||||||
#elif defined(USE_X11)
|
#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)
|
#elif defined(IS_WINDOWS)
|
||||||
win.HWnd = HWND(pid); // Handle to a window HWND
|
win.HWnd = (HWND) pid; // Handle to a window HWND
|
||||||
#endif
|
#endif
|
||||||
SetActive(win);
|
SetActive(win);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user