mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-30 22:13:54 +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
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user