|
本帖最后由 qq3911909 于 2009-12-17 16:40 编辑 #include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiButton.au3>
#NoTrayIcon
#Region ### START Koda GUI section ### Form=D:\AU3\VNC\Form1.kxf
$Form1 = GUICreate("盛锐电脑网络科技-----专用远程维护工具", 338, 190, 465, 356)
$Group1 = GUICtrlCreateGroup("盛锐电脑网络科技服务热线:020-34271932 13728065057", 8, 72, 313, 49)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("连接盛锐电脑", 16, 128, 123, 41)
$Button2 = GUICtrlCreateButton("联接东信恒通电脑", 168, 128, 115, 41)
$Pic1 = GUICtrlCreatePic("D:\AU3\VNC\123.bmp", 8, 8, 321, 57, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
RegWrite ( "HKEY_CURRENT_USER\Software\ORL" )
RegWrite ( "HKEY_CURRENT_USER\Software\ORL\VNCHooks" )
RegWrite ( "HKEY_CURRENT_USER\Software\ORL\VNCHooks\Application_Prefs" )
RegWrite ( "HKEY_CURRENT_USER\Software\ORL\WinVNC3", "SocketConnect", "REG_DWORD", 0x00000000 )
RegWrite ( "HKEY_CURRENT_USER\Software\ORL\WinVNC3", "HTTPConnect", "REG_DWORD", 0x00000000 )
RegWrite ( "HKEY_CURRENT_USER\Software\ORL\WinVNC3", "AutoPortSelect", "REG_DWORD", 0x00000001 )
RegWrite ( "HKEY_CURRENT_USER\Software\ORL\WinVNC3", "InputsEnabled", "REG_DWORD", 0x00000001 )
RegWrite ( "HKEY_CURRENT_USER\Software\ORL\WinVNC3", "LocalInputsDisabled", "REG_DWORD", 0x00000000 )
RegWrite ( "HKEY_CURRENT_USER\Software\ORL\WinVNC3", "IdleTimeout", "REG_DWORD", 0x00000000 )
RegWrite ( "HKEY_CURRENT_USER\Software\ORL\WinVNC3", "LockSetting", "REG_DWORD", 0x00000000 )
RegWrite ( "HKEY_CURRENT_USER\Software\ORL\WinVNC3", "RemoveWallpaper", "REG_DWORD", 0x00000001 )
;RegWrite ( "HKEY_CURRENT_USER\Software\ORL\WinVNC3", "Password", "REG_BINARY", 0000 )
RegWrite ( "HKEY_CURRENT_USER\Software\ORL\WinVNC3", "PollUnderCursor", "REG_DWORD", 0x00000000 )
RegWrite ( "HKEY_CURRENT_USER\Software\ORL\WinVNC3", "PollForeground", "REG_DWORD", 0x00000001 )
RegWrite ( "HKEY_CURRENT_USER\Software\ORL\WinVNC3", "PollFullScreen", "REG_DWORD", 0x00000000 )
RegWrite ( "HKEY_CURRENT_USER\Software\ORL\WinVNC3", "OnlyPollConsole", "REG_DWORD", 0x00000001 )
RegWrite ( "HKEY_CURRENT_USER\Software\ORL\WinVNC3", "OnlyPollOnEvent", "REG_DWORD", 0x00000000 )
$ipini = "ip.ini"
If Not FileExists($ipini) Then
$ipini = @ScriptDir & "\ip.ini"
If Not FileExists($ipini) Then
$ipini = @WorkingDir & "\ip.ini"
EndIf
EndIf
If Not FileExists($ipini) Then
IniWrite("ip.ini", "Setting", "盛锐电脑","192.168.1.250")
IniWrite("ip.ini", "Setting", "东信恒通","192.168.1.210")
EndIf
#cs
If ProcessExists ("444568.exe") Then
ShellExecute ("444568.exe","-kill","","",@SW_MINIMIZE)
Else
ShellExecute ("444568.exe","-run","","",@SW_MINIMIZE)
EndIf
#ce
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ProcessClose("444568.exe")
Exit
Case $Button1
$ip = IniRead ("ip.ini","Setting","盛锐电脑","192.168.1.250")
;ShellExecute ("444568.exe","-connect ","","",@SW_MINIMIZE)
;#cs
If ProcessExists ("444568.exe") Then
ProcessClose ( "444568.exe")
;ShellExecute ("444568.exe","-kill","","",@SW_MINIMIZE)
EndIf
;#ce
Sleep (2000)
ShellExecute ("444568.exe","","","",@SW_MINIMIZE)
Sleep (2000)
ShellExecute ("444568.exe ","-connect "&$ip,"","",@SW_MINIMIZE)
Case $Button2
$ip = IniRead ("ip.ini","Setting","东信恒通","192.168.1.210")
;ShellExecute ("444568.exe","-connect ","","",@SW_MINIMIZE)
;#cs
If ProcessExists ("444568.exe") Then
ProcessClose ( "444568.exe")
;ShellExecute ("444568.exe","-kill","","",@SW_MINIMIZE)
EndIf
;#ce
Sleep (2000)
ShellExecute ("444568.exe","","","",@SW_MINIMIZE)
Sleep (2000)
ShellExecute ("444568.exe ","-connect "&$ip,"","",@SW_MINIMIZE)
Case Else
EndSwitch
WEnd
#cs
Sleep (5000)
WinWaitActive("盛锐电脑网络科技-----专用远程维护工具")
_GUICtrlButton_Click($Button1)
这个工具我想他执行后,,用户在5秒内没有按下任何一个按钮,程序默认帮它按下一个按钮...
还有就是帮我优化下代码...刚刚学AU3,,,代码写的很乱....我想学习下高手是怎么写代码...
谢谢 |
|