Changeset 749 in dev for trunk/ab5.0/abdev/abdev
- Timestamp:
- Sep 15, 2008, 6:06:34 PM (16 years ago)
- Location:
- trunk/ab5.0/abdev/abdev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/abdev/include/MainFrame.h
r697 r749 31 31 32 32 // Explorerでパスを開く 33 void OpenExplorer( const std::string & path );33 void OpenExplorer( const std::string &filepath ); 34 34 35 35 // 生成された -
trunk/ab5.0/abdev/abdev/src/MainFrame.cpp
r719 r749 7 7 void SetupWindow(HWND hwnd); 8 8 void ResetTextEditFont(HWND hwnd); 9 10 void CreateProcessWithStdHandle( const std::string &appPath, const std::string &cmdLine, bool isShowWindow = true ) 11 { 12 std::string argsStr = "\"" + appPath + "\" " + cmdLine; 13 STARTUPINFO si; 14 PROCESS_INFORMATION pi; 15 memset(&si,0,sizeof(STARTUPINFO)); 16 si.cb=sizeof(STARTUPINFO); 17 si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; 18 si.wShowWindow = isShowWindow ? SW_SHOW : SW_HIDE; 19 si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); 20 si.hStdInput = GetStdHandle(STD_INPUT_HANDLE); 21 si.hStdError = GetStdHandle(STD_ERROR_HANDLE); 22 23 char args[8192]; 24 lstrcpy( args, argsStr.c_str() ); 25 26 CreateProcess( NULL, args, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi ); 27 CloseHandle( pi.hProcess ); 28 CloseHandle( pi.hThread ); 29 } 9 30 10 31 void MainFrame::Resized() … … 166 187 } 167 188 168 void MainFrame::OpenExplorer( const std::string & path )169 { 170 ShellExecute(m_hWnd,"explore",path.c_str(),NULL,NULL,SW_SHOWNORMAL);189 void MainFrame::OpenExplorer( const std::string &filepath ) 190 { 191 CreateProcessWithStdHandle( "explorer", "/select,\"" + filepath + "\"" ); 171 192 } 172 193 … … 1098 1119 } 1099 1120 1100 void CreateProcessWithStdHandle( const std::string &appPath, const std::string &cmdLine)1101 {1102 std::string argsStr = "\"" + appPath + "\" " + cmdLine;1103 STARTUPINFO si;1104 PROCESS_INFORMATION pi;1105 memset(&si,0,sizeof(STARTUPINFO));1106 si.cb=sizeof(STARTUPINFO);1107 si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;1108 si.wShowWindow = SW_HIDE;1109 si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);1110 si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);1111 si.hStdError = GetStdHandle(STD_ERROR_HANDLE);1112 1113 char args[8192];1114 lstrcpy( args, argsStr.c_str() );1115 1116 CreateProcess( NULL, args, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi );1117 CloseHandle( pi.hProcess );1118 CloseHandle( pi.hThread );1119 }1120 1121 1121 #ifndef THETEXT 1122 1122 void MainFrame::OnCmdDebug( UINT uNotifyCode, int nID, CWindow wndCtl ) … … 1213 1213 1214 1214 extern ActiveBasic::Common::Platform::EnumType selectingPlatform; 1215 CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary );1215 CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary, false ); 1216 1216 } 1217 1217 … … 1281 1281 1282 1282 extern ActiveBasic::Common::Platform::EnumType selectingPlatform; 1283 CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary ); 1284 1283 CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary, false ); 1285 1284 } 1286 1285 … … 1333 1332 1334 1333 extern ActiveBasic::Common::Platform::EnumType selectingPlatform; 1335 CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( platform ), temporary );1334 CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( platform ), temporary, false ); 1336 1335 } 1337 1336 … … 1401 1400 1402 1401 extern ActiveBasic::Common::Platform::EnumType selectingPlatform; 1403 CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary );1402 CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary, false ); 1404 1403 } 1405 1404 … … 1642 1641 int WndNum=GetWndNum(hChild); 1643 1642 1644 char temporary[1024], temp2[1024]; 1645 _splitpath(MdiInfo[WndNum]->path.c_str(),temporary,temp2,NULL,NULL); 1646 lstrcat(temporary,temp2); 1647 1648 OpenExplorer( temporary ); 1643 OpenExplorer( MdiInfo[WndNum]->path ); 1649 1644 } 1650 1645
Note:
See TracChangeset
for help on using the changeset viewer.