Merge pull request #81 from wang35666/bug

go build error. getTitle gcc 7.2.0
This commit is contained in:
vz 2017-11-20 21:09:18 +08:00 committed by GitHub
commit c6fbd155f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,7 @@ struct _MData{
Window XWin; // Handle to an X11 window
#elif defined(IS_WINDOWS)
HWND HWnd; // Handle to a window HWND
TCHAR Title[512];
#endif
};
@ -27,6 +28,7 @@ typedef struct _MData MData;
MData mData;
bool setHandle(uintptr handle);
bool IsValid();
bool IsAxEnabled(bool options);
@ -857,9 +859,7 @@ char *GetTitle(){
#elif defined(IS_WINDOWS)
TCHAR name[512];
return GetWindowText
(mData.HWnd, name, 512) > 0 ? name : "null";
return GetWindowText(mData.HWnd, mData.Title, 512) > 0 ? mData.Title : "null";
// return GetWindowText
// (mData.HWnd, name, 512) > 0 ?
// _UTF8Encode (name) : "null";