主题:哪个API函数可以把一个窗口设为当前窗口?
singlion
[专家分:690] 发布于 2008-07-08 22:47:00
已经获得了窗口的句柄,如何让它成为当前窗口?
用SetFocusAPI没反应
回复列表 (共2个回复)
沙发
tanchuhan [专家分:15140] 发布于 2008-07-09 00:05:00
SetForegroundWindow
板凳
snyga [专家分:1480] 发布于 2008-07-09 08:10:00
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
SetForegroundWindow hwnd
ShowWindow hwnd, 1
我来回复