Changeset 749 in dev for trunk/ab5.0/abdev/abdev


Ignore:
Timestamp:
Sep 15, 2008, 6:06:34 PM (16 years ago)
Author:
dai
Message:

「フォルダを開く」コマンドで、ファイル選択を可能にした。

Location:
trunk/ab5.0/abdev/abdev
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/abdev/include/MainFrame.h

    r697 r749  
    3131
    3232    // Explorerでパスを開く
    33     void OpenExplorer( const std::string &path );
     33    void OpenExplorer( const std::string &filepath );
    3434
    3535    // 生成された
  • trunk/ab5.0/abdev/abdev/src/MainFrame.cpp

    r719 r749  
    77void SetupWindow(HWND hwnd);
    88void ResetTextEditFont(HWND hwnd);
     9
     10void 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}
    930
    1031void MainFrame::Resized()
     
    166187}
    167188
    168 void MainFrame::OpenExplorer( const std::string &path )
    169 {
    170     ShellExecute(m_hWnd,"explore",path.c_str(),NULL,NULL,SW_SHOWNORMAL);
     189void MainFrame::OpenExplorer( const std::string &filepath )
     190{
     191    CreateProcessWithStdHandle( "explorer", "/select,\"" + filepath + "\"" );
    171192}
    172193
     
    10981119}
    10991120
    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 
    11211121#ifndef THETEXT
    11221122void MainFrame::OnCmdDebug( UINT uNotifyCode, int nID, CWindow wndCtl )
     
    12131213
    12141214    extern ActiveBasic::Common::Platform::EnumType selectingPlatform;
    1215     CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary );
     1215    CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary, false );
    12161216}
    12171217
     
    12811281
    12821282    extern ActiveBasic::Common::Platform::EnumType selectingPlatform;
    1283     CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary );
    1284 
     1283    CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary, false );
    12851284}
    12861285
     
    13331332
    13341333    extern ActiveBasic::Common::Platform::EnumType selectingPlatform;
    1335     CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( platform ), temporary );
     1334    CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( platform ), temporary, false );
    13361335}
    13371336
     
    14011400
    14021401    extern ActiveBasic::Common::Platform::EnumType selectingPlatform;
    1403     CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary );
     1402    CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary, false );
    14041403}
    14051404
     
    16421641    int WndNum=GetWndNum(hChild);
    16431642
    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 );
    16491644}
    16501645
Note: See TracChangeset for help on using the changeset viewer.