// ********************************************************* // オペレータイベント // ********************************************************* void MyClass::ProcOperator() { switch( ControlId ) { case IDM_FILEOPEN: { LboxString LString; LboxCommdlg Commdlg( this->hWnd ); Commdlg.lpstrTitle = "ファイルを開く"; Commdlg.lpstrFilter = "テキスト,*.txt,全て,*.*"; Commdlg.lpstrInitialDir = "C:\\TEMP"; if ( Commdlg.OpenFileName( &LString ) ) { MsgOk( "%s が選択されました", LString.szLboxString ); } break; } } }
// ********************************************************* // オペレータイベント // ********************************************************* void MyClass::ProcOperator() { switch( ControlId ) { case IDM_FILEOPEN: { LboxString LString; LboxCommdlg Commdlg( this->hWnd ); Commdlg.lpstrTitle = "ファイルを開く"; Commdlg.lpstrFilter = "テキスト,*.txt,全て,*.*"; Commdlg.lpstrInitialDir = "C:\\TEMP"; Commdlg.lpstrDefExt = "txt"; if ( Commdlg.SaveFileName( &LString ) ) { MsgOk( "%s が選択されました", LString.szLboxString ); } break; } } }
switch( ControlId ) { case IDM_FILEOPEN: { LboxString LString; LboxCommdlg Commdlg( this->hWnd ); Commdlg.lpstrTitle = "ファイルを開く"; Commdlg.lpstrFilter = "テキスト,*.txt,全て,*.*"; Commdlg.lpstrInitialDir = "C:\\TEMP"; LString.Resize( 4096 ); if ( Commdlg.OpenFileNames( &LString ) ) { LView->Initialize(); LView->AddColumn( "OpenFileNames で取得された情報" ); LView->AddRow(); LView->SetColumnText( 0, &LString ); DWORD i; for( i = 0; i < LString.nLboxString; i++ ) { if ( LString.szLboxString[i] == 0x00 ) { if ( LString.szLboxString[i+1] == 0x00 ) { break; } LView->AddRow(); LView->SetColumnText( 0, LString.szLboxString + i + 1 ); } } LView->Fit(); } break; } }
// ********************************************************* // オペレータイベント // ********************************************************* void MyClass::ProcOperator() { switch( ControlId ) { case IDM_FILEOPEN: { LboxString LString; LboxCommdlg Commdlg( this->hWnd ); Commdlg.lpstrTitle = "ディレクトリ選択"; // Commdlg.uFolderFlg = BIF_RETURNONLYFSDIRS | 0x0040; if ( Commdlg.GetFolderName( &LString ) ) { MsgOk( "%s が選択されました", LString.szLboxString ); } break; } } }