如何遍历切换窗口

cd20102010 2011-06-07 07:24:47
如何遍历本工程Project1.exe中所有的已打开窗口,包括动态创建的窗口。并且把窗口标题动态显示在一个菜单中。当点击相关标题的菜单项时,切换显示这个窗口?类似于 Window 这样的菜单设置。
...全文
102 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
无条件为你 2011-06-09
  • 打赏
  • 举报
回复
这种问题你好意思只给20分?
cd20102010 2011-06-09
  • 打赏
  • 举报
回复
这个出的结果好像是许多本工程之外的窗口和控件名,不能有针对性的只枚举本工程中的已显示窗口。
kye_jufei 2011-06-08
  • 打赏
  • 举报
回复
With this change, an application cannot force a window to the foreground while the user is working with another window. Instead, Foreground and Background Windows will activate the window (see SetActiveWindow) and call the function to notify the user. However, on Microsoft® Windows® 98 and Windows Millennium Edition (Windows Me), if a nonforeground thread calls SetForegroundWindow and passes the handle of a window that was not created by the calling thread, the window is not flashed on the taskbar. To have SetForegroundWindow behave the same as it did on Windows 95 and Microsoft Windows NT® 4.0, change the foreground lock timeout value when the application is installed. This can be done from the setup or installation application with the following function call:

SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, (LPVOID)0, SPIF_SENDWININICHANGE | SPIF_UPDATEINIFILE);

This method allows SetForegroundWindow on Windows 98/Windows Me and Windows 2000/Windows XP to behave the same as Windows 95 and Windows NT 4.0, respectively, for all applications. The setup application should warn the user that this is being done so that the user isn 't surprised by the changed behavior. On Windows Windows 2000 and Windows XP, the call fails unless the calling thread can change the foreground window, so this must be called from a setup or patch application. For more information, see Foreground and Background Windows.
bdmh 2011-06-07
  • 打赏
  • 举报
回复
遍历http://blog.csdn.net/wh445306/archive/2007/12/18/1950812.aspx
遍历窗口,得到句柄,然后SetForegroundWindow

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧