mirror of
https://github.com/go-vgo/robotgo
synced 2026-05-24 10:19:01 +00:00
fixed return address of local variable and not use ternary operator
This commit is contained in:
parent
3d65e37f98
commit
3447822f65
1 changed files with 9 additions and 6 deletions
|
|
@ -659,12 +659,15 @@ char* get_title_by_hand(MData m_data){
|
|||
|
||||
#elif defined(IS_WINDOWS)
|
||||
|
||||
return GetWindowText(
|
||||
m_data.HWnd, m_data.Title, 512) > 0 ?
|
||||
m_data.Title : "";
|
||||
// return GetWindowText
|
||||
// (mData.HWnd, name, 512) > 0 ?
|
||||
// _UTF8Encode(name) : "null";
|
||||
if (GetWindowText(m_data.HWnd, m_data.Title, 512) > 0){
|
||||
char* name = m_data.Title;
|
||||
|
||||
char* str = (char*)calloc(100, sizeof(char*));
|
||||
if(str)strcpy(str, name);
|
||||
return str;
|
||||
}
|
||||
|
||||
return "";
|
||||
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue