2012-02-06 251 views
1

我正在写一个小测试程序,为此我需要编辑控件的句柄。我已经从Spy ++复制了句柄的值(可以说000A0B40)。如何将整数句柄转换为HWND

所以我做了以下

#define editControlHandle 0x000A0B40 

int *intHandle; 
intHandle=(int*)editControlHandle; 
HWND handle=(HWND)intHandle; 
int textlength=GetWindowTextLength(handle); 

我还做了一个getlasterror它给了我ERROR_SUCCESS。

回答

1

GetWindowTextLength无法检索另一个应用程序中编辑控件文本的长度。

Documentation