xiaomoami 发表于 2009-2-8 15:19:05

一个菜单选择器

写一个cs1.5 运行模式(全屏和窗口模式的选择),不知道用到那些函数?
   知道GUICreate

最好给我一个例子,这样我就没问题了。

GUICreate("模式选择",120,100)
Opt("GUICoordMode",2)
GUICtrlCreateButton ("全屏",10, 30, 50)
GUICtrlCreateButton ( "窗口",0, -1)
GUISetState ()
While 1
    $msg = GUIGetMsg()
   
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

WinWaitActive("cs1.5")
if (ControlClick("cs1.5","全屏","Button1")) Then
          Run("E:\单机游戏\CS1.5\hlds.exe")
            exit
ElseIf (ControlClick("cs1.5","窗口","Button2")) Then
          Run("E:\单机游戏\CS1.5\cs1.5.exe")
exit
EndIf
Exit

点击按钮 (button)后的动作怎么些 ,我点全屏和窗口都没有反应
谢谢





[ 本帖最后由 xiaomoami 于 2009-2-8 16:03 编辑 ]

xiaomoami 发表于 2009-2-8 15:44:21

自己顶一下

顽固不化 发表于 2009-2-8 15:47:44

不用顶了,你再把1楼写完整些~~~~~

xiaomoami 发表于 2009-2-8 15:53:37

不知道如何写了,很长时间没用au3了。点击按钮后的执行怎么写?

顽固不化 发表于 2009-2-8 15:55:31

看来你是很长时间没用AU3了,忘的比较彻底:face (33):

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 428, 184, -1, -1)
$Button1 = GUICtrlCreateButton("全屏", 48, 72, 137, 49, 0)
$Button2 = GUICtrlCreateButton("窗口", 248, 72, 145, 49, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                case $Button1
                        Run("E:\单机游戏\CS1.5\hlds.exe")
                        Exit
                Case $Button2
                        Run("E:\单机游戏\CS1.5\cs1.5.exe")
                        Exit
        EndSwitch
WEnd

xiaomoami 发表于 2009-2-8 16:03:27

谢谢,丢掉的东西要找回来。谢谢

5209520 发表于 2016-10-7 16:44:50

不错 好文章
页: [1]
查看完整版本: 一个菜单选择器