VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - 让外部程序显示在最前端
发表评论(0)作者:不详, 平台:VB6.0+Win98, 阅读:12741, 日期:2001-04-06
Private Declare Function FindWindow% Lib "user32" Alias "FindWindowA" (ByVal lpclassname As Any, ByVal lpCaption As Any)
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Const HWND_TOPMOST = -1
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Private Function Float_Calc()
Dim X&, hwnd%
X = Shell("CALC.EXE", 1)
hwnd% = FindWindow%("SciCalc", 0&)
Call SetWindowPos(hwnd%, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or _
SWP_NOSIZE)
End Function

Private Sub Command1_Click()
Float_Calc
End Sub