mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-02 23:23: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 IsAxEnabled(bool options);
|
||||
MData GetActive(void);
|
||||
void aWindow();
|
||||
void initWindow();
|
||||
|
||||
#if defined(IS_MACOSX)
|
||||
|
||||
@ -271,9 +271,9 @@ void aWindow();
|
||||
|
||||
//int findwindow()
|
||||
|
||||
uintptr ahandle = 0;
|
||||
uintptr initHandle = 0;
|
||||
|
||||
void aWindow(uintptr handle){
|
||||
void initWindow(uintptr handle){
|
||||
#if defined(IS_MACOSX)
|
||||
|
||||
mData.CgID = 0;
|
||||
@ -290,18 +290,17 @@ void aWindow(uintptr handle){
|
||||
mData.XWin = 0;
|
||||
|
||||
#elif defined(IS_WINDOWS)
|
||||
|
||||
mData.HWnd = 0;
|
||||
|
||||
#endif
|
||||
|
||||
setHandle(handle);
|
||||
}
|
||||
|
||||
bool IsValid(){
|
||||
aWindow(ahandle);
|
||||
initWindow(initHandle);
|
||||
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();
|
||||
|
||||
@ -402,13 +401,9 @@ bool IsAxEnabled(bool options){
|
||||
}
|
||||
|
||||
#elif defined(USE_X11)
|
||||
|
||||
return true;
|
||||
|
||||
#elif defined(IS_WINDOWS)
|
||||
|
||||
return true;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -822,9 +817,7 @@ char *GetTitle(){
|
||||
512, kCFStringEncodingUTF8);
|
||||
CFRelease(data);
|
||||
char* s = (char*)calloc(100, sizeof(char*));
|
||||
if (s){
|
||||
strcpy(s,conv);
|
||||
}
|
||||
if (s) { strcpy(s,conv); }
|
||||
// return (char *)&conv;
|
||||
return s;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user