void SetConfig () { if (paramchanged) { if (curr_res != prev_res || curr_fullscreen != prev_fullscreen) { // these changes require a new VideoMode param.res_type = curr_res; param.fullscreen = curr_fullscreen; #if defined (OS_WIN32_MINGW) // on windows we need to free and restore a lot of resources if (!param.restart_on_res_change) RestartSDL (); #elif defined (OS_LINUX) // on linux the resources seem to be kept at new VideoMode if (curr_res > 0) Winsys.SetupVideoMode (curr_res); else RestartSDL (); #endif } // the followind config params don't require a new VideoMode // they only must stored in the param structure (and saved) param.music_volume = curr_mus_vol; Music.SetVolume (param.music_volume); param.sound_volume = curr_sound_vol; param.perf_level = curr_detail_level; Winsys.SetFonttype (); if (param.language != curr_language) { param.language = curr_language; Trans.LoadTranslations (curr_language); } SaveConfigFile (); } Winsys.SetMode (g_game.prev_mode); }
int config_AutoSaveConfigFile( vlc_object_t *p_this ) { size_t i_index; bool save = false; assert( p_this ); /* Check if there's anything to save */ module_t **list = module_list_get (NULL); for( i_index = 0; list[i_index] && !save; i_index++ ) { module_t *p_parser = list[i_index]; module_config_t *p_item, *p_end; if( !p_parser->i_config_items ) continue; for( p_item = p_parser->p_config, p_end = p_item + p_parser->confsize; p_item < p_end && !save; p_item++ ) { vlc_mutex_lock (p_item->p_lock); save = p_item->b_autosave && p_item->b_dirty; vlc_mutex_unlock (p_item->p_lock); } } module_list_free (list); return save ? VLC_SUCCESS : SaveConfigFile( p_this, NULL, true ); }
void SetConfig () { if (mus_vol->GetValue() != param.music_volume || sound_vol->GetValue() != param.sound_volume || size_t(language->GetValue()) != param.language || detail_level->GetValue() != param.perf_level || vid_orient->GetValue() != param.orient || sensit->GetValue() != param.sensit) { // the followind config params don't require a new VideoMode // they only must stored in the param structure (and saved) param.sensit = sensit->GetValue(); param.music_volume = mus_vol->GetValue(); Music.SetVolume (param.music_volume); param.sound_volume = sound_vol->GetValue(); param.perf_level = detail_level->GetValue(); Winsys.SetOrient(vid_orient->GetValue()); Winsys.SetFonttype (); if (param.language != size_t(language->GetValue())) { param.language = language->GetValue(); Trans.LoadTranslations (param.language); } SaveConfigFile (); } State::manager.RequestEnterState(*State::manager.PreviousState()); }
int config_AutoSaveConfigFile( vlc_object_t *p_this ) { int ret = VLC_SUCCESS; bool save = false; assert( p_this ); /* Check if there's anything to save */ module_t **list = module_list_get (NULL); vlc_rwlock_rdlock (&config_lock); for (size_t i_index = 0; list[i_index] && !save; i_index++) { module_t *p_parser = list[i_index]; module_config_t *p_item, *p_end; if( !p_parser->i_config_items ) continue; for( p_item = p_parser->p_config, p_end = p_item + p_parser->confsize; p_item < p_end && !save; p_item++ ) { save = p_item->b_autosave && p_item->b_dirty; } } if (save) /* Note: this will get the read lock recursively. Ok. */ ret = SaveConfigFile (p_this, NULL, true); vlc_rwlock_unlock (&config_lock); module_list_free (list); return ret; }
void InitConfig (char *arg0) { #if defined (OS_WIN32_MINGW) // the progdir is always the current dir param.config_dir = "config"; param.data_dir = "data"; param.configfile = param.config_dir + SEP + "options.txt"; #else char buff[256]; if (strcmp (arg0, "./etr") == 0) { // start from work directory char *s = getcwd (buff, 256); if (s==NULL) {}; } else { // start with full path strcpy (buff, arg0); if (strlen (buff) > 5) buff[strlen(buff)-3] = 0; } param.prog_dir = buff; struct passwd *pwent = getpwuid (getuid ()); param.config_dir = pwent->pw_dir; param.config_dir += SEP; param.config_dir += CONFIG_DIR; // or: param.config_dir = param.prog_dir + SEP + "config"; if (!DirExists (param.config_dir.c_str())) mkdir (param.config_dir.c_str(), 0775); param.data_dir = param.prog_dir + SEP + "data"; param.configfile = param.config_dir + SEP + "options"; #endif param.screenshot_dir = param.data_dir + SEP + "screenshots"; param.obj_dir = param.data_dir + SEP + "objects"; param.env_dir2 = param.data_dir + SEP + "env"; param.char_dir = param.data_dir + SEP + "char"; param.keyframe_dir = param.char_dir + SEP + "keyframes"; param.terr_dir = param.data_dir + SEP + "terrains"; param.tex_dir = param.data_dir + SEP + "textures"; param.common_course_dir = param.data_dir + SEP + "courses"; param.common_cup_dir = param.data_dir + SEP + "cups"; param.sounds_dir = param.data_dir + SEP + "sounds"; param.music_dir = param.data_dir + SEP + "music"; param.font_dir = param.data_dir + SEP + "fonts"; param.trans_dir = param.data_dir + SEP + "translations"; param.player_dir = param.data_dir + SEP + "players"; param.ui_snow = true; param.view_mode = 1; param.display_fps = false; param.show_hud = true; if (FileExists (param.configfile.c_str())) { // SetConfigDefaults (); LoadConfigFile (); } else { SetConfigDefaults (); SaveConfigFile (); } string playerfile = param.config_dir + SEP + PLAYER_FILE; if (FileExists (playerfile.c_str())) { } else { } }
void CaMuleExternalConnector::ConnectAndRun(const wxString &ProgName, const wxString& ProgVersion) { if (m_NeedsConfigSave) { SaveConfigFile(); return; } #ifdef SVNDATE Show(CFormat(_("This is %s %s %s\n")) % wxString::FromAscii(m_appname) % wxT(VERSION) % wxT(SVNDATE)); #else Show(CFormat(_("This is %s %s\n")) % wxString::FromAscii(m_appname) % wxT(VERSION)); #endif // HostName, Port and Password if ( m_password.IsEmpty() ) { m_password = GetPassword(true); // MD5 hash for an empty string, according to rfc1321. if (m_password.Encode() == wxT("D41D8CD98F00B204E9800998ECF8427E")) { m_password.Clear(); } } if (!m_password.IsEmpty()) { // Create the socket Show(_("\nCreating client...\n")); m_ECClient = new CRemoteConnect(NULL); m_ECClient->SetCapabilities(m_ZLIB, true, false); // ZLIB, UTF8 numbers, notification // ConnectToCore is blocking since m_ECClient was initialized with NULL if (!m_ECClient->ConnectToCore(m_host, m_port, wxT("foobar"), m_password.Encode(), ProgName, ProgVersion)) { // no connection => close gracefully if (!m_ECClient->GetServerReply().IsEmpty()) { Show(CFormat(wxT("%s\n")) % m_ECClient->GetServerReply()); } Show(CFormat(_("Connection Failed. Unable to connect to %s:%d\n")) % m_host % m_port); } else { // Authenticate ourselves // ConnectToCore() already authenticated for us. //m_ECClient->ConnectionEstablished(); Show(m_ECClient->GetServerReply()+wxT("\n")); if (m_ECClient->IsSocketConnected()) { if (m_interactive) { ShowGreet(); } Pre_Shell(); TextShell(ProgName); Post_Shell(); if (m_interactive) { Show(CFormat(_("\nOk, exiting %s...\n")) % ProgName); } } } m_ECClient->DestroySocket(); } else { Show(_("Cannot connect with an empty password.\nYou must specify a password either in config file\nor on command-line, or enter one when asked.\n\nExiting...\n")); } }
void ParticleEditor::on_actionSaveConfig_triggered() { if (fileName.isEmpty()){ fileName = QFileDialog::getSaveFileName(this, FontChina::G2U("保存文件"), g_save_Dir, tr("Conf (*.conf)")); } if (fileName.isEmpty()){ return; } g_save_Dir = fileName.section("/", 0, -2); QString file1 = fileName.section(".", -1); bool need = false; !QString::compare(file1, "Conf", Qt::CaseInsensitive) ? need = false : need = true; if (need){fileName += ".Conf";} SaveConfigFile(fileName); }
void SetConfig () { if (mus_vol->GetValue() != param.music_volume || sound_vol->GetValue() != param.sound_volume || language->GetValue() != param.language || detail_level->GetValue() != param.perf_level #ifndef PANDORA || resolution->GetValue() != param.res_type || fullscreen->checked != param.fullscreen #endif ) { #ifndef PANDORA if (resolution->GetValue() != param.res_type || fullscreen->checked != param.fullscreen) { // these changes require a new VideoMode param.res_type = resolution->GetValue(); #ifdef _WIN32 if (fullscreen->checked == param.fullscreen) Winsys.SetupVideoMode(param.res_type); param.fullscreen = fullscreen->checked; #else param.fullscreen = fullscreen->checked; Winsys.SetupVideoMode(param.res_type); #endif } #endif // the followind config params don't require a new VideoMode // they only must stored in the param structure (and saved) param.music_volume = mus_vol->GetValue(); Music.SetVolume (param.music_volume); param.sound_volume = sound_vol->GetValue(); param.perf_level = detail_level->GetValue(); Winsys.SetFonttype (); if (param.language != language->GetValue()) { param.language = language->GetValue(); Trans.LoadTranslations (param.language); } SaveConfigFile (); } State::manager.RequestEnterState(*State::manager.PreviousState()); }
void MyDialog2::OnSaveButton() { CFileDialog FileDialog(FALSE); CString FileName = "Default.olsr"; CString PathName; FileDialog.m_ofn.lpstrFilter = "Configuration file (*.olsr)\0*.olsr\0"; FileDialog.m_ofn.nFilterIndex = 1; FileDialog.m_ofn.lpstrFile = FileName.GetBuffer(500); FileDialog.m_ofn.nMaxFile = 500; if (FileDialog.DoModal() == IDOK) { PathName = FileDialog.GetPathName(); if (SaveConfigFile(PathName, 1) < 0) AfxMessageBox("Cannot save configuration file '" + PathName + "'."); } FileName.ReleaseBuffer(); }
void CWinsys::SetupVideoMode (const TScreenRes& resolution_) { Uint32 window_flags = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP; window = SDL_CreateWindow(WINDOW_TITLE, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, resolution.width, resolution.height, window_flags); if (NULL == window) { Message ("couldn't initialize video", SDL_GetError()); Message ("set to 800 x 600"); window = SDL_CreateWindow (WINDOW_TITLE, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, window_flags); param.res_type = 1; SaveConfigFile (); } int w, h; SDL_GetWindowSize(window, &w, &h); if (resolution.width == 0 && resolution.height == 0) { resolution.width = w; resolution.height = h; auto_resolution = resolution; } scale = CalcScreenScale (); if (param.use_quad_scale) scale = sqrt (scale); }
void CaMuleExternalConnector::ConnectAndRun(const wxString &ProgName, const wxString& ProgVersion) { if (m_NeedsConfigSave) { SaveConfigFile(); return; } #ifdef SVNDATE Show(CFormat(_("This is %s %s %s\n")) % wxString::FromAscii(m_appname) % wxT(VERSION) % wxT(SVNDATE)); #else Show(CFormat(_("This is %s %s\n")) % wxString::FromAscii(m_appname) % wxT(VERSION)); #endif // HostName, Port and Password if ( m_password.IsEmpty() ) { wxString pass_plain; #ifndef __WXMSW__ pass_plain = char2unicode(getpass("Enter password for mule connection: ")); #else //#warning This way, pass enter is not hidden on windows. Bad thing. char temp_str[512]; fflush(stdin); printf("Enter password for mule connection: \n"); fflush(stdout); fgets(temp_str, 512, stdin); temp_str[strlen(temp_str)-1] = '\0'; pass_plain = char2unicode(temp_str); #endif wxCHECK2(m_password.Decode(MD5Sum(pass_plain).GetHash()), /* Do nothing. */ ); // MD5 hash for an empty string, according to rfc1321. if (m_password.Encode() == wxT("D41D8CD98F00B204E9800998ECF8427E")) { m_password.Clear(); } // Clear plain-text password pass_plain = wxT("01234567890123456789"); }
Settings::~Settings() { SaveConfigFile(); }
void CParsingConfig::SaveConfigBox(std::string strFileName) { SaveConfigFile(strFileName, m_pConfigBox); }
void CParsingConfig::MakeDefaultConfigFile(std::string strFileName) { ConfigBox configBox; InitConfigBox(&configBox); SaveConfigFile(strFileName, &configBox); }
bool CaMuleExternalConnector::OnCmdLineParsed(wxCmdLineParser& parser) { if (parser.Found(wxT("version"))) { printf("%s %s\n", m_appname, (const char *)unicode2char(GetMuleVersion())); return false; } if (!parser.Found(wxT("config-file"), &m_configFileName)) { m_configFileName = GetConfigDir() + wxT("remote.conf"); } wxString aMuleConfigFile; if (parser.Found(wxT("create-config-from"), &aMuleConfigFile)) { aMuleConfigFile = FinalizeFilename(aMuleConfigFile); if (!::wxFileExists(aMuleConfigFile)) { fprintf(stderr, "%s\n", (const char *)unicode2char(wxT("FATAL ERROR: File does not exist: ") + aMuleConfigFile)); exit(1); } CECFileConfig aMuleConfig(aMuleConfigFile); LoadAmuleConfig(aMuleConfig); SaveConfigFile(); m_configFile->Flush(); exit(0); } LoadConfigFile(); if ( !parser.Found(wxT("host"), &m_host) ) { if ( m_host.IsEmpty() ) { m_host = wxT("localhost"); } } long port; if (parser.Found(wxT("port"), &port)) { m_port = port; } wxString pass_plain; if (parser.Found(wxT("password"), &pass_plain)) { if (!pass_plain.IsEmpty()) { m_password.Decode(MD5Sum(pass_plain).GetHash()); } else { m_password.Clear(); } } if (parser.Found(wxT("write-config"))) { m_NeedsConfigSave = true; } parser.Found(wxT("locale"), &m_language); if (parser.Found(wxT("help"))) { parser.Usage(); return false; } m_KeepQuiet = parser.Found(wxT("quiet")); m_Verbose = parser.Found(wxT("verbose")); return true; }
int config_SaveConfigFile( vlc_object_t *p_this ) { return SaveConfigFile (p_this); }
int config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name ) { return SaveConfigFile( p_this, psz_module_name, false ); }
/* * HeapWalkProc - show task status */ BOOL FAR PASCAL HeapWalkProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { HMENU mh; HMENU mh2; HCURSOR hourglass; HCURSOR oldcursor; DLGPROC dlgproc; DWORD index; heap_list hl; GblWndInfo *info; RECT area; about_info ai; info = (GblWndInfo *)GetWindowLong( hwnd, 0 ); switch( msg ) { case WM_CREATE: InitPaintProc(); info = MemAlloc( sizeof( GblWndInfo ) ); if( info == NULL ) { ErrorBox( hwnd, STR_UNABLE_2_STARTUP, MB_OK | MB_ICONINFORMATION ); PostQuitMessage( 0 ); } memset( info, 0, sizeof( GblWndInfo ) ); SetWindowLong( hwnd, 0, (DWORD)info ); // hdc = GetDC( hwnd ); // ReleaseDC(hwnd, hdc); SetDisplayType( hwnd, &( info->list.title ), HEAPMENU_DISPLAY_INIT ); CreateListBox( hwnd, &info->list, GLOBAL_LB ); info->alloc_dlgproc = MakeProcInstance_DLG( AllocDlgProc, Instance ); info->alloc_dialog = JCreateDialog( Instance, "ALLOC_DLG", hwnd, info->alloc_dlgproc ); memset( &ResHwnd, 0, MAX_RES * sizeof( HWND ) ); break; case WM_MEASUREITEM: break; case WM_MOVE: GetWindowRect( hwnd, &area ); if( !info->minimized ) { Config.last_glob_xpos = Config.glob_xpos; Config.last_glob_ypos = Config.glob_ypos; Config.glob_xpos = area.left; Config.glob_ypos = area.top; } break; case WM_SIZE: ResizeListBox( LOWORD( lparam ), HIWORD( lparam ), &( info->list ) ); if( wparam == SIZE_MINIMIZED || wparam == SIZE_MAXIMIZED ) { Config.glob_xpos = Config.last_glob_xpos; Config.glob_ypos = Config.last_glob_ypos; } if( wparam == SIZE_MINIMIZED ) { info->minimized = TRUE; HideResources( TRUE ); } else if( info->minimized ) { HideResources( FALSE ); info->minimized = FALSE; } else if( wparam != SIZE_MAXIMIZED ) { GetWindowRect( hwnd, &area ); Config.glob_xsize = area.right - area.left; Config.glob_ysize = area.bottom - area.top; } return( DefWindowProc( hwnd, msg, wparam, lparam ) ); break; case WM_CLOSE: PostMessage( hwnd, WM_COMMAND, HEAPMENU_EXIT, 0L ); return( TRUE ); case WM_QUERYENDSESSION: SaveConfigFile( FALSE ); return( TRUE ); break; case WM_DESTROY: FiniPaintProc(); KillPushWin( info->list.title ); SaveConfigFile( FALSE ); if( info != NULL ) { FreeProcInstance_DLG( info->alloc_dlgproc ); MemFree( info ); } DestroyMonoFonts(); CvrCtl3dUnregister( Instance ); CvrCtl3DFini( Instance ); WWinHelp( hwnd, "heapwalk.hlp", HELP_QUIT, 0 ); PostQuitMessage( 0 ); break; case WM_ACTIVATEAPP: if( wparam && !NoRefresh ) { if( info->doing_add ) { info->need_refresh = TRUE; } else { InitHeapList( info->list.box, TRUE ); } } break; case WM_MENUSELECT: if( LOWORD( lparam & MF_POPUP ) ) { mh = GetMenu( hwnd ); mh2 = GetSubMenu( mh, 6 ); if( (HMENU)wparam == mh2 ) { ShowWindow( info->alloc_dialog, SW_SHOWNOACTIVATE ); } else if( (HMENU)wparam != GetSubMenu( mh2, 3 ) && (HMENU)wparam != GetSubMenu( mh2, 4 ) && (HMENU)wparam != GetSubMenu( mh2, 5 ) ) { ShowWindow( info->alloc_dialog, SW_HIDE ); } } return( DefWindowProc( hwnd, msg, wparam, lparam ) ); break; case WM_COMMAND: switch( wparam ) { case HEAPMENU_ABOUT: ai.owner = hwnd; ai.inst = Instance; ai.name = HWAllocRCString( STR_ABOUT_NAME ); ai.version = HWAllocRCString( STR_ABOUT_VERSION ); ai.title = HWAllocRCString( STR_ABOUT_TITLE ); DoAbout( &ai ); HWFreeRCString( ai.title ); HWFreeRCString( ai.version ); HWFreeRCString( ai.name ); break; case HEAPMENU_HELP_CONTENTS: WWinHelp( hwnd, "heapwalk.hlp", HELP_CONTENTS, 0 ); break; case HEAPMENU_HELP_SRCH: WWinHelp( hwnd, "heapwalk.hlp", HELP_PARTIALKEY, (HELP_DATA)(LPCSTR)"" ); break; case HEAPMENU_HELP_ON_HELP: WWinHelp( hwnd, "winhelp.hlp", HELP_HELPONHELP, 0 ); break; case HEAPEX_LIST: if( !info->doing_add ) { if( HIWORD( lparam ) == LBN_DBLCLK ) { ShowHeapObject( (HWND)LOWORD( lparam ) ); } } else { if( HIWORD( lparam ) == LBN_SELCHANGE || HIWORD( lparam ) == LBN_DBLCLK ) { RefreshAdd( info->add_dialog, info->list.box ); RedrawBox( info->list.box, index ); } } break; case HEAPMENU_GLOBAL_REFRESH: InitHeapList( info->list.box, TRUE ); break; case HEAPMENU_FONT: if( ChooseMonoFont( hwnd ) ) { ResetFont( info ); } break; case HEAPMENU_EXIT: DestroyWindow( hwnd ); FreeHeapList(); break; case HEAPMENU_DISPLAY_DPMI: case HEAPMENU_DISPLAY_ENTIRE: case HEAPMENU_DISPLAY_LRU: case HEAPMENU_DISPLAY_FREE: SetDisplayType( hwnd, &( info->list.title ), wparam ); InitHeapList( info->list.box, FALSE ); break; case HEAPMENU_SORT_ADDR: case HEAPMENU_SORT_HANDLE: case HEAPMENU_SORT_MODULE: case HEAPMENU_SORT_SIZE: case HEAPMENU_SORT_TYPE: case HEAPMENU_SORT_GRAN: case HEAPMENU_SORT_DPL: case HEAPMENU_SORT_FLAG: case HEAPMENU_SORT_LRU: mh = GetMenu( hwnd ); CheckMenuItem( mh, GSortType, MF_UNCHECKED | MF_BYCOMMAND ); CheckMenuItem( mh, wparam, MF_CHECKED | MF_BYCOMMAND ); if( GSortType != wparam ) { GSortType = wparam; SortHeapList(); ReDisplayHeapList( info->list.box, NULL ); } break; case HEAPMENU_OBJECT_SHOW: ShowHeapObject( info->list.box ); break; case HEAPMENU_OBJECT_DISCARD: if( GlobDiscardObj( info->list.box ) ) { InitHeapList( info->list.box, TRUE ); } break; case HEAPMENU_OBJECT_NEWEST: if( GlobSetObjPos( info->list.box, FALSE ) ) { if( GSortType == HEAPMENU_SORT_LRU ) { InitHeapList( info->list.box, TRUE ); } } break; case HEAPMENU_OBJECT_OLDEST: if( GlobSetObjPos( info->list.box, TRUE ) ) { if( GSortType == HEAPMENU_SORT_LRU ) { InitHeapList( info->list.box, TRUE ); } } break; case HEAPMENU_OBJECT_GET_SELECTOR: ShowSelector( info->list.box ); break; case HEAPMENU_GLOBAL_HEAPINFO: DisplayGlobHeapInfo( hwnd ); break; case HEAPMENU_GLOBAL_MEMORYINFO: DisplayMemManInfo( hwnd ); break; case HEAPMENU_GLOBAL_COMPACT: GlobalCompact( 0 ); InitHeapList( info->list.box, TRUE ); break; case HEAPMENU_GLOBAL_COMP_DISC: GlobalCompact( -1 ); InitHeapList( info->list.box, TRUE ); break; case HEAPMENU_GLOBAL_CODE_SIZE: dlgproc = MakeProcInstance_DLG( SetCodeDlgProc, Instance ); JDialogBox( Instance, "CODE_AREA_DLG", hwnd, dlgproc ); FreeProcInstance_DLG( dlgproc ); break; case HEAPMENU_FILE_SAVE: InitHeapList( info->list.box, TRUE ); SaveListBox( SLB_SAVE_TMP, PutOutGlobalHeader, DumpGlobalLine, Config.gfname, HeapWalkName, hwnd, info->list.box ); break; case HEAPMENU_FILE_SAVE_TO: InitHeapList( info->list.box, TRUE ); SaveListBox( SLB_SAVE_AS, PutOutGlobalHeader, DumpGlobalLine, Config.gfname, HeapWalkName, hwnd, info->list.box ); break; case HEAPMENU_SAVE_CONFIG: SaveConfigFile( TRUE ); break; case HEAPMENU_CONFIGURE: HWConfigure(); break; case HEAPMENU_LOCAL_MONITOR: index = CheckForLocalSelect( info ); if( index != LB_ERR ) { BeginMonitor( HeapList[index] ); } break; case HEAPMENU_COMPACT_AND_LOCALWALK: LocalCompact( -1 ); /* fall through */ case HEAPMENU_LOCAL_LOCALWALK: index = CheckForLocalSelect( info ); if( index != LB_ERR ) { LocalWalk( HeapList[index] ); } break; case HEAPMENU_GDI_LOCALWALK: if( GetDGroupItem( "GDI", &hl ) ) { LocalWalk( &hl ); } break; case HEAPMENU_USER_LOCALWALK: if( GetDGroupItem( "USER", &hl ) ) { LocalWalk( &hl ); } break; case HEAPMENU_FREE_ALL: MyFreeAllMem(); UpdateAllocInfo( info->alloc_dialog ); PaintAllWindows(); break; case HEAPMENU_FREE_1K: case HEAPMENU_FREE_2K: case HEAPMENU_FREE_5K: case HEAPMENU_FREE_10K: case HEAPMENU_FREE_25K: case HEAPMENU_FREE_50K: hourglass = LoadCursor( NULL, IDC_WAIT ); SetCapture( hwnd ); oldcursor= SetCursor( hourglass ); FreeSomeMem( wparam ); UpdateAllocInfo( info->alloc_dialog ); SetCursor( oldcursor ); ReleaseCapture(); PaintAllWindows(); break; case HEAPMENU_ALLOC_1K: case HEAPMENU_ALLOC_2K: case HEAPMENU_ALLOC_5K: case HEAPMENU_ALLOC_10K: case HEAPMENU_ALLOC_25K: case HEAPMENU_ALLOC_50K: hourglass = LoadCursor( NULL, IDC_WAIT ); SetCapture( hwnd ); oldcursor= SetCursor( hourglass ); AllocMore( wparam ); UpdateAllocInfo( info->alloc_dialog ); SetCursor( oldcursor ); ReleaseCapture(); PaintAllWindows(); break; case HEAPMENU_ALLOC_ALL: case HEAPMENU_ALLOC_BUT_1K: case HEAPMENU_ALLOC_BUT_2K: case HEAPMENU_ALLOC_BUT_5K: case HEAPMENU_ALLOC_BUT_10K: case HEAPMENU_ALLOC_BUT_25K: case HEAPMENU_ALLOC_BUT_50K: hourglass = LoadCursor( NULL, IDC_WAIT ); SetCapture( hwnd ); oldcursor= SetCursor( hourglass ); AllocAllBut( wparam ); UpdateAllocInfo( info->alloc_dialog ); SetCursor( oldcursor ); ReleaseCapture(); PaintAllWindows(); break; case HEAPMENU_ALLOC_NK: case HEAPMENU_ALLOC_BUT_NK: case HEAPMENU_FREE_NK: DoNBytes( hwnd, wparam ); UpdateAllocInfo( info->alloc_dialog ); PaintAllWindows(); break; case HEAPMENU_ADD: info->add_dialog = StartAdd( hwnd, &info->list ); if( info->add_dialog != NULL ) { info->doing_add = TRUE; info->need_refresh = FALSE; } else { ErrorBox( hwnd, STR_UNABLE_TO_ADD, MB_OK| MB_ICONINFORMATION ); } break; } break; case WM_USER: /* an owned window is being destroyed make sure * Windows doesn't take the focus away from us*/ NoRefresh = TRUE; SetFocus( hwnd ); NoRefresh = FALSE; break; default: return( DefWindowProc( hwnd, msg, wparam, lparam ) ); } return( FALSE ); } /* HeapWalkProc */