mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-19 22:33:55 +00:00
update window.h code style
This commit is contained in:
parent
482d465472
commit
e7f841be68
@ -33,7 +33,7 @@ bool setHandle(uintptr handle);
|
|||||||
bool IsValid();
|
bool IsValid();
|
||||||
bool IsAxEnabled(bool options);
|
bool IsAxEnabled(bool options);
|
||||||
MData GetActive(void);
|
MData GetActive(void);
|
||||||
void aWindow();
|
void initWindow();
|
||||||
|
|
||||||
#if defined(IS_MACOSX)
|
#if defined(IS_MACOSX)
|
||||||
|
|
||||||
@ -271,9 +271,9 @@ void aWindow();
|
|||||||
|
|
||||||
//int findwindow()
|
//int findwindow()
|
||||||
|
|
||||||
uintptr ahandle = 0;
|
uintptr initHandle = 0;
|
||||||
|
|
||||||
void aWindow(uintptr handle){
|
void initWindow(uintptr handle){
|
||||||
#if defined(IS_MACOSX)
|
#if defined(IS_MACOSX)
|
||||||
|
|
||||||
mData.CgID = 0;
|
mData.CgID = 0;
|
||||||
@ -290,18 +290,17 @@ void aWindow(uintptr handle){
|
|||||||
mData.XWin = 0;
|
mData.XWin = 0;
|
||||||
|
|
||||||
#elif defined(IS_WINDOWS)
|
#elif defined(IS_WINDOWS)
|
||||||
|
|
||||||
mData.HWnd = 0;
|
mData.HWnd = 0;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
setHandle(handle);
|
setHandle(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsValid(){
|
bool IsValid(){
|
||||||
aWindow(ahandle);
|
initWindow(initHandle);
|
||||||
if(!IsAxEnabled(true)){
|
if(!IsAxEnabled(true)){
|
||||||
printf("%s\n", "Window:Accessibility API is disabled!\nFailed to enable access for assistive devices.");
|
printf("%s\n", "Window:Accessibility API is disabled!\n
|
||||||
|
Failed to enable access for assistive devices.");
|
||||||
}
|
}
|
||||||
MData actdata = GetActive();
|
MData actdata = GetActive();
|
||||||
|
|
||||||
@ -402,13 +401,9 @@ bool IsAxEnabled(bool options){
|
|||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(USE_X11)
|
#elif defined(USE_X11)
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
#elif defined(IS_WINDOWS)
|
#elif defined(IS_WINDOWS)
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -822,9 +817,7 @@ char *GetTitle(){
|
|||||||
512, kCFStringEncodingUTF8);
|
512, kCFStringEncodingUTF8);
|
||||||
CFRelease(data);
|
CFRelease(data);
|
||||||
char* s = (char*)calloc(100, sizeof(char*));
|
char* s = (char*)calloc(100, sizeof(char*));
|
||||||
if (s){
|
if (s) { strcpy(s,conv); }
|
||||||
strcpy(s,conv);
|
|
||||||
}
|
|
||||||
// return (char *)&conv;
|
// return (char *)&conv;
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user