小妹向大家求助,希望能帮帮小妹
现在很多游戏和电影播放程序的全屏窗口的都是置顶的,我想把我程序的窗口置于所有程序的窗口之上,怎么办?谢谢!
首先在窗体添加一个命令按钮
窗体代码如下: 'SetWindowPos 函数声明 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 ' '使用常量声明 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOMOVE = &H2 Private Const HWND_TOPMOST = -1 Private Const HWND_NOTOPMOST = -2Private Sub Command1_Click() SetWindowPos Me.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, &H1 Or &H2 End Sub
Private Sub Form_Load() SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE End Sub
[此贴子已经被作者于2005-9-30 17:32:21编辑过]