bool MerryController::ShellExecute(const wxString& commandName, const wxString& commandArg, const wxString& workingDir, const wxString& show) const { // wxLogNull logNo; wxString cmdName = commandName; int showCommand = SW_SHOW; bool runas = false; if (show.IsSameAs(wxT("hide"), false)) showCommand = SW_HIDE; else if (show.IsSameAs(wxT("min"), false)) showCommand = SW_SHOWMINIMIZED; else if (show.IsSameAs(wxT("max"), false)) showCommand = SW_SHOWMAXIMIZED; while(true) { UCHAR T = cmdName.GetChar(0).GetValue(); if (T == '@')//前导'@'隐藏窗口运行 showCommand = SW_HIDE; else if (T == '*')//前导'*' NT6以上请会管理员权限,NT5运行为 runas = true; else if (T == '>')//前导'>'请求管理员权限(NT6以上有效) { if (::wxGetWinVersion() >= wxWinVersion_6) runas = true; } else break; cmdName.erase(0,1); } if (!LocationExec) { __DEBUG_BEGIN(cmdName.c_str()); int ret = (int)::ShellExecute(NULL,(runas?_T("RunAs"):NULL), cmdName.c_str(), commandArg.c_str(), workingDir.c_str(), showCommand); if (ret > 32) return true; __DEBUG_BEGIN(wxString::Format("cmd.exe /c start \"\" /D \"%s\" \"%s\" %s",workingDir,cmdName,commandArg)); return (int)::WinExec(wxString::Format("cmd.exe /c start \"\" /D \"%s\" \"%s\" %s",workingDir,cmdName,commandArg),SW_HIDE) > 32; //wxString tmpName = GetFullCmdName(cmdName,workingDir,false); //if (tmpName.empty()) //{ // ::wxMessageBox(wxString::Format(wxT("无法运行 '%s'。请确定文件名是否正确后,再试一次。"),cmdName),cmdName,wxOK | wxICON_ERROR); // return false; //} //return (int)::ShellExecute(NULL,(runas?_T("RunAs"):NULL), tmpName.c_str(), commandArg.c_str(), workingDir.c_str(), showCommand)>32; } LocationExec = false;//定位文件位置标志复位 cmdName.Replace('/','\\'); cmdName = GetFullCmdName(cmdName,workingDir,true); #ifdef _ALMRUN_CONFIG_H_ if (!g_config->Explorer.empty()) return (int)::WinExec(wxString::Format("%s \"%s\"",g_config->Explorer,cmdName),SW_SHOW) > 32; #endif//ifdef _ALMRUN_CONFIG_H_ return (int)::ShellExecute(NULL,NULL,_T("explorer.exe"),_T("/n,/select,")+cmdName.c_str(),NULL, SW_SHOW) > 32; //return (int)::ShellExecute(NULL,NULL,g_config->Explorer.c_str(),wxString::Format(wxT("\"%s\""),cmdName),NULL, SW_SHOW) > 32; }
MerryMainPanel::~MerryMainPanel() { __DEBUG_BEGIN("") wxDELETE(menu); wxDELETE(m_textCtrl); __DEBUG_END("") }
MerryCommandManager::~MerryCommandManager() { __DEBUG_BEGIN("") clearCmds(plugin_commands); clearCmds(m_commands); __DEBUG_END("") }
DlgConfig::~DlgConfig() { __DEBUG_BEGIN("") ////@begin DlgConfig destruction this->Disconnect(ID_CHECKLISTBOX,wxEVT_COMMAND_LISTBOX_SELECTED,wxObjectEventFunction(&DlgConfig::OnConfigCheck)); ////@end DlgConfig destruction __DEBUG_END("") }
MerryTimerManager::~MerryTimerManager() { __DEBUG_BEGIN("") std::set<MerryTimer*>::iterator it = m_timers.begin(); for (; it != m_timers.end(); ++it) delete *it; __DEBUG_END("") }
cmdListCtrl::~cmdListCtrl() { __DEBUG_BEGIN("") this->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED); #ifndef _DISABLE_DND_ this->SetDropTarget(NULL); #endif __DEBUG_END("") }
HotkeyCtrl::HotkeyCtrl(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name): wxTextCtrl(parent,id,value,pos,size,style,validator,name) { WinDown = false; } HotkeyCtrl::~HotkeyCtrl() { __DEBUG_BEGIN("") __DEBUG_END("") } void HotkeyCtrl::onContextMenu(wxContextMenuEvent& e) { e.Skip(); } void HotkeyCtrl::OnKeyUpEvent(wxKeyEvent& e) { switch(e.GetKeyCode()) { case WXK_WINDOWS_LEFT: case WXK_WINDOWS_RIGHT: WinDown = false;
MerryKey::~MerryKey() { __DEBUG_BEGIN("") m_wxKeys.clear(); __DEBUG_END("") }
MerryTaskBarIcon::~MerryTaskBarIcon() { __DEBUG_BEGIN("") this->RemoveIcon(); __DEBUG_END("") }