/* * ThreadCtlProc */ INT_PTR CALLBACK RetCodeDlgProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { RetCodeInfo *info; WORD cmd; char buf[BUF_SIZE]; char *title; msg_id info_str_id; bool ret; ret = false; info = (RetCodeInfo *)GET_DLGDATA( hwnd ); switch( msg ) { case WM_INITDIALOG: info = (RetCodeInfo *)lparam; info->really_kill = FALSE; SET_DLGDATA( hwnd, lparam ); if( info->type == RETCD_THREAD ) { title = AllocRCString( STR_THREAD_RETURN_CODE ); info_str_id = STR_THREAD_X; } else { title = AllocRCString( STR_PROCESS_RETURN_CODE ); info_str_id = STR_PROCESS_X; } SetWindowText( hwnd, title ); FreeRCString( title ); RCsprintf( buf, info_str_id, info->type, info->id ); SetDlgItemText( hwnd, RET_PROC_INFO, buf ); SetDlgItemText( hwnd, RET_VALUE, "-1" ); ret = true; break; case WM_COMMAND: cmd = LOWORD( wparam ); switch( cmd ) { case IDOK: GetDlgItemText( hwnd, RET_VALUE, buf, BUF_SIZE ); if( !ParseNumeric( buf, TRUE, &info->rc ) ) { RCMessageBox( hwnd, STR_INVALID_RETURN_CODE, AppName, MB_OK | MB_ICONEXCLAMATION ); break; } info->really_kill = TRUE; SendMessage( hwnd, WM_CLOSE, 0, 0L ); break; case IDCANCEL: SendMessage( hwnd, WM_CLOSE, 0, 0L ); break; } ret = true; break; case WM_CLOSE: EndDialog( hwnd, 0 ); ret = true; break; } return( ret ); }
static BOOL readLogOptions( HWND hwnd, char *buf ) { DWORD asm_lines; DWORD asm_bkup; DWORD max_fsize; char numhelp[NUM_HELP_SIZE]; CopyRCString( STR_FIELD_MUST_BE_NUMERIC, numhelp, NUM_HELP_SIZE ); GetDlgItemText( hwnd, LOG_MAXFL, buf, BUF_SIZE ); if( !ParseNumeric( buf, FALSE, &max_fsize ) ) { RCsprintf( buf, STR_MAX_LOG_FILE_SIZE_INV, numhelp ); MessageBox( hwnd, buf, AppName, MB_OK | MB_ICONEXCLAMATION ); return( FALSE ); } GetDlgItemText( hwnd, LOG_DISASM_LINES, buf, BUF_SIZE ); if( !ParseNumeric( buf, FALSE, &asm_lines ) ) { RCsprintf( buf, STR_DISASM_LINES_INVALID, numhelp ); MessageBox( hwnd, buf, AppName, MB_OK | MB_ICONEXCLAMATION ); return( FALSE ); } GetDlgItemText( hwnd, LOG_DISASM_BACKUP, buf, BUF_SIZE ); if( !ParseNumeric( buf, FALSE, &asm_bkup ) ) { RCsprintf( buf, STR_DISASM_BKUP_INVALID, numhelp ); MessageBox( hwnd, buf, AppName, MB_OK | MB_ICONEXCLAMATION ); return( FALSE ); } GetDlgItemText( hwnd, LOG_FILE_NAME, LogData.logname, BUF_SIZE ); GetDlgItemText( hwnd, LOG_VIEWER, LogData.editor, BUF_SIZE ); LogData.asm_cnt = asm_lines; LogData.asm_bkup = asm_bkup; LogData.max_flen = max_fsize; LogData.log_process = IsDlgButtonChecked( hwnd, LOG_TASKS ); LogData.log_stacktrace = IsDlgButtonChecked( hwnd, LOG_STACK_TRACE ); LogData.log_mem_manager = IsDlgButtonChecked( hwnd, LOG_MEM ); LogData.log_mem_dmp = IsDlgButtonChecked( hwnd, LOG_MEM_DMP ); LogData.query_notes = IsDlgButtonChecked( hwnd, LOG_QUERY_NOTES ); LogData.autolog = IsDlgButtonChecked( hwnd, LOG_AUTOLOG ); LogData.log_modules = IsDlgButtonChecked( hwnd, LOG_LOADED_MODULES ); return( TRUE ); }