后台弹出的是inputbox,因为我想弹出一个提示用户输入对话框.当我获得inputbox对话框句柄时,并用setwindowpos置到最前台,但是后台程序窗体也被显示到最前台了(程序如下),这是我不想要的,好象这个句柄是后台程序的句柄.前面一个朋友说过自己做一个对话框窗体,然后发送到最前台,这样就可以不用显示后台程序了,我想除此以外应该还有其他的方法吧? 部分程序如下: Paswod = InputBox(" Please scan your ID password", "VerifyID")Public Sub Timer1_Timer() Dim strtitle As String strtitle = "VerifyID" hdl = FindWindow("#32770", strtitle) SetWindowPos hdl, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE End Sub
2》句柄不一样的。
部分程序如下:
Paswod = InputBox(" Please scan your ID password", "VerifyID")Public Sub Timer1_Timer()
Dim strtitle As String
strtitle = "VerifyID"
hdl = FindWindow("#32770", strtitle)
SetWindowPos hdl, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End Sub