|
另类Msgbox(3) hInstance, hThreadId) '调用MessageBox API Msgbox = MessageBox(hWnd, sPrompt, sTitle, dwStyle) End Function ''''''''''''''''''''''''''''''''''''''''''''''''''''' 'HOOK处理 ''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Function CBTProc(ByVal nCode As Long, _ ByVal wParam As Long, _ ByVal lParam As Long) As Long '变量声明 Dim rc As RECT Dim rcFrm As RECT Dim newLeft As Long Dim newTop As Long Dim dlgWidth As Long Dim dlgHeight As Long Dim scrWidth As Long Dim scrHeight As Long Dim frmLeft As Long Dim frmTop As Long Dim frmWidth As Long Dim frmHeight As Long Dim hwndMsgBox As Long ' Dim lngHwnd As Long '当MessageBox出现时,将Msgbox对话框居中与所在的窗口 If nCode = HCBT_ACTIVATE Then '消息为HCBT_ACTIVATE时,参数wParam包含的是MessageBox的句柄 hwndMsgBox = wParam '得到MessageBox对话框的Rect Call GetWindowRect(hwndMsgBox, rc)
|