6个回答
展开全部
如果要不会被DIRECTX全屏的程序覆盖,那么加上一个timer事件,每隔一秒就把窗口显示在前面,哈哈我测试过了有效,以前学过一个学期的VB。
代码如下
Option Explicit
Const Hwndx = -1
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 Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Dim XX As Long
XX = SetWindowPos(Me.Hwnd, Hwndx, 0, 0, 0, 0, 3)
End Sub
记住别忘加timer按钮
或者这样
建立模块
Option Explicit
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)
Private Sub Form_Load()
Dim rtn
'让窗口在顶层
rtn = SetWindowPos(Me.hwnd, -1, 0, 0, 0, 0, 3)
'取消窗口在顶层
'rtn = SetWindowPos(F_V.hwnd, -2, 0, 0, 0, 0, 3)
End Sub
代码如下
Option Explicit
Const Hwndx = -1
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 Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Dim XX As Long
XX = SetWindowPos(Me.Hwnd, Hwndx, 0, 0, 0, 0, 3)
End Sub
记住别忘加timer按钮
或者这样
建立模块
Option Explicit
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)
Private Sub Form_Load()
Dim rtn
'让窗口在顶层
rtn = SetWindowPos(Me.hwnd, -1, 0, 0, 0, 0, 3)
'取消窗口在顶层
'rtn = SetWindowPos(F_V.hwnd, -2, 0, 0, 0, 0, 3)
End Sub
展开全部
1、用setparent把DIRECTX全屏的程序作为自己程序中某个控件容器的子窗口。
2、把自己要置于最前面的控件设置为该控件容器最前面
3、OK。
2、把自己要置于最前面的控件设置为该控件容器最前面
3、OK。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Option Explicit
Const Hwndx = -1
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 Sub Form_Load()
Dim XX As Long
XX = SetWindowPos(Me.Hwnd, Hwndx, 0, 0, 0, 0, 3)
End Sub
Const Hwndx = -1
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 Sub Form_Load()
Dim XX As Long
XX = SetWindowPos(Me.Hwnd, Hwndx, 0, 0, 0, 0, 3)
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
不被DIRECTX全屏的程序覆盖似乎很困难,不过可以把使窗体在最上的代码放在时间事件中,很多时候是有效的,具体的让窗体在最上的代码很多,我就不贴了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
上面的好像不行???
运行时把鼠标放在窗口的位置时,只会有一个颜色很反常的窗口,并且被放大了.
运行时把鼠标放在窗口的位置时,只会有一个颜色很反常的窗口,并且被放大了.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询