http://www.csdn.net/expert/topic/499/499697.xml
主 题: 晶晶的第三篇口水话:"VB调用API函数使窗口保持在最上层 "....(API相关)
主 题: 晶晶的第三篇口水话:"VB调用API函数使窗口保持在最上层 "....(API相关)
解决方案 »
- 给孩子洗尿布是一件很快乐的事
- 请问在哪里找得到TTFI6.OCX 控件。我的邮箱地址:[email protected].大虾请救我
- 鼠标单、双击ListView控件的空白处引起的烦恼
- 請教一個簡單問題
- 求救,关于合并若干个mp3文件的方法
- 怎样实现鼠标点击哪行,MSFlexGrid哪行便整行变色?
- 呵呵,非常的高分阿,什么,250分,进来看看
- 如何 撤消 Fdisk 的操作啊?????????????????
- 各位大侠,能给小弟一份输入法程序的示列代码?
- 哪裡有關打印的源碼?請教!!!!急。一定給分。
- 哪位高手知道,vb中不用ocx 和 dll 读取CPU信息!谢谢!
- 简单的小问题而已,请不要笑我!
dim rtn
rtn = SetWindowPos(OnTop.hwnd, -1, 0, 0, 0, 0, 3)
End Sub
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 LongPrivate Const HWND_TOPMOST = -1
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1Private Sub Form_Load()
Dim retValue As Long
retValue = SetWindowPos(Me.hwnd, HWND_TOPMOST,0,0,0,0, SWP_NOMOVE Or SWP_NOSIZE)
End Sub
SetWindowPos Me.hwnd, -1, 0,0,0,0, 1 or 2
这样取消在最前面:
SetWindowPos Me.hwnd, -2, 0,0,0,0, 1 or 2
Const HWND_NOTOPMOST = -2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Private Declare Sub 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)Private Sub Form_Activate()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: [email protected]
'Set the window position to topmost
SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
End Sub