江湖风云录铁北山攻略:哪位真正的高手能提供一个测试通过的,使窗口总在其它窗口最上面的JAVA程序

来源:百度文库 编辑:高校问答 时间:2024/04/28 06:31:44

VB
如何使我的窗口总在最前?使用api函数 SetWindowPos 可以很容易的作到。

顾名思义, SetWindowPos 就是完成设置窗口位置和状态(pos=position)的功能。源代码如下:

Option Explicit

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 HWND_TOPMOST& = -1
' 将窗口置于列表顶部,并位于任何最顶部窗口的前面
Private Const SWP_NOSIZE& = &H1
' 保持窗口大小
Private Const SWP_NOMOVE& = &H2
' 保持窗口位置

Private Sub Form_Load()
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
' 将窗口设为总在最前
End Sub

javascript中让窗口显示最前-_-

在弹出窗口中加入信息.

var win=window.open("","");
win.document.open('text/html','replace');
win.document.write("
win.document.write("");
win.document.write("");
win.location.reload();
win.focus();

设置窗口属性alwaysontop为真