注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

临颍中远电脑科技

专业装机,网吧维护,电脑维修,网络监控,数据恢复,

 
 
 

日志

 
 

P处理转AU3  

2012-03-28 11:30:15|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=D:\autoit3\Aut2Exe\Icons\apple.ico
#AutoIt3Wrapper_outfile=_BatToAU3ToRun.exe
#AutoIt3Wrapper_Res_Comment=_BatToAU3ToRun
#AutoIt3Wrapper_Res_Description=_BatToAU3ToRun
#AutoIt3Wrapper_Res_Fileversion=1.3.0.0
#AutoIt3Wrapper_Res_LegalCopyright=lixiaolong - http://www.autoitx.com/
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <Misc.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
 
_Singleton(" _BatToAU3 ~To Run~ 1.3 by lixiaolong")
Opt("TrayIconHide", 1)
GUICreate(" _BatToAU3 ~To Run~ 1.3 by lixiaolong", 660, 480)
$RegName = GUICtrlCreateEdit("", 10, 30, 640, 160, BitOR($ES_AUTOVSCROLL, $WS_VSCROLL, $ES_MULTILINE, $ES_WANTRETURN))
GUICtrlCreateLabel('DOS命令:', 10, 10, '', 15)
$RegADD = GUICtrlCreateEdit("", 10, 215, 640, 160, BitOR($ES_AUTOVSCROLL, $WS_VSCROLL, $ES_MULTILINE, $ES_WANTRETURN))
GUICtrlCreateLabel('转换后:', 10, 195, '', 15)
$ying = GUICtrlCreateRadio("隐藏指定窗口", 10, 385, 100)
GUICtrlSetState(-1, $GUI_CHECKED)
$zuida = GUICtrlCreateRadio("最大化指定窗口", 130, 385, 120)
$Run = GUICtrlCreateCheckbox("Run", 270, 385)
$rundos = GUICtrlCreateCheckbox("RunDos", 340, 385)
$rundosIn = GUICtrlCreateCheckbox("RunDos(付加 #include <Process.au3>)", 400, 385)
$btn2 = GUICtrlCreateButton("转换", 10, 415, 640, 20)
$btn3 = GUICtrlCreateButton("复制", 10, 435, 640, 20)
$btn4 = GUICtrlCreateButton("清除", 10, 455, 640, 20)
GUISetState()
WinSetOnTop(" _BatToAU3 -To Run- by lixiaolong", '', 1)
 
While 1
        $msg = GUIGetMsg()
        Select
                Case $msg = $btn2
                        $RegNameRead = GUICtrlRead($RegName)
                        If $RegNameRead <> '' Then
                                If GUICtrlRead($rundos) = $GUI_CHECKED Then
                                        _ToRunDos($RegNameRead, 0)
                                ElseIf GUICtrlRead($rundosIn) = $GUI_CHECKED Then
                                        _ToRunDos($RegNameRead, 1)
                                Else
                                        If GUICtrlRead($ying) = $GUI_CHECKED Then
                                                _BatToAU3($RegNameRead, "@SW_HIDE")
                                        Else
                                                _BatToAU3($RegNameRead, "@SW_MAXIMIZE")
                                        EndIf
                                EndIf
                        EndIf
                Case $msg = $Run
                        CHECKED($Run)
                Case $msg = $rundos
                        CHECKED($rundos)
                Case $msg = $rundosIn
                        CHECKED($rundosIn)
                Case $msg = $btn3
                        If GUICtrlRead($RegADD) <> '' Then ClipPut(GUICtrlRead($RegADD))
                Case $msg = $btn4
                        GUICtrlSetData($RegADD, '')
                        GUICtrlSetData($RegName, '')
                Case $msg = $GUI_EVENT_CLOSE
                        Exit
        EndSelect
WEnd
 
Func CHECKED($CHECKED)
        GUICtrlSetState($Run, $GUI_UNCHECKED)
        GUICtrlSetState($rundos, $GUI_UNCHECKED)
        GUICtrlSetState($rundosIn, $GUI_UNCHECKED)
        GUICtrlSetState($CHECKED, $GUI_CHECKED)
EndFunc   ;==>CHECKED
 
Func _BatToAU3($BatFile, $SW)
        Local $BatToRun, $RunWait = 'RunWait'
        $String = StringSplit($BatFile & @CRLF, @CRLF)
        If GUICtrlRead($Run) = $GUI_CHECKED Then $RunWait = 'Run'
        For $i = 1 To $String[0] - 1
                If $String[$i] Then _
                                $BatToRun &= $RunWait & "(@ComSpec & ' /c ' & '" & StringReplace(StringReplace($String[$i], "'", "'" & _
                                ' & "' & "'" & '" & _' & @CRLF & "'"), "%%", "%") & "', '', " & $SW & ')' & @CRLF
        Next
        GUICtrlSetData($RegADD, $BatToRun)
EndFunc   ;==>_BatToAU3
 
Func _ToRunDos($BatFile, $Frag)
        Local $BatToRunDos, $Include = ""
        $String = StringSplit($BatFile & @CRLF, @CRLF)
 
        For $i = 1 To $String[0] - 1
                If $String[$i] Then
                        $BatToRunDos &= "_RunDos('" & StringReplace(StringReplace($String[$i], "'", "'" & _
                                        ' & "' & "'" & '" & _' & @CRLF & "'"), "%%", "%") & "')" & @CRLF
                EndIf
        Next
        If $Frag Then $Include = "#include <Process.au3>" & @CRLF & @CRLF
        GUICtrlSetData($RegADD, $Include & $BatToRunDos)
EndFunc   ;==>_ToRunDos
  评论这张
 
阅读(564)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017