OzzFan
Member
I'm trying to write a "wizard" in Windows 3.1 in C. I've created the three dialog boxes using the Resource Script Editor to create a main menu dialog, a backup menu dialog, and a restore menu dialog. From the main menu dialog the user should select either the Backup radio button or the Restore radio button which determines the next dialog box to appear. When I use the following code, only the Restore option works but not the Backup option. What am I doing wrong?
The Restore radio button successfully calls up the Restore menu dialog, and the Exit button correctly ends the application (DestroyWindow() is part of a separate loop). I'm assuming this may have something to do with radio buttons usually being part of an array or group? I've given them separate Resource IDs (IDB_BACKUP vs IDB_RESTORE) in the Resource Script Editor though. I'm certain I could get this working using regular buttons but I really want to use radio buttons instead. Anyone here familiar with writing Windows 3.1 applications?
C:
BOOL CALLBACK MainDlgProc( HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam )
{
switch( Message) {
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
if ( LOWORD( wParam ) == IDB_BACKUP && NULL == hwndBackupDlg ) {
hwndBackupDlg = CreateDialog( hInst, MAKEINTRESOURCE( IDD_BACKUPDIALOG ), hwndMainDlg, (DLGPROC)BackupDlgProc );
return TRUE;
}
if ( LOWORD( wParam ) == IDB_RESTORE && NULL == hwndRestoreDlg ) {
hwndRestoreDlg = CreateDialog( hInst, MAKEINTRESOURCE( IDD_RESTOREDIALOG), hwndMainDlg, (DLGPROC)RestoreDlgProc );
return TRUE;
}
if ( LOWORD( wParam ) == IDB_EXIT ) {
EndDialog( hwndMainDlg, TRUE );
hwndMainDlg = NULL;
return TRUE;
}
}// end switch
return false;
}
The Restore radio button successfully calls up the Restore menu dialog, and the Exit button correctly ends the application (DestroyWindow() is part of a separate loop). I'm assuming this may have something to do with radio buttons usually being part of an array or group? I've given them separate Resource IDs (IDB_BACKUP vs IDB_RESTORE) in the Resource Script Editor though. I'm certain I could get this working using regular buttons but I really want to use radio buttons instead. Anyone here familiar with writing Windows 3.1 applications?
Last edited: