回复 1# boyhong #Region
#PRE_Outfile=A.exe
#PRE_UseUpx=n
#PRE_Res_requestedExecutionLevel=None
#EndRegion
#Region
#EndRegion
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Example()
Func Example()
Local $hGUI = GUICreate("GUI 示例", 400, 100)
$btn = GUICtrlCreateButton("ok", 50, 20, 50, 50)
GUISetState(@SW_SHOW, $hGUI)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $btn
; 请求管理员权限
ShellExecute("C:\Windows\system32\notepad.exe", "", "", "runas")
EndSwitch
WEnd
GUIDelete($hGUI)
EndFunc
|