为什么以下代码在没有窗体的程序中就会提示Handle错误
procedure CTall;
var
hCurrentWindow: HWnd;
szText: array[0..254] of char;
begin
hCurrentWindow := GetWindow(Handle, GW_HWNDFIRST);
while hCurrentWindow <> 0 do
begin
if (GetWindowText(hCurrentWindow, @szText, 255)> 0) and isWindowVisible(hCurrentWindow) then
hCurrentWindow := GetWindow(GetDesktopWindow(), GW_HWNDNEXT);
sendMessage(hCurrentWindow,wm_sysCommand,sc_close,0);
end;
end;
用这个代码来关闭所有已打开的窗口,为什么这个代码加到一个按纽事情就可以关闭
var
hCurrentWindow: HWnd;
szText: array[0..254] of char;
begin
hCurrentWindow := GetWindow(Handle, GW_HWNDFIRST);
while hCurrentWindow <> 0 do
begin
if (GetWindowText(hCurrentWindow, @szText, 255)> 0) and isWindowVisible(hCurrentWindow) then
hCurrentWindow := GetWindow(GetDesktopWindow(), GW_HWNDNEXT);
sendMessage(hCurrentWindow,wm_sysCommand,sc_close,0);
end;
end;
用这个代码来关闭所有已打开的窗口,为什么这个代码加到一个按纽事情就可以关闭
...全文
相关推荐
子窗体新建任务栏按钮.rar
1.学生毕业设计专用 2.保证无毒 3.个人作品,自己要是想用的话,可是改用 4.本人不受法律责任,由改动代码人负责!
【已解决】当在函数 ‘set_display_font‘ 中调用 ‘query_font‘时,HALCON handle was already cleared (HALCON错误代码: 2454)
碰到一个很头疼的问题,就是在调用算子的时候突然间给我报2454的错误,结果给我一顿输出,还是没有整明白。静下心来一个一个分析,终于解决了。
MessageBox的常见用法
MessageBox的常见用法,通过这篇文档可以熟练使用MessageBox
打开vs提示invalid handle
打开vs提示invalid handle 解决方法
dll 中调用窗体
将窗体封装到dll中,供其他程序调用,代码简单,演示说明问题。


语言基础/算法/系统设计
