 {
     vim.mode("insert")
     GoSub, <cm_FocusCmdLine>
-    ControlGet, EditId, Hwnd, , AHK_CLASS TTOTAL_CMD
+    ControlGet, EditId, Hwnd, , ahk_class TTOTAL_CMD
 
     if (TC64bit)
     {
         FixTCEditId()
     }
 
-    ControlSetText, %TCEdit%, m, AHK_CLASS TTOTAL_CMD
-    Postmessage, 0xB1, 2, 2, %TCEdit%, AHK_CLASS TTOTAL_CMD
+    ControlSetText, %TCEdit%, m, ahk_class TTOTAL_CMD
+    Postmessage, 0xB1, 2, 2, %TCEdit%, ahk_class TTOTAL_CMD
     SetTimer, <MarkTimer>, 100
 }
 <MarkTimer>:

TC_BeforeActionDo()
{
    Global TC_SendPos
    WinGet, MenuID, ID, AHK_CLASS #32768
    if MenuID And (TC_SendPos <> 572)
        return True
    ControlGetFocus, ctrl, AHK_CLASS TTOTAL_CMD
    Ifinstring, ctrl, %TCListBox%
        return False
    return True


; 确认新建文件
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()
; 新建文件菜单
