$Parent = GUICreate("")
$Form1 = GUICreate("InputPass", 109, 13, -1, -1, 0x80000000, 0, $Parent);弹出试窗口并且不在任务拦显示
$Info = WinGetPos($Form1)
$PasswordEdit = GUICtrlCreateInput("", 0, 0, 89, 15, 0x0020 + 0x0080, 0x00020000);密码输入框
$ButtonOk = GUICtrlCreateButton("ok", 90, 0, 20, 14, 0)
$Width = Width_() / 2 - ($Info[2] / 2);设置左侧在屏幕中间
DllCall("user32.dll", "long", "SetWindowPos", "long", $Form1, "long", -1, "long", $Width, "long", 0, "long", 0, "long", 0, "long", 1);置顶
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $ButtonOk
Exit
EndSelect
WEnd
;--------------------------------------返回分辨率宽度---------------------------
Func Width_()
Local $colItems = "", $Output = ""
$objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_DesktopMonitor", "WQL", 0x10 + 0x20)
For $objItem In $colItems
$Output = $objItem.ScreenWidth
Next
Return $Output
EndFunc ;==>Width_
|