mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-29 21:43:55 +00:00
add get the HWND by PID support
This commit is contained in:
parent
1934220f50
commit
ee25e577e5
@ -236,6 +236,11 @@ func getNumDisplays() int {
|
||||
return int(C.get_num_displays())
|
||||
}
|
||||
|
||||
// GetHwndByPId get the hwnd by pid
|
||||
func GetHwndByPId(pid int) int {
|
||||
return int(C.get_hwnd_by_pid(C.uintptr(pid)))
|
||||
}
|
||||
|
||||
// SysScale get the sys scale
|
||||
func SysScale(displayId ...int) float64 {
|
||||
display := displayIdx(displayId...)
|
||||
|
@ -97,6 +97,15 @@ uint32_t get_num_displays() {
|
||||
#endif
|
||||
}
|
||||
|
||||
uintptr get_hwnd_by_pid(uintptr pid) {
|
||||
#if defined(IS_WINDOWS)
|
||||
HWND hwnd = GetHwndByPId(pid);
|
||||
return (uintptr)hwnd;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void bitmap_dealloc(MMBitmapRef bitmap) {
|
||||
if (bitmap != NULL) {
|
||||
destroyMMBitmap(bitmap);
|
||||
|
Loading…
Reference in New Issue
Block a user