|
LboxWin *Win;
LboxListview *Lview;
LboxListview *Lview2;
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
switch( message )
{
case WM_CREATE:
Win = new LboxWin( hWnd );
Lview = new LboxListview(
hWnd,
LBOX_LISTVIEW_CREATE
);
Lview->Grid( );
Lview->SetFont( 0, 10, false );
Lview->AddColumn( "パス" );
Lview->Fit();
Lview2 = new LboxListview(
hWnd,
LBOX_LISTVIEW_CREATE
);
Lview2->Grid( );
Lview2->SetFont( 0, 10, false );
Lview2->AddColumn( "№" );
Lview2->AddColumn( "ファイル名" );
Lview2->Fit();
break;
case WM_SIZE:
Lview->ParentFit(
(DWORD)wParam,
0, 0,
Win->ClientWidth()/2, 0
);
Lview2->ParentFit(
(DWORD)wParam,
Lview->Width()-1, 0,
0, 0
);
break;
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// メニュー選択の解析:
switch( wmId )
{
case IDM_GETDIR:
{
LboxCommdlg Commdlg;
LboxString Path;
if ( Commdlg.GetFolderName( &Path ) ) {
Lview->Reset();
Lview2->Reset();
Lview->AddRow();
Lview->SetColumnText( 0, &Path );
Lview->Fit();
SearchFunc( NULL );
}
break;
}
case IDM_EXIT:
DestroyWindow( hWnd );
break;
default:
return DefWindowProc(
hWnd,
message,
wParam,
lParam
);
}
break;
case WM_DESTROY:
delete Lview;
delete Win;
PostQuitMessage( 0 );
break;
default:
return DefWindowProc( hWnd, message, wParam, lParam );
}
return 0;
}
| |