         IniWrite, WCMD_CHN.MNU, %TCINI%, Configuration, Mainmenu
         IniWrite, 0, %TCINI%, Configuration, RestrictInterface
 
-        WinClose, AHK_CLASS TTOTAL_CMD
+        WinClose, ahk_class TTOTAL_CMD
 
         Loop, 4
         {
             Sleep, 50
             Run, %TCPath%
-            IfWinNotActive, AHK_CLASS TTOTAL_CMD
-                WinActivate, AHK_CLASS TTOTAL_CMD
+            IfWinNotActive, ahk_class TTOTAL_CMD
+                WinActivate, ahk_class TTOTAL_CMD
             else
                 Break
             Sleep, 100


        ControlSetText, %TCEdit%, cd %USERPROFILE%\desktop\, ahk_class TTOTAL_CMD
        ControlSend, %TCEdit%, {enter}, ahk_class TTOTAL_CMD
        ControlGetFocus, Ctrl, AHK_CLASS TTOTAL_CMD
        Postmessage, 0x19E, 1, 1, %Ctrl%, AHK_CLASS TTOTAL_CMD
Return

;<TC_CreateFileShortcutToStartup>: >>创建当前光标下文件的快捷方式并发送到启动文件里


; 确认新建文件
NewFileOK:
    GuiControlGet, SrcPath, , Edit1
    GuiControlGet, NewFileName, , Edit2

    ClipSaved := ClipboardAll
    Clipboard :=
    GoSub, <cm_CopySrcPathToClip>
    ClipWait, 2
    DstPath := Clipboard
    Clipboard := ClipSaved
    ClipSaved := ""

    if (DstPath == "")
    {
        return
    }

    if (InStr(DstPath, "\\") == 1)
    {
        if (RegExMatch(DstPath, "^\\\\(计算机|所有控制面板项|Fonts|网络|打印机|回收站)$"))
        {
            MsgBox, 0, 提示, 无法在此处创建新文件
            Gui, Destroy
            return
        }
        else if (DstPath == "\\桌面")
        {
            DstPath := A_Desktop
        }
    }

    NewFile := DstPath . "\" . NewFileName
    if FileExist(NewFile)
    {
        MsgBox, 4, 新建文件, 新建文件已存在，是否覆盖？
        IfMsgBox No
        {
            return
        }
    }

    if FileExist(SrcPath)
    {
        FileCopy, %SrcPath%, %NewFile%, 1
    }
    else
    {
        Run, fsutil file createnew "%NewFile%" 0, , Hide
    }

    Gui, Destroy
    WinActivate, ahk_class TTOTAL_CMD
    ControlGetFocus, FocusCtrl, ahk_class TTOTAL_CMD
    if (InStr(FocusCtrl, TCListBox) == 1)
    {
        GoSub, <cm_RereadSource>
        ControlGet, Text, List, , %FocusCtrl%, ahk_class TTOTAL_CMD
        Loop, Parse, Text, `n
        {
            if (InStr(A_LoopField, NewFileName) == 1)
            {
                Postmessage, 0x19E, % A_Index - 1, 1, %FocusCtrl%, ahk_class TTOTAL_CMD
                break
            }
        }
    }
return

;============================================================================
; ReadNewFile()
; 新建文件菜单
