完整代码:[au3]
#NoTrayIcon
#include <GUIConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
If FileExists(@HomeDrive&"\back.jpg") Then
$Backpic=@HomeDrive&"\back.jpg"
Else
$Backpic=@WindowsDir&"\abc.jpg"
EndIf
GUICreate("", @DesktopWidth, @DesktopHeight, "", "", $WS_POPUP)
GUICtrlCreatePic($Backpic,0,0,@DesktopWidth,@DesktopHeight,BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
;读取游戏配置文件
$name1 = IniRead(@WindowsDir&"\set.ini","game","name1","")
$name2 = IniRead(@WindowsDir&"\set.ini","game","name2","")
$name3 = IniRead(@WindowsDir&"\set.ini","game","name3","")
$name4 = IniRead(@WindowsDir&"\set.ini","game","name4","")
$name5 = IniRead(@WindowsDir&"\set.ini","game","name5","")
$game1 = IniRead(@WindowsDir&"\set.ini","game","game1","")
$game2 = IniRead(@WindowsDir&"\set.ini","game","game2","")
$game3 = IniRead(@WindowsDir&"\set.ini","game","game3","")
$game4 = IniRead(@WindowsDir&"\set.ini","game","game4","")
$game5 = IniRead(@WindowsDir&"\set.ini","game","game5","")
$Group1 = GUICtrlCreateGroup("Windows 游戏",10,220, 102, 120)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$label1 = GUICtrlCreateLabel ("F1 " & $name1 ,20,240)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$label2 = GUICtrlCreateLabel ("F2 " & $name2 ,20,260)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$label3 = GUICtrlCreateLabel ("F3 " & $name3 ,20,280)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$label4 = GUICtrlCreateLabel ("F4 " & $name4 ,20,300)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$label5 = GUICtrlCreateLabel ("F5 " & $name5 ,20,320)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
HotKeySet("{F1}","game1")
HotKeySet("{F2}","game2")
HotKeySet("{F3}","game3")
HotKeySet("{F4}","game4")
HotKeySet("{F5}","game5")
Sleep(10000)
Func game1()
If $game1 = "" Then
MsgBox(16,"出错", $name1 & "不存在 ")
Else
Run($game1)
EndIf
EndFunc
Func game2()
If $game2 = "" Then
MsgBox(16,"出错","游戏不存在 ")
Else
Run($game2)
EndIf
EndFunc
Func game3()
If $game3 = "" Then
MsgBox(16,"出错","游戏不存在 ")
Else
Run($game3)
EndIf
EndFunc
Func game4()
If $game4 = "" Then
MsgBox(16,"出错","游戏不存在 ")
Else
Run($game4)
EndIf
EndFunc
Func game5()
If $game5 = "" Then
MsgBox(16,"出错","游戏不存在 ")
Else
Run($game5)
EndIf
EndFunc[/au3]
配置文件(set.ini):
[game]
name1 = 扫雷
game1 = C:\Windows\system32\winmine.exe
name2 = 纸牌
game2 = C:\Windows\system32\sol.exe
name3 = 蜘珠纸牌
game3 = C:\Windows\system32\spider.exe
name4 = 空当接龙
game4 = C:\Windows\system32\freecell.exe
name5 = 红心大战
game5 = C:\Windows\system32\mshearts.exe
[ 本帖最后由 陌上风 于 2008-7-3 20:23 编辑 ] |