mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
add getFrame to pub.h [ci skip]
This commit is contained in:
parent
c91af647e4
commit
56bc179c39
@ -11,6 +11,7 @@
|
||||
#include "alert_c.h"
|
||||
#include "window.h"
|
||||
#include "win32.h"
|
||||
#include "win_sys.h"
|
||||
|
||||
int show_alert(const char *title, const char *msg,
|
||||
const char *defaultButton, const char *cancelButton){
|
||||
|
24
window/pub.h
24
window/pub.h
@ -255,6 +255,30 @@ MData mData;
|
||||
}
|
||||
}
|
||||
|
||||
static Bounds GetFrame(MData win){
|
||||
Bounds frame;
|
||||
// Retrieve frame bounds
|
||||
if (WM_EXTENTS != None) {
|
||||
long* result; uint32 nItems = 0;
|
||||
// Get the window extents property
|
||||
result = (long*) GetWindowProperty(win, WM_EXTENTS, &nItems);
|
||||
|
||||
// Verify the results
|
||||
if (result != NULL) {
|
||||
if (nItems == 4) {
|
||||
frame.X = (int32) result[0];
|
||||
frame.Y = (int32) result[2]
|
||||
frame.W = (int32) result[0] + (int32) result[1];
|
||||
frame.H = (int32) result[2] + (int32) result[3];
|
||||
}
|
||||
|
||||
XFree(result);
|
||||
}
|
||||
}
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
||||
|
||||
#elif defined(IS_WINDOWS)
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user