找回密码
 加入
搜索
查看: 1805|回复: 6

一个菜单选择器

[复制链接]
发表于 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 编辑 ]
 楼主| 发表于 2009-2-8 15:44:21 | 显示全部楼层
自己顶一下
发表于 2009-2-8 15:47:44 | 显示全部楼层
不用顶了,你再把1楼写完整些~~~~~
 楼主| 发表于 2009-2-8 15:53:37 | 显示全部楼层
不知道如何写了,很长时间没用au3了。点击按钮后的执行怎么写?
发表于 2009-2-8 15:55:31 | 显示全部楼层
看来你是很长时间没用AU3了,忘的比较彻底

#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
 楼主| 发表于 2009-2-8 16:03:27 | 显示全部楼层
谢谢,丢掉的东西要找回来。谢谢
发表于 2016-10-7 16:44:50 | 显示全部楼层
不错 好文章
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-24 16:30 , Processed in 0.073611 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表