|
|
LRESULT CALLBACK About2( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
switch( message )
{
case WM_INITDIALOG:
Lview = new LboxListview(
GetDlgItem( hDlg, IDC_LIST3 )
);
Lview->AddColumn( LVCFMT_LEFT, 150, "ファイル名" );
Lview->AddColumn( LVCFMT_RIGHT, 50, "サイズ" );
Lview->AddColumn( LVCFMT_LEFT, 150, "更新日" );
Lview->AddColumn( LVCFMT_LEFT, 100, "" );
Lview->AddColumn( LVCFMT_LEFT, 100, "8.3ファイル名" );
Lview->Grid();
Dlg = new LboxDlg( hDlg );
LoadFile( );
return TRUE;
case WM_COMMAND:
if( LOWORD(wParam) == IDCANCEL ) {
EndDialog(hDlg, LOWORD(wParam));
delete Lview;
delete Dlg;
return TRUE;
}
break;
}
return FALSE;
}
#define ROW_TO_COLUMN(a) \
szBuffer[0] = 0x00; \
Dlg->ListGetText( \
IDC_LIST2, \
a, \
szBuffer, \
sizeof( szBuffer ) \
); \
Lview->SetColumnText( a, szBuffer );
void LoadFile( void )
{
LboxEnumFile( GetDlgItem( Dlg->hDlg, IDC_LIST1 ), 0 );
int nRows,i;
nRows = Dlg->ListCount( IDC_LIST1 );
for( i = 0; i < nRows; i++ ) {
Dlg->ListGetText(
IDC_LIST1,
i,
szBuffer,
sizeof( szBuffer )
);
Dlg->ListReset( IDC_LIST2 );
Dlg->ListToken( IDC_LIST2, szBuffer, "\t" );
szBuffer[0] = 0x00;
Dlg->ListGetText(
IDC_LIST2,
0,
szBuffer,
sizeof( szBuffer )
);
if ( lstrcmp( szBuffer, "." ) == 0 ) {
continue;
}
Lview->AddRow();
Lview->SetColumnText( 0, szBuffer );
ROW_TO_COLUMN(1);
ROW_TO_COLUMN(2);
ROW_TO_COLUMN(3);
ROW_TO_COLUMN(4);
}
}
| |
|
|
|
|
LRESULT CALLBACK About2( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
switch( message )
{
case WM_INITDIALOG:
Lview = new LboxListview(
GetDlgItem( hDlg, IDC_LIST3 )
);
Lview->AddColumn( LVCFMT_LEFT, 150, "ファイル名" );
Lview->AddColumn( LVCFMT_RIGHT, 50, "サイズ" );
Lview->AddColumn( LVCFMT_LEFT, 150, "更新日" );
Lview->AddColumn( LVCFMT_LEFT, 100, "" );
Lview->AddColumn( LVCFMT_LEFT, 100, "8.3ファイル名" );
Lview->Grid();
Dlg = new LboxDlg( hDlg );
LoadFile( );
return TRUE;
case WM_NOTIFY:
Lview->Notify( lParam );
if ( Lview->nCurrentId == IDC_LIST3 ) {
if ( Lview->Action == NM_DBLCLK ) {
if ( Lview->nCurrentRow == -1 ) {
break;
}
Lview->GetColumnText(
3,
szBuffer,
sizeof( szBuffer )
);
if (lstrcmp(szBuffer,"ディレクトリ") == 0) {
Lview->GetColumnText(
0,
szBuffer,
sizeof( szBuffer )
);
SetCurrentDirectory( szBuffer );
Dlg->ListReset( IDC_LIST1 );
Lview->Reset();
LoadFile( );
}
}
}
break;
case WM_COMMAND:
if( LOWORD(wParam) == IDCANCEL ) {
EndDialog(hDlg, LOWORD(wParam));
delete Lview;
delete Dlg;
return TRUE;
}
break;
}
return FALSE;
}
| |
|
|
|