static const long g_HotKeyCMD = WM_USER + 1;
::RegisterHotKey(this->m_hWnd, ::g_HotKeyCMD, MOD_WIN, ‘Z‘);
BEGIN_MESSAGE_MAP(CXBATDlg, CDialog)ON_MESSAGE(WM_HOTKEY, OnHotKay)...END_MESSAGE_MAP()
LRESULT CXBATDlg::OnHotKay(WPARAM wParam, LPARAM pParam){if (wParam == ::g_HotKeyCMD){// ...return 0;}//...return 0;}
BOOL CXBATDlg::PreTranslateMessage(MSG* pMsg){this->UpdateData();if(pMsg->wParam == VK_RETURN){static CString batPath = "";if (batPath == ""){CString strAppPath;CXBATDlg::GetAppPath(strAppPath);batPath = strAppPath + "MyBAT\\run.bat";}::ShellExecute(this->m_hWnd, "open", batPath,this->m_CMD.GetBuffer(), NULL, SW_HIDE);this->m_CMD = "";this->UpdateData(FALSE);return true;}return CDialog::PreTranslateMessage(pMsg);}
if %1==bd (start /max "C:\...\360se.exe" "www.baidu.com")
if %1==bd (call openurl "www.baidu.com")
start "C:\...\VSLauncher.exe" "%1"
start /max "C:\...\360se.exe" %1
start "" %1
start %1
set found=0@echo off&setlocal enabledelayedexpansionfor /f "tokens=1,2,3 delims= " %%i in (store.txt) do (if %%i==%1 (set p=%%j&set p1=!p:#p#=%path%!&set p2=!p1:#f#=%folder%!&set p3=!p2:#s#=%SystemRoot%!if %%k==s (call opensln !p3!)if %%k==f (call openfolder !p3!)if %%k==u (call openurl !p3!)if %%k==o (call openexe !p3!)echo 找到选项 %%kset found=1))
kfgj E:\开发工具 fgjrj E:\工具软件 fdzs E:\电子书 fbd www.baidu.com ucbs http://www.cnblogs.com ucsdn www.csdn.net ua http://localhost/admin uh http://localhost/ u126 www.126.com uwk http://wenku.baidu.com urz F:\.../...xls oss F:\...\.....sln s
if %found%==1 (goto start)if %1==iisreset (start iisresetgoto start)if %1==iis (start C:\WINDOWS\system32\inetsrv\iis.mscgoto start)if %1==fw (start %SystemRoot%\system32\services.msc /sgoto start)if %1==yc (start %SystemRoot%\system32\mstsc.exegoto start)if %1==jsq (start %SystemRoot%\system32\calc.exegoto start)
原文地址:http://blog.csdn.net/xumingxsh/article/details/38752851