当窗体最小化到任务栏时,就没法取得上面控件的TEXT了;如果不最小化到任务栏就是好的,为什么?
问题1
当窗体最小化到任务栏时,就没法取得上面控件的TEXT了;如果不最小化到任务栏就是好的,为什么?
hCurrentWindow_Sub1 := ChildWindowFromPointEx(hCurrentWindow, Point(25,105),CWP_ALL);
hCurrentWindow_ComeFrom := ChildWindowFromPointEx(hCurrentWindow_Sub1, Point(25,85),CWP_ALL);
GetWindowText(hCurrentWindow_ComeFrom,@L_FromText,255
L_FromStr := StrPas(@L_FromText);
edit1.text := l_fromstr;
有没有更好的解决方法???
-------------------------------------------------------------
问题2
我知道窗体句柄,如果窗体被关闭了,我怎么判断它是否关闭??
我是这么做的
if IsWindowVisible(StrToInt('$'+ L_Caption_HWND)) then//判断当前句柄的窗体是否存在,如果窗体不可见了,就表示不存了;用16进制来比较
begin
//句柄为L_Caption_HWND的窗体存在
end
else
begin
//句柄为L_Caption_HWND的窗体不存在
end;
上面的代码是可以实现的,但有没有更好的思路???