/*:VRX Main */ /* Main */ Main: /* Process the arguments. Get the parent window. */ parse source . calledAs . parent = "" argCount = arg() argOff = 0 if( calledAs \= "COMMAND" )then do if argCount >= 1 then do parent = arg(1) argCount = argCount - 1 argOff = 1 end end; else do call VROptions 'ImplicitNames' call VROptions 'NoEchoQuit' end InitArgs.0 = argCount if( argCount > 0 )then do i = 1 to argCount InitArgs.i = arg( i + argOff ) end drop calledAs argCount argOff /* Load the windows */ call VRInit parse source . . spec _VREPrimaryWindowPath = , VRParseFileName( spec, "dpn" ) || ".VRW" _VREPrimaryWindow = , VRLoad( parent, _VREPrimaryWindowPath ) drop parent spec if( _VREPrimaryWindow == "" )then do call VRMessage "", "Cannot load window:" VRError(), , "Error!" _VREReturnValue = 32000 signal _VRELeaveMain end /* Process events */ call Init signal on halt do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) ) _VREEvent = VREvent() interpret _VREEvent end _VREHalt: _VREReturnValue = Fini() call VRDestroy _VREPrimaryWindow _VRELeaveMain: call VRFini exit _VREReturnValue VRLoadSecondary: __vrlsWait = abbrev( 'WAIT', translate(arg(2)), 1 ) if __vrlsWait then do call VRFlush end __vrlsHWnd = VRLoad( VRWindow(), VRWindowPath(), arg(1) ) if __vrlsHWnd = '' then signal __vrlsDone if __vrlsWait \= 1 then signal __vrlsDone call VRSet __vrlsHWnd, 'WindowMode', 'Modal' __vrlsTmp = __vrlsWindows.0 if( DataType(__vrlsTmp) \= 'NUM' ) then do __vrlsTmp = 1 end else do __vrlsTmp = __vrlsTmp + 1 end __vrlsWindows.__vrlsTmp = VRWindow( __vrlsHWnd ) __vrlsWindows.0 = __vrlsTmp do while( VRIsValidObject( VRWindow() ) = 1 ) __vrlsEvent = VREvent() interpret __vrlsEvent end __vrlsTmp = __vrlsWindows.0 __vrlsWindows.0 = __vrlsTmp - 1 call VRWindow __vrlsWindows.__vrlsTmp __vrlsHWnd = '' __vrlsDone: return __vrlsHWnd /*:VRX AddTheme */ AddTheme: PROCEDURE EXPOSE Settings. ThemeLibs. themefile = VRFileDialog( VRWindow(), NLVGetMessageText( 58 ), "O", "*.ITH") IF themefile == '' THEN RETURN 1 /* Two possibilities for the file type, based on the extension: * - .LST: Unpacked theme * - .ITH : Zipped theme */ _type = TRANSLATE( VRParseFilePath( themefile, 'E')) SELECT WHEN _type == 'LST' THEN DO ok = InstallTheme( themefile ) END WHEN _type == 'ITH' | _type == 'ZIP' THEN DO ok = UnpackTheme( themefile ) END OTHERWISE DO CALL VRMessage VRWindow(),, NLVGetMessageText( 112, VRParseFilePath( themefile, 'NE')),, NLVGetMessageText( 95 ), 'E' RETURN 0 END END CALL LINEOUT Settings.logfile, '' CALL LINEOUT Settings.logfile RETURN ok /*:VRX ApplyTheme */ ApplyTheme: PROCEDURE EXPOSE SysDLLs. Settings. ARG themename /* * Call the progress dialog which does the actual work. */ CALL VRSet "Win_ITheme", "Pointer", "Wait" CALL VRLoadSecondary "Dlg_Progress", "W" CALL VRSet "Win_ITheme", "Pointer", "" /* * Check the result and let the user know. */ IF replerr == 3 THEN DO /* RESMGR bombed when trying to update a DLL */ CALL VRMessage "Win_ITheme", NLVGetMessageText( 102 ), NLVGetMessageText( 95 ), "E" END ELSE DO /* * Create a Startup object to refresh the desktop on reboot, and * notify the user. */ curr_loc = VRCurrDrive() || VRCurrDir() rv = SysCreateObject("WPShadow", "Reset icons", "",, "SHADOWID="curr_loc"\reicon.exe;OBJECTID=") IF replerr == 1 THEN DO /* Theme was only partially applied because some required DLLs were not found */ warning.0 = 3 warning.1 = NLVGetMessageText( 74 ) warning.2 = '' warning.3 = NLVGetMessageText( 72 ) CALL VRMessageStem VRWindow(), "warning.", NLVGetMessageText( 70 ), "W" DROP warning. END ELSE IF replerr == 2 THEN DO /* Theme was only partially applied because not all defined theme files exist */ warning.0 = 3 warning.1 = NLVGetMessageText( 75 ) warning.2 = '' warning.3 = NLVGetMessageText( 72 ) CALL VRMessageStem VRWindow(), "warning.", NLVGetMessageText( 70 ), "W" DROP warning. END /* Theme was applied successfully */ ELSE CALL VRLoadSecondary "Dlg_Applied", "WAIT" END CALL Quit RETURN /*:VRX CB_ChangeDLLs_Click */ CB_ChangeDLLs_Click: PROCEDURE checked = VRGet( "CB_ChangeDLLs", "Set" ) CALL VRSet "EF_PMWPloc", "Enabled", checked CALL VRSet "EF_PMMRGRESloc", "Enabled", checked CALL VRSet "EF_PMVIOPloc", "Enabled", checked CALL VRSet "EF_ECSWPloc", "Enabled", checked CALL VRSet "EF_MMPTMRIloc", "Enabled", checked CALL VRSet "EF_WPINETloc", "Enabled", checked CALL VRSet "EF_CWMMloc", "Enabled", checked CALL VRSet "EF_MEDIAFLDloc", "Enabled", checked CALL VRSet "EF_XWPRESloc", "Enabled", checked return /*:VRX CheckPNGDesk */ CheckPNGDesk: PROCEDURE EXPOSE Settings. has_pd = 0 CALL SysQueryClassList 'classes.' DO i = 1 TO classes.0 classname = WORD( classes.i, 1 ) SELECT WHEN classname == 'WPPngDisk' THEN has_pd = 1 WHEN classname == 'WPPngObject' THEN has_pd = 1 WHEN classname == 'WPPngFolder' THEN has_pd = 1 WHEN classname == 'WPPngSystem' THEN has_pd = 1 WHEN classname == 'WPPngProgram' THEN has_pd = 1 WHEN classname == 'WPPngDataFile' THEN has_pd = 1 WHEN classname == 'WPPngFileSystem' THEN has_pd = 1 WHEN classname == 'WPPngProgramFile' THEN has_pd = 1 OTHERWISE NOP END IF has_pd == 1 THEN LEAVE END IF has_pd == 1 THEN DO icon_setting = VRGetIni('PNG_DESKTOP', 'DefaultFolderAttributesIconView', 'USER') IF ( icon_setting == 'ERROR:') |, ( BITAND( C2X( REVERSE( icon_setting )), '00800000') == '00000000') THEN has_pd = 0 END RETURN has_pd /*:VRX CopyThemeFile */ CopyThemeFile: PROCEDURE EXPOSE Settings. ARG source, target IF source == target THEN RETURN 1 CALL CHAROUT Settings.logfile, ' - Copying' source '-->' target '(' ok = VRCopyFile( source, target ) CALL LINEOUT Settings.logfile, ok')' RETURN ok /*:VRX DefaultPaths */ DefaultPaths: PROCEDURE EXPOSE Defaults. ARG bootdrv mmpath Defaults.0 = 9 Defaults.pmwp = Sys2LocateDLL('PMWP.DLL') IF Defaults.pmwp == '' THEN Defaults.pmwp = bootdrv'\OS2\DLL\PMWP.DLL' Defaults.pmmrg = Sys2LocateDLL('PMMRGRES.DLL') IF Defaults.pmmrg == '' THEN Defaults.pmmrg = bootdrv'\OS2\DLL\PMMRGRES.DLL' Defaults.pmviop = Sys2LocateDLL('PMVIOP.DLL') IF Defaults.pmviop == '' THEN Defaults.pmviop = bootdrv'\OS2\DLL\PMVIOP.DLL' Defaults.ecswp = Sys2LocateDLL('AUXWP.DLL') IF Defaults.ecswp == '' THEN Defaults.ecswp = Sys2LocateDLL('ECSWP.DLL') IF Defaults.ecswp == '' THEN Defaults.ecswp = bootdrv'\ECS\DLL\ECSWP.DLL' IF Defaults.ecswp == '' THEN Defaults.ecswp = execDir'\AUXWP.BIN' Defaults.inet = Sys2LocateDLL('WPINET.DLL') IF Defaults.inet == '' THEN Defaults.inet = bootdrv'\OS2\DLL\WPINET.DLL' Defaults.mmpt = Sys2LocateDLL('MMPTMRI.DLL') IF Defaults.mmpt == '' THEN Defaults.mmpt = mmpath'\DLL\MMPTMRI.DLL' Defaults.cwmm = Sys2LocateDLL('CWMM.DLL') IF Defaults.cwmm == '' THEN Defaults.cwmm = mmpath'\MMCLASS\CWMM.DLL' Defaults.mfld = Sys2LocateDLL('MEDIAFLD.DLL') IF Defaults.mfld == '' THEN Defaults.mfld = mmpath'\MEDIAFLD\BIN\MEDIAFLD.DLL' PARSE UPPER VALUE VRGetIni('XWorkplace', 'XFolderPath', 'USER') WITH xwp_path '00'x . IF xwp_path == '' THEN xwp_path = bootdrv'\SYS\APPS\XWPS' Defaults.xwpres = xwp_path'\BIN\XWPRES.DLL' RETURN /*:VRX DeleteTheme */ DeleteTheme: PROCEDURE EXPOSE ThemeLibs. Settings. ARG theme_index theme_id = ThemeLibs.index /* To delete an installed theme: - Remove the theme from the listbox CALL VRMethod 'LB_Themes', 'Delete', theme_index - In each THEMES.* in Settings.path, remove the line starting with theme_id';' - Delete all files in Settings.path'\'theme_id - Remove the directory Settings.path'\'theme_id - Drop the theme from ThemeLibs. CALL SysStemDelete 'ThemeLibs.', theme_index, 1 */ RETURN /*:VRX Dlg_About_Close */ Dlg_About_Close: call Dlg_About_Fini return /*:VRX Dlg_About_Create */ Dlg_About_Create: call Dlg_About_Init return /*:VRX Dlg_About_Fini */ Dlg_About_Fini: window = VRInfo( "Window" ) call VRDestroy window drop window return /*:VRX Dlg_About_Init */ Dlg_About_Init: /* (2022-12-29) We're using the system default window-font now */ /* IF Settings.dbcs == 1 THEN CALL VRSet "Dlg_About", "Font", "9.WarpSans Combined" */ CALL NLVSetText "Dlg_About", "Caption", 80 CALL NLVSetText "DT_AboutName", "Caption", 81 CALL NLVSetText "DT_AboutVer", "Caption", 82, "2.23" CALL NLVSetText "DT_AboutBuild", "Caption", 83, "202212291" CALL NLVSetText "PB_AboutOK", "Caption", 84 IF Settings.!windowText <> '' THEN DO CALL VRSet 'Dlg_About', 'Font', Settings.!windowText CALL VRSet 'DT_AboutName', 'Font', Settings.!windowText || ' Bold' factor = GetScalingFactor( ParseFontSize( Settings.!windowText )) CALL RescaleObject 'Dlg_About', factor, 0 CALL RescaleObject 'Pict_1', factor CALL RescaleObject 'Pict_2', factor CALL VRSet 'Pict_2', 'Height', 30 CALL RescaleObject 'DT_AboutName', factor CALL RescaleObject 'DT_AboutVer', factor CALL RescaleObject 'DT_AboutBuild', factor CALL RescaleObject 'DT_AboutCopy', factor CALL RescaleObject 'PB_AboutOK', factor END window = VRInfo( "Object" ) if( \VRIsChildOf( window, "Notebook" ) ) then do call VRMethod window, "CenterWindow" call VRSet window, "Visible", 1 call VRMethod window, "Activate" end drop window RETURN /*:VRX Dlg_Applied_Close */ Dlg_Applied_Close: call Dlg_Applied_Fini return /*:VRX Dlg_Applied_Create */ Dlg_Applied_Create: call Dlg_Applied_Init return /*:VRX Dlg_Applied_Fini */ Dlg_Applied_Fini: window = VRInfo( "Window" ) call VRDestroy window drop window return /*:VRX Dlg_Applied_Init */ Dlg_Applied_Init: /* (2022-12-29) We're using the system default window-font now */ /* IF Settings.dbcs == 1 THEN CALL VRSet "Dlg_Applied", "Font", "9.WarpSans Combined" */ CALL NLVSetText "Dlg_Applied", "Caption", 70 CALL NLVSetText "DT_Applied1", "Caption", 71 CALL NLVSetText "DT_Applied2", "Caption", 72 CALL NLVSetText "PB_AppliedOK", "Caption", 73 IF Settings.!windowText <> '' THEN DO CALL VRSet 'Dlg_Applied', 'Font', Settings.!windowText factor = GetScalingFactor( ParseFontSize( Settings.!windowText )) CALL RescaleObject 'Dlg_Applied', factor, 0 CALL RescaleObject 'Pict_3', factor CALL RescaleObject 'DT_Applied1', factor CALL RescaleObject 'DT_Applied2', factor CALL RescaleObject 'PB_AppliedOK', factor END window = VRInfo( "Object" ) if( \VRIsChildOf( window, "Notebook" ) ) then do call VRMethod window, "CenterWindow" call VRSet window, "Visible", 1 call VRMethod window, "Activate" end drop window return /*:VRX Dlg_Prefs_Close */ Dlg_Prefs_Close: call Dlg_Prefs_Fini return /*:VRX Dlg_Prefs_Create */ Dlg_Prefs_Create: call Dlg_Prefs_Init return /*:VRX Dlg_Prefs_Fini */ Dlg_Prefs_Fini: window = VRInfo( "Window" ) call VRDestroy window drop window return /*:VRX Dlg_Prefs_Init */ Dlg_Prefs_Init: /* (2022-12-29) We're using the system default window-font now */ /* IF Settings.dbcs == 1 THEN CALL VRSet "Dlg_Prefs", "Font", "9.WarpSans Combined" */ CALL NLVSetText "Dlg_Prefs", "Caption", 60 CALL NLVSetText "DT_Layout", "Caption", 61 CALL NLVSetText "GB_LibPaths", "Caption", 62 CALL NLVSetText "DT_LibWarn", "Caption", 63 CALL NLVSetText "CB_ChangeDLLs", "Caption", 64 CALL NLVSetText "PB_PrefsOK", "Caption", 65 CALL NLVSetText "PB_PrefsCancel", "Caption", 66 CALL NLVSetText "PB_PrefsHelp", "Caption", 67 CALL NLVSetText "DT_CURRENT", "Caption", 68 CALL NLVSetText "PB_RESETNLV", "Caption", 69 CALL VRSet 'DT_LOCALE', 'Caption', Settings.nlv IF Settings.nlvset == 1 THEN CALL VRSet "PB_RESETNLV", "Visible", 1 layidx = VRMethod("CB_Layout", "FindString", Settings.layout,, "Prefix") IF layidx == 0 THEN layidx = 1 CALL VRSet "CB_Layout", "Selected", layidx IF Settings.nondefault THEN DO CALL VRSet "CB_ChangeDLLs", "Set", 1 CALL VRSet "EF_PMWPloc", "Enabled", 1 CALL VRSet "EF_PMMRGRESloc", "Enabled", 1 CALL VRSet "EF_PMVIOPloc", "Enabled", 1 CALL VRSet "EF_ECSWPloc", "Enabled", 1 CALL VRSet "EF_WPINETloc", "Enabled", 1 CALL VRSet "EF_MMPTMRIloc", "Enabled", 1 CALL VRSet "EF_CWMMloc", "Enabled", 1 CALL VRSet "EF_MEDIAFLDloc", "Enabled", 1 CALL VRSet "EF_XWPRESloc", "Enabled", 1 END CALL VRSet "EF_PMWPloc", "Value", SysDLLs.pmwp_dll CALL VRSet "EF_PMMRGRESloc", "Value", SysDLLs.pmmrg_dll CALL VRSet "EF_PMVIOPloc", "Value", SysDLLs.pmviop_dll CALL VRSet "EF_ECSWPloc", "Value", SysDLLs.ecswp_dll CALL VRSet "EF_WPINETloc", "Value", SysDLLs.inet_dll CALL VRSet "EF_MMPTMRIloc", "Value", SysDLLs.mmpt_dll CALL VRSet "EF_CWMMloc", "Value", SysDLLs.cwmm_dll CALL VRSet "EF_MEDIAFLDloc", "Value", SysDLLs.mfld_dll CALL VRSet "EF_XWPRESloc", "Value", SysDLLs.xwpres_dll IF Settings.!windowText <> '' THEN DO CALL VRSet 'Dlg_Prefs', 'Font', Settings.!windowText factor = GetScalingFactor( ParseFontSize( Settings.!windowText )) CALL RescaleObject 'Dlg_Prefs', factor, 0 CALL RescaleObject 'DT_CURRENT', factor CALL RescaleObject 'DT_LOCALE', factor CALL RescaleObject 'PB_RESETNLV', factor CALL RescaleObject 'GB_LINE', factor CALL VRSet 'GB_LINE', 'Height', 30 CALL RescaleObject 'DT_Layout', factor CALL RescaleObject 'CB_Layout', factor CALL RescaleObject 'GB_LibPaths', factor CALL RescaleObject 'DT_LibWarn', factor CALL RescaleObject 'CB_ChangeDLLs', factor CALL RescaleObject 'DT_PMWP', factor CALL RescaleObject 'DT_PMMRGRES', factor CALL RescaleObject 'DT_PMVIOP', factor CALL RescaleObject 'DT_ECSWP', factor CALL RescaleObject 'DT_WPINET', factor CALL RescaleObject 'DT_CWMM', factor CALL RescaleObject 'DT_MEDIAFLD', factor CALL RescaleObject 'DT_MMPTMRI', factor CALL RescaleObject 'DT_XWPRES', factor CALL RescaleObject 'EF_PMWPloc', factor CALL RescaleObject 'EF_PMMRGRESloc', factor CALL RescaleObject 'EF_PMVIOPloc', factor CALL RescaleObject 'EF_ECSWPloc', factor CALL RescaleObject 'EF_WPINETloc', factor CALL RescaleObject 'EF_CWMMloc', factor CALL RescaleObject 'EF_MEDIAFLDloc', factor CALL RescaleObject 'EF_MMPTMRIloc', factor CALL RescaleObject 'EF_XWPRESloc', factor CALL RescaleObject 'PB_PrefsOK', factor CALL RescaleObject 'PB_PrefsCancel', factor CALL RescaleObject 'PB_PrefsHelp', factor END window = VRInfo( "Object" ) if( \VRIsChildOf( window, "Notebook" ) ) then do call VRMethod window, "CenterWindow" call VRSet window, "Visible", 1 call VRMethod window, "Activate" end drop window return /*:VRX Dlg_Progress_Close */ Dlg_Progress_Close: call Dlg_Progress_Fini return /*:VRX Dlg_Progress_Create */ Dlg_Progress_Create: call Dlg_Progress_Init return /*:VRX Dlg_Progress_Fini */ Dlg_Progress_Fini: window = VRInfo( "Window" ) call VRDestroy window drop window return /*:VRX Dlg_Progress_Init */ Dlg_Progress_Init: /* (2022-12-29) We're using the system default window-font now */ /* IF Settings.dbcs == 1 THEN CALL VRSet "Dlg_Progress", "Font", "9.WarpSans Combined" */ CALL NLVSetText "Dlg_Progress", "Caption", 50, themename IF Settings.!windowText <> '' THEN DO CALL VRSet 'Dlg_Progress', 'Font', Settings.!windowText factor = GetScalingFactor( ParseFontSize( Settings.!windowText )) CALL RescaleObject 'Dlg_Progress', factor, 0 CALL RescaleObject 'Pro_Progress', factor CALL RescaleObject 'DT_APPLYING', factor END window = VRInfo( "Object" ) if( \VRIsChildOf( window, "Notebook" ) ) then do call VRMethod window, "CenterWindow" call VRSet window, "Visible", 1 call VRMethod window, "Activate" end drop window updpmwp = 0 updauxwp = 0 updpmrg = 0 updviop = 0 updinet = 0 updmmpt = 0 updcwmm = 0 updmfld = 0 updxwp = 0 /* Theme files (as of version 2.0): */ pmwp_thm = themename'\desktop1.itr' ecswp_thm = themename'\desktop2.itr' inet_thm = themename'\internet.itr' mmpt_thm = themename'\mmedia1.itr' cwmm_thm = themename'\mmedia2.itr' pmrg_thm = themename'\session1.itr' viop_thm = themename'\session2.itr' /* Newly-added theme files for version 2.1 */ mfld_thm = themename'\mmedia3.itr' xwp_thm = themename'\desktop3.itr' /* Fall back to 1.x filenames when the above are not found. */ IF VRFileExists( pmwp_thm ) == 0 THEN pmwp_thm = themename'\'themename'.pmr' IF VRFileExists( ecswp_thm ) == 0 THEN ecswp_thm = themename'\'themename'.ecr' IF VRFileExists( inet_thm ) == 0 THEN inet_thm = themename'\'themename'.inr' IF VRFileExists( mmpt_thm ) == 0 THEN mmpt_thm = themename'\'themename'.mmr' IF VRFileExists( cwmm_thm ) == 0 THEN cwmm_thm = themename'\'themename'.cmr' IF VRFileExists( pmrg_thm ) == 0 THEN pmrg_thm = themename'\'themename'.prr' IF VRFileExists( viop_thm ) == 0 THEN viop_thm = themename'\'themename'.pvr' /* * Initialize the logfile. */ CALL LINEOUT Settings.logfile, '['DATE() TIME()'] Applying theme' themename '...' /* * Update each of the system DLLs, as appropriate. */ CALL VRSet 'PRO_PROGRESS', 'Percent', 0 updpmwp = ReplDLL( SysDLLs.pmwp_dll, pmwp_thm ) CALL VRSet 'PRO_PROGRESS', 'Percent', 15 updpmrg = ReplDLL( SysDLLs.pmmrg_dll, pmrg_thm ) CALL VRSet 'PRO_PROGRESS', 'Percent', 25 updviop = ReplDLL( SysDLLs.pmviop_dll, viop_thm ) CALL VRSet 'PRO_PROGRESS', 'Percent', 35 updinet = ReplDLL( SysDLLs.inet_dll, inet_thm ) CALL VRSet 'PRO_PROGRESS', 'Percent', 45 updauxwp = ReplDLL( SysDLLs.ecswp_dll, ecswp_thm ) CALL VRSet 'PRO_PROGRESS', 'Percent', 60 IF SysDLLs.hasMMPM THEN updmmpt = ReplDLL( SysDLLs.mmpt_dll, mmpt_thm ) CALL VRSet 'PRO_PROGRESS', 'Percent', 72 IF SysDLLs.hasCWMM THEN DO updcwmm = ReplDLL( SysDLLs.cwmm_dll, cwmm_thm ) CALL VRSet 'PRO_PROGRESS', 'Percent', 84 updmfld = ReplDLL( SysDLLs.mfld_dll, mfld_thm ) CALL VRSet 'PRO_PROGRESS', 'Percent', 96 END IF SysDLLs.hasXWP THEN updxwp = ReplDLL( SysDLLs.xwpres_dll, xwp_thm ) CALL VRSet 'PRO_PROGRESS', 'Percent', 100 /* * Not all themes have these files, so ignore it if they were reported missing. */ IF updmfld == 3 THEN updmfld = 2 IF updxwp == 3 THEN updxwp = 2 error_string = updpmwp updauxwp updpmrg updviop updinet updmmpt updcwmm updmfld updxwp SELECT WHEN POS( 3, error_string ) > 0 THEN replerr = 3 WHEN POS( 2, error_string ) > 0 THEN replerr = 2 WHEN POS( 1, error_string ) > 0 THEN replerr = 1 OTHERWISE replerr = 0 END CALL LINEOUT Settings.logfile, '['DATE() TIME()'] Theme application completed with code' replerr'.' CALL LINEOUT Settings.logfile, '' CALL STREAM Settings.logfile, 'C', 'CLOSE' CALL Dlg_Progress_Fini RETURN /*:VRX DropLocale */ DropLocale: PROCEDURE EXPOSE Settings. ThemeLibs. PARSE ARG _locale '.' codepage . SELECT WHEN TRANSLATE( _locale ) == 'ZH_TW' THEN _lang = 'tw' WHEN TRANSLATE( _locale ) == 'ZH_CN' THEN _lang = 'cx' OTHERWISE PARSE VAR _locale _lang '_' . END CALL NLVUpdateLocale _lang CALL "VRSet" "LB_Themes", "Selected", 1 Settings.nlvset = 1 RETURN /*:VRX DT_Desc_DragDrop */ DT_Desc_DragDrop: CALL ProcessDragDrop RETURN /*:VRX Fini */ Fini: window = VRWindow() call VRSet window, "Visible", 0 drop window return 0 /*:VRX GB_Preview_DragDrop */ GB_Preview_DragDrop: CALL ProcessDragDrop RETURN /*:VRX GB_ThemeList_DragDrop */ GB_ThemeList_DragDrop: CALL ProcessDragDrop RETURN /*:VRX GetScalingFactor */ /* Return the UI scaling factor based on the difference between the specified * font size and the design-default font size. */ GetScalingFactor: PROCEDURE EXPOSE Settings. PARSE ARG newSize, orgSize IF orgSize == '' THEN orgSize = Settings.!defaultSize IF newSize < Settings.!defaultSize THEN newSize = Settings.!defaultSize scaleFactor = newSize / orgSize RETURN scaleFactor /*:VRX Halt */ Halt: signal _VREHalt return /*:VRX Init */ Init: CALL VRSet "Console", "WindowListTitle", "" CALL RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs' CALL SysLoadFuncs CALL RxFuncAdd 'Sys2LoadFuncs', 'RXUTILEX', 'Sys2LoadFuncs' CALL Sys2LoadFuncs CALL ReadSettings CALL ReadLanguage proceed = VersionCheck() IF proceed < 0 THEN CALL Quit IF CheckPNGDesk() == 1 THEN DO CALL VRMessage VRWindow(), NLVGetMessageText( 120 ) || '0d0a0d0a'x ||, NLVGetMessageText( 121 ), NLVGetMessageText( 94 ), 'W' END window = VRWindow() call VRMethod window, "CenterWindow" call VRSet window, "Visible", 1 call VRMethod window, "Activate" drop window CALL "VRSet" "LB_Themes", "Selected", 1 /* * Apply any theme specified on the command line. */ IF InitArgs.0 > 0 THEN DO themename = TRANSLATE( STRIP( InitArgs.1, 'B', '"')) known_theme = 0 DO i = 1 TO ThemeLibs.0 IF TRANSLATE( ThemeLibs.i ) == themename THEN DO known_theme = 1 LEAVE END END IF known_theme == 1 THEN CALL ApplyTheme themename ELSE IF VRFileExists( themename ) THEN DO _type = TRANSLATE( VRParseFilePath( themename, 'E')) SELECT WHEN _type == 'LST' THEN DO ok = InstallTheme( themename ) END WHEN _type == 'ITH' | _type == 'ZIP' THEN DO ok = UnpackTheme( themename ) END OTHERWISE DO CALL VRMessage "Win_ITheme",, NLVGetMessageText( 112, VRParseFilePath( themename, 'NE')),, NLVGetMessageText( 95 ), 'E' END END END ELSE CALL VRMessage "Win_ITheme", NLVGetMessageText( 101, themename ), NLVGetMessageText( 95 ), "E" END RETURN /*:VRX InstallTheme */ InstallTheme: PROCEDURE EXPOSE Settings. ThemeLibs. PARSE UPPER ARG index_file theme_src = VRParseFileName( index_file, 'DP') /* First we parse the theme definition out of the description file. */ CALL ParseThemeDef index_file thm_id = t_id thm_name = t_name thm_desc = t_desc IF thm_id == '' | thm_name == '' THEN DO CALL LINEOUT Settings.logfile, 'Failed to parse theme ID from' index_file'!' CALL VRMessage VRWindow(), NLVGetMessageText( 111 ), NLVGetMessageText( 95 ), 'E' RETURN 0 END CALL LINEOUT Settings.logfile, '['DATE() TIME()'] Installing new theme' thm_id 'from' theme_src '...' /* Now create the theme directory (if necessary) and copy the files. */ theme_dir = Settings.path'\'thm_id dir_exists = 0 IF VRFileExists( theme_dir ) THEN DO dir_exists = VRChDir( theme_dir ) IF dir_exists == 1 THEN CALL VRChDir Settings.path END IF dir_exists == 0 THEN DO CALL CHAROUT Settings.logfile, ' - Creating directory' theme_dir '(' ok = VRMkDir( theme_dir ) CALL LINEOUT Settings.logfile, ok')' END ELSE ok = 1 IF ok == 0 THEN DO CALL VRMessage VRWindow(), NLVGetMessageText( 113, theme_dir ), NLVGetMessageText( 95 ), 'E' CALL VRMessage VRWindow(), NLVGetMessageText( 103, thm_name ), NLVGetMessageText( 95 ), 'E' RETURN 0 END /* Theme files (as of version 2.0): */ pmwp_thm = theme_src'\desktop1.itr' ecswp_thm = theme_src'\desktop2.itr' inet_thm = theme_src'\internet.itr' mmpt_thm = theme_src'\mmedia1.itr' cwmm_thm = theme_src'\mmedia2.itr' pmrg_thm = theme_src'\session1.itr' viop_thm = theme_src'\session2.itr' /* Newly-added theme files for version 2.1 */ mfld_thm = theme_src'\mmedia3.itr' xwp_thm = theme_src'\desktop3.itr' /* Fall back to 1.x filenames when the above are not found. */ IF VRFileExists( pmwp_thm ) == 0 THEN pmwp_thm = theme_src'\'themename'.pmr' IF VRFileExists( ecswp_thm ) == 0 THEN ecswp_thm = theme_src'\'themename'.ecr' IF VRFileExists( inet_thm ) == 0 THEN inet_thm = theme_src'\'themename'.inr' IF VRFileExists( mmpt_thm ) == 0 THEN mmpt_thm = theme_src'\'themename'.mmr' IF VRFileExists( cwmm_thm ) == 0 THEN cwmm_thm = theme_src'\'themename'.cmr' IF VRFileExists( pmrg_thm ) == 0 THEN pmrg_thm = theme_src'\'themename'.prr' IF VRFileExists( viop_thm ) == 0 THEN viop_thm = theme_src'\'themename'.pvr' ok = CopyThemeFile( pmwp_thm, theme_dir'\desktop1.itr') IF ok == 1 THEN ok = CopyThemeFile( ecswp_thm, theme_dir'\desktop2.itr') IF ok == 1 THEN ok = CopyThemeFile( inet_thm, theme_dir'\internet.itr') IF ok == 1 THEN ok = CopyThemeFile( mmpt_thm, theme_dir'\mmedia1.itr') IF ok == 1 THEN ok = CopyThemeFile( cwmm_thm, theme_dir'\mmedia2.itr') IF ok == 1 THEN ok = CopyThemeFile( pmrg_thm, theme_dir'\session1.itr') IF ok == 1 THEN ok = CopyThemeFile( viop_thm, theme_dir'\session2.itr') IF ok == 1 & VRFileExists( mfld_thm ) THEN ok = CopyThemeFile( mfld_thm, theme_dir'\mmedia3.itr') IF ok == 1 & VRFileExists( xwp_thm ) THEN ok = CopyThemeFile( xwp_thm, theme_dir'\desktop3.itr') IF ok == 1 & VRFileExists( theme_src'\'thm_id'.DLL') THEN DO ADDRESS CMD 'mreplmod.exe' theme_dir'\'thm_id'.DLL 2>NUL 1>NUL' ok = CopyThemeFile( theme_src'\'thm_id'.DLL', theme_dir'\'thm_id'.DLL') END ELSE DO IF ok == 1 THEN ok = CopyThemeFile( theme_src'\002.ICO', theme_dir'\002.ICO') IF ok == 1 THEN ok = CopyThemeFile( theme_src'\003.ICO', theme_dir'\003.ICO') IF ok == 1 THEN ok = CopyThemeFile( theme_src'\013.ICO', theme_dir'\013.ICO') IF ok == 1 THEN ok = CopyThemeFile( theme_src'\024.ICO', theme_dir'\024.ICO') IF ok == 1 THEN ok = CopyThemeFile( theme_src'\026.ICO', theme_dir'\026.ICO') IF ok == 1 THEN ok = CopyThemeFile( theme_src'\033.ICO', theme_dir'\033.ICO') IF ok == 1 THEN ok = CopyThemeFile( theme_src'\048.ICO', theme_dir'\048.ICO') IF ok == 1 THEN ok = CopyThemeFile( theme_src'\092.ICO', theme_dir'\092.ICO') IF ok == 1 THEN ok = CopyThemeFile( theme_src'\061.ICO', theme_dir'\061.ICO') IF ok == 1 THEN ok = CopyThemeFile( theme_src'\119.ICO', theme_dir'\119.ICO') END IF ok == 0 THEN DO CALL VRMessage VRWindow(), NLVGetMessageText( 103, thm_name ), NLVGetMessageText( 95 ), 'E' RETURN 0 END /* If the theme already exists in our database, then we're done. */ DO i = 1 TO ThemeLibs.0 IF TRANSLATE( ThemeLibs.i ) == thm_id THEN DO msg.0 = 3 msg.1 = NLVGetMessageText( 55, thm_name ) msg.2 = '' msg.3 = NLVGetMessageText( 54 ) CALL VRMessageStem VRWindow(), 'msg.', NLVGetMessageText( 57 ), 'I' RETURN 1 END END /* Add the theme to every known language file, preferring the localized * theme name & description for each language (if they exist). If the theme * doesn't include a particular language, use the text from the default file * (i.e. whichever one this function was called with). */ gui_langs.0 = 0 CALL SysFileTree Settings.path'\THEMES.*', 'gui_langs.', 'FO' DO i = 1 TO gui_langs.0 gui_langs.i = TRANSLATE( gui_langs.i ) cur_lang = VRParseFileName( gui_langs.i, 'E') IF cur_lang == 'LST' THEN cur_lang = 'EN' IF VRFileExists( theme_src'\'cur_lang'.LST') THEN DO CALL ParseThemeDef theme_src'\'cur_lang'.LST' IF ( t_id <> thm_id ) | ( t_name == '' ) THEN t_name = thm_name IF t_desc == '' THEN t_desc = thm_desc END ELSE DO t_name = thm_name t_desc = thm_desc END /* Make sure this theme doesn't already exist in the index file */ id_len = LENGTH( t_id';') id_exists = 0 ok = SysFileSearch( t_id';', gui_langs.i, 'lines.') IF ok == 0 THEN DO j = 1 TO lines.0 IF TRANSLATE( LEFT( lines.j, id_len ) == t_id';') THEN DO id_exists = 1 LEAVE END END IF id_exists == 1 THEN ITERATE CALL LINEOUT gui_langs.i, t_id';'t_name';'t_desc CALL LINEOUT gui_langs.i END /* Add the new theme to our internal index, and to the GUI. */ _tx = ThemeLibs.0 + 1 ThemeLibs._tx = thm_id ThemeLibs.0 = _tx _lp = VRMethod("LB_Themes", "AddString", thm_name,, thm_desc ) CALL VRSet "LB_Themes", "Selected", _lp msg.0 = 3 msg.1 = NLVGetMessageText( 56, thm_name ) msg.2 = '' msg.3 = NLVGetMessageText( 54 ) CALL VRMessageStem VRWindow(), 'msg.', NLVGetMessageText( 57 ), 'I' RETURN 1 /*:VRX LB_Themes_Click */ LB_Themes_Click: PROCEDURE EXPOSE ThemeLibs. SysDLLs. index = VRGet("LB_Themes", "Selected") dllname = ThemeLibs.index desc = VRMethod("LB_Themes", "GetItemData", index ) IF index = 1 THEN DO CALL VRSet "PB_Apply", "Enabled", 0 CALL VRSet "MI_ThemeApply", "Enabled", 0 END ELSE DO CALL VRSet "PB_Apply", "Enabled", 1 CALL VRSet "MI_ThemeApply", "Enabled", 1 END CALL VRSet "DT_Desc", "Caption", desc CALL UpdatePreview dllname RETURN /*:VRX LB_Themes_DragDrop */ LB_Themes_DragDrop: CALL ProcessDragDrop RETURN /*:VRX LoadThemes */ /* * Populate the list of installed themes. */ LoadThemes: PROCEDURE EXPOSE Settings. ThemeLibs. /* We always have at least the 'current' theme. */ ThemeNames.0 = 1 ThemeNames.1 = NLVGetMessageText( 48 ) /* 48: "[current]" */ ThemeDescs.0 = 1 ThemeDescs.1 = NLVGetMessageText( 49 ) /* 49: "This is the currently active icon theme." */ ThemeLibs.1 = "PMWP" /* Locate the themes index file according to the current language. * We look in the working directory first, then try the executable * directory if that fails. */ listfile = 'themes.'Settings.nlv IF \ VRFileExists( listfile ) THEN listfile = 'themes.en' IF \ VRFileExists( listfile ) THEN listfile = 'themes.lst' IF \ VRFileExists( listfile ) THEN listfile = Settings.rundir'\themes.'Settings.nlv IF \ VRFileExists( listfile ) THEN listfile = Settings.rundir'\themes.en' IF \ VRFileExists( listfile ) THEN listfile = Settings.rundir'\themes.lst' /* Read the themes index file. */ CALL LINEIN listfile, 1, 0 index = 0 DO WHILE LINES( listfile ) > 0 tline = STRIP( LINEIN( listfile )) IF tline == '' THEN ITERATE index = index + 1 idlines.index = tline END idlines.0 = index CALL STREAM listfile, 'C', 'CLOSE' CALL SysStemSort 'idlines.',, 'I' index = 1 DO i = 1 TO idlines.0 PARSE VAR idlines.i libname ';' thmname ';' thmdesc IF libname \= '' THEN DO index = index + 1 IF thmname == '' THEN thmname = libname ThemeLibs.index = libname ThemeNames.index = thmname ThemeDescs.index = STRIP( thmdesc, 'B', ';') END END ThemeNames.0 = index ThemeLibs.0 = index /* * Now populate the listbox. */ CALL VRMethod "LB_Themes", "Clear" CALL VRMethod "LB_Themes", "AddStringList", "ThemeNames.",, "ThemeDescs." Settings.themelist = listfile Settings.path = VRParseFileName( listfile, 'DP') RETURN /*:VRX MI_Cancel_Click */ MI_Cancel_Click: call Quit return /*:VRX MI_HelpAbout_Click */ MI_HelpAbout_Click: call VRLoadSecondary "Dlg_About", "Wait" return /*:VRX MI_HelpUsing_Click */ MI_HelpUsing_Click: call VRMethod "MI_HelpUsing", "InvokeHelp" return /*:VRX MI_Prefs_Click */ MI_Prefs_Click: CALL VRLoadSecondary "Dlg_Prefs" return /*:VRX MI_ThemeAdd_Click */ MI_ThemeAdd_Click: CALL AddTheme RETURN /*:VRX MI_ThemeApply_Click */ MI_ThemeApply_Click: PROCEDURE EXPOSE ThemeLibs. SysDLLs. Settings. desc = VRGet("LB_Themes", "SelectedString") IF desc == '' THEN RETURN buttons.0 = 2 buttons.1 = NLVGetMessageText( 97 ) buttons.2 = NLVGetMessageText( 98 ) ok = VRMessage( VRWindow(), NLVGetMessageText( 96, desc ), NLVGetMessageText( 99 ), "Q", "buttons.", 1, 2 ) IF ok \= 1 THEN RETURN index = VRGet("LB_Themes", "Selected") IF index \= "" THEN DO dllname = ThemeLibs.index CALL ApplyTheme dllname END RETURN /*:VRX NLVGetMessageText */ /* * Gets the message text associated with the given message number from the * language file. Supports up to one substitution variable. */ NLVGetMessageText: PROCEDURE EXPOSE Settings. PARSE ARG msgnum, . args = ARG() msgfile = Settings.messages IF msgnum == '' THEN RETURN '' sub_parms = '' DO i = 2 TO args sub_parms = sub_parms', "'ARG( i )'"' END INTERPRET 'msgfromfile = SysGetMessage( msgnum, msgfile' sub_parms ')' PARSE VAR msgfromfile message '0D'x . IF SUBSTR( message, 1, 4 ) == 'SYS0' THEN message = '' RETURN message /*:VRX NLVSetText */ /* * Sets the specified property of the specified control to the specified message. */ NLVSetText: PROCEDURE EXPOSE Settings. PARSE ARG control, property, message, substitution args = ARG() success = 1 IF args < 4 THEN text = NLVGetMessageText( message ) ELSE DO sub_parms = '' DO i = 4 TO args sub_parms = sub_parms '"'|| ARG( i ) ||'",' END sub_parms = STRIP( sub_parms, 'T', ',') INTERPRET 'text = NLVGetMessageText( message, 'sub_parms')' END IF text == '' THEN success = 0 ELSE CALL VRSet control, property, text RETURN success /*:VRX NLVUpdateLocale */ NLVUpdateLocale: PROCEDURE EXPOSE Settings. ThemeLibs. PARSE UPPER ARG language Settings.nlv = language /* Set the message and help files. */ IF ( STREAM( Settings.rundir'\ithm_'language'.msg', 'C', 'QUERY EXISTS') <> '') |, ( SysSearchPath('DPATH', 'ithm_'language'.msg') \= '') THEN Settings.messages = 'ithm_'language'.msg' ELSE Settings.messages = 'ithm_en.msg' IF ( STREAM( Settings.rundir'\ithm_'language'.hlp', 'C', 'QUERY EXISTS') <> '') |, ( SysSearchPath('HELP', 'ithm_'language'.hlp') <> '') THEN CALL VRSet 'Win_ITheme', 'HelpFile', 'ithm_'language'.hlp' ELSE CALL VRSet 'Win_ITheme', 'HelpFile', 'ithm_en.hlp' /* Update the window control text. */ /* Menu bar */ CALL NLVSetText "MN_Theme", "Caption", 10 CALL NLVSetText "MI_ThemeAdd", "Caption", 11 CALL NLVSetText "MI_ThemeAdd", "HintText", 16 CALL NLVSetText "MI_ThemeRemove", "Caption", 12 CALL NLVSetText "MI_ThemeRemove", "HintText", 19 CALL NLVSetText "MI_ThemeApply", "Caption", 14 CALL NLVSetText "MI_ThemeApply", "HintText", 17 CALL NLVSetText "MI_Cancel", "Caption", 15 CALL NLVSetText "MI_Cancel", "HintText", 18 CALL NLVSetText "MN_Options", "Caption", 20 CALL NLVSetText "MI_Prefs", "Caption", 21 CALL NLVSetText "MI_Prefs", "HintText", 22 CALL NLVSetText "MN_Help", "Caption", 30 CALL NLVSetText "MI_HelpUsing", "Caption", 31 CALL NLVSetText "MI_HelpUsing", "HintText", 33 CALL NLVSetText "MI_HelpAbout", "Caption", 32 CALL NLVSetText "MI_HelpAbout", "HintText", 34 /* Main window */ CALL NLVSetText "Win_ITheme", "Caption", 40 CALL NLVSetText "GB_ThemeList", "Caption", 41 CALL NLVSetText "LB_Themes", "HintText", 45 CALL NLVSetText "GB_Preview", "HintText", 46 CALL NLVSetText "PB_Apply", "Caption", 42 CALL NLVSetText "PB_Apply", "HintText", 17 CALL NLVSetText "PB_Cancel", "Caption", 43 CALL NLVSetText "PB_Cancel", "HintText", 18 CALL NLVSetText "PB_Help", "Caption", 44 CALL NLVSetText "PB_Help", "HintText", 47 CALL SetIconTitles CALL LoadThemes RETURN /*:VRX ParseFontSize */ ParseFontSize: PROCEDURE EXPOSE Settings. PARSE ARG font IF font == '' | font == '' THEN RETURN Settings.!defaultSize PARSE VAR font _pts'.'. IF _pts < Settings.!defaultSize THEN _pts = Settings.!defaultSize RETURN _pts /*:VRX ParseThemeDef */ ParseThemeDef: PROCEDURE EXPOSE t_id t_name t_desc ARG index_file t_id = '' t_name = '' t_desc = '' CALL LINEIN index_file, 1, 0 DO WHILE LINES( index_file ) theme_def = STRIP( LINEIN( index_file )) IF theme_def == '' THEN ITERATE fc = LEFT( theme_def, 1 ) IF fc == '#' | fc == ';' THEN ITERATE PARSE VAR theme_def t_id ';' t_name ';' t_desc IF t_name <> '' THEN LEAVE END CALL STREAM index_file, 'C', 'CLOSE' t_id = TRANSLATE( t_id ) RETURN /*:VRX PB_AboutOK_Click */ PB_AboutOK_Click: call Dlg_About_Fini return /*:VRX PB_AppliedOK_Click */ PB_AppliedOK_Click: CALL Dlg_Applied_Fini return /*:VRX PB_Apply_Click */ PB_Apply_Click: PROCEDURE EXPOSE ThemeLibs. SysDLLs. Settings. desc = VRGet("LB_Themes", "SelectedString") IF desc == '' THEN RETURN buttons.0 = 2 buttons.1 = NLVGetMessageText( 97 ) buttons.2 = NLVGetMessageText( 98 ) ok = VRMessage( VRWindow(), NLVGetMessageText( 96, desc ), NLVGetMessageText( 99 ), "Q", "buttons.", 1, 2 ) IF ok \= 1 THEN RETURN index = VRGet("LB_Themes", "Selected") IF index \= "" THEN DO dllname = ThemeLibs.index CALL ApplyTheme dllname END RETURN /*:VRX PB_Apply_DragDrop */ PB_Apply_DragDrop: CALL ProcessDragDrop return /*:VRX PB_Cancel_Click */ PB_Cancel_Click: call Quit return /*:VRX PB_Cancel_DragDrop */ PB_Cancel_DragDrop: CALL ProcessDragDrop return /*:VRX PB_Help_Click */ PB_Help_Click: call VRMethod "Win_ITheme", "InvokeHelp" return /*:VRX PB_Help_DragDrop */ PB_Help_DragDrop: CALL ProcessDragDrop return /*:VRX PB_PrefsCancel_Click */ PB_PrefsCancel_Click: CALL Dlg_Prefs_Fini return /*:VRX PB_PrefsHelp_Click */ PB_PrefsHelp_Click: call VRMethod "Dlg_Prefs", "InvokeHelp" return /*:VRX PB_PrefsOK_Click */ PB_PrefsOK_Click: Settings.layout = TRANSLATE( LEFT( VRGet( "CB_Layout", "SelectedString"), 1 )) IF VRGet("CB_ChangeDLLs", "Set") THEN DO Settings.nondefault = 1 SysDLLs.pmwp_dll = VRGet( "EF_PMWPloc", "Value" ) SysDLLs.pmmrg_dll = VRGet( "EF_PMMRGRESloc", "Value" ) SysDLLs.pmviop_dll = VRGet( "EF_PMVIOPloc", "Value" ) SysDLLs.ecswp_dll = VRGet( "EF_ECSWPloc", "Value" ) SysDLLs.inet_dll = VRGet( "EF_WPINETloc", "Value" ) SysDLLs.mmpt_dll = VRGet( "EF_MMPTMRIloc", "Value" ) SysDLLs.cwmm_dll = VRGet( "EF_CWMMloc", "Value" ) SysDLLs.mfld_dll = VRGet( "EF_MEDIAFLDloc", "Value" ) SysDLLs.xwpres_dll = VRGet( "EF_XWPRESloc", "Value" ) END ELSE DO Defaults.0 = 0 CALL DefaultPaths Settings.nondefault = 0 SysDLLs.pmwp_dll = Defaults.pmwp SysDLLs.pmmrg_dll = Defaults.pmmrg SysDLLs.pmviop_dll = Defaults.pmviop SysDLLs.ecswp_dll = Defaults.ecswp SysDLLs.inet_dll = Defaults.inet SysDLLs.mmpt_dll = Defaults.mmpt SysDLLs.cwmm_dll = Defaults.cwmm SysDLLs.mfld_dll = Defaults.mfld SysDLLs.xwpres_dll = Defaults.xwpres END IF TRANSLATE( VRParseFilePath( SysDLLs.ecswp_dll, 'N')) == 'ECSWP' THEN SysDLLs.hasECS = VRFileExists( SysDLLs.ecswp_dll ) ELSE SysDLLs.hasECS = 0 SysDLLs.hasMMPM = VRFileExists( SysDLLs.mmpt_dll ) SysDLLs.hasCWMM = VRFileExists( SysDLLs.cwmm_dll ) SysDLLs.hasXWP = VRFileExists( SysDLLs.xwpres_dll ) CALL Dlg_Prefs_Fini CALL SetIconTitles RETURN /*:VRX PB_RESETNLV_Click */ PB_RESETNLV_Click: Settings.nlvset = 0 Settings.nlv = '' CALL ReadLanguage CALL VRSet 'DT_LOCALE', 'Caption', Settings.nlv CALL NLVSetText "Dlg_Prefs", "Caption", 60 CALL NLVSetText "DT_Layout", "Caption", 61 CALL NLVSetText "GB_LibPaths", "Caption", 62 CALL NLVSetText "DT_LibWarn", "Caption", 63 CALL NLVSetText "CB_ChangeDLLs", "Caption", 64 CALL NLVSetText "PB_PrefsOK", "Caption", 65 CALL NLVSetText "PB_PrefsCancel", "Caption", 66 CALL NLVSetText "PB_PrefsHelp", "Caption", 67 CALL NLVSetText "DT_CURRENT", "Caption", 68 CALL NLVSetText "PB_RESETNLV", "Caption", 69 CALL VRSet 'PB_RESETNLV', 'Enabled', 0 RETURN /*:VRX ProcessDragDrop */ ProcessDragDrop: PROCEDURE EXPOSE Settings. ThemeLibs. _contnr = STRIP( VRInfo('ContainerName'), 'T', '\') _name = STRIP( VRInfo('SourceName'), 'B', '\') _format = TRANSLATE( VRInfo('NativeFormat'), '>', ')') _file = _contnr'\'_name PARSE UPPER VAR _format '<' _fmt1 ',' _fmt2 '>' . _fmt1 = STRIP( _fmt1 ) _fmt2 = STRIP( _fmt2 ) IF _fmt1 <> 'DRM_OS2FILE' THEN RETURN /* A locale object (reported as DRF_BITMAP for some reason) was dropped. */ IF ( _contnr == '.') & ( _fmt2 == 'DRF_BITMAP') THEN DO CALL DropLocale _name END /* A file was dropped. */ ELSE IF VRFileExists( _file ) == 1 THEN NOP /* May want to install a theme if one is dropped... */ RETURN /*:VRX Quit */ Quit: CALL WriteSettings window = VRWindow() call VRSet window, "Shutdown", 1 drop window RETURN /*:VRX ReadLanguage */ ReadLanguage: PROCEDURE EXPOSE Settings. ThemeLibs. /* Figure out what language/message file to use. */ IF Settings.nlv == '' THEN DO syslanguage = VALUE('LANG',,'OS2ENVIRONMENT') SELECT WHEN TRANSLATE( syslanguage ) == 'ZH_TW' THEN lang = 'tw' WHEN TRANSLATE( syslanguage ) == 'ZH_CN' THEN lang = 'cx' OTHERWISE PARSE VAR syslanguage lang '_' . END END ELSE lang = Settings.nlv CALL NLVUpdateLocale lang RETURN /*:VRX ReadSettings */ ReadSettings: PROCEDURE EXPOSE SysDLLs. Settings. /* * Find the INI (settings) file. */ execPath = VRGet("Application", "Program") IF execPath == '' THEN /* PARSE SOURCE . . execPath */ execPath = DIRECTORY() execDir = VRParseFileName( execPath, "DP") iniFile = execDir || "\itheme.ini" /* * Determine the location of the various system DLLs. */ bootdrv = SysBootDrive() IF bootdrv = "" THEN bootdrv = FILESPEC('DRIVE', VALUE('OS2_SHELL',,'OS2ENVIRONMENT')) mmdir = VALUE('MMBASE',,'OS2ENVIRONMENT') mmpath = STRIP( mmdir, 'B', ';') Defaults.0 = 0 CALL DefaultPaths bootdrv mmpath Settings.nlv = VRGetIni("Settings", "Locale", iniFile, "NoClose") IF Settings.nlv <> "" THEN Settings.nlvset = 1 ELSE Settings.nlvset = 0 Settings.nondefault = VRGetIni("Settings", "CustomDLLs", iniFile, "NoClose") IF Settings.nondefault = "" THEN Settings.nondefault = 0 SysDLLs.pmwp_dll = VRGetIni("SysDLLs", "PMWP_DLL", iniFile, "NoClose") SysDLLs.pmmrg_dll = VRGetIni("SysDLLs", "PMMRGRES_DLL", iniFile, "NoClose") SysDLLs.pmviop_dll = VRGetIni("SysDLLs", "PMVIOP_DLL", iniFile, "NoClose") SysDLLs.ecswp_dll = VRGetIni("SysDLLs", "ECSWP_DLL", iniFile, "NoClose") SysDLLs.mmpt_dll = VRGetIni("SysDLLs", "MMPTMRI_DLL", iniFile, "NoClose") SysDLLs.inet_dll = VRGetIni("SysDLLs", "WPINET_DLL", iniFile, "NoClose") SysDLLs.cwmm_dll = VRGetIni("SysDLLs", "CWMM_DLL", iniFile, "NoClose") SysDLLs.mfld_dll = VRGetIni("SysDLLs", "MEDIAFLD_DLL", iniFile, "NoClose") SysDLLs.xwpres_dll = VRGetIni("SysDLLs", "XWPRES_DLL", iniFile, "NoClose") IF Settings.nondefault \= 1 THEN DO SysDLLs.pmwp_dll = Defaults.pmwp SysDLLs.pmmrg_dll = Defaults.pmmrg SysDLLs.pmviop_dll = Defaults.pmviop SysDLLs.ecswp_dll = Defaults.ecswp SysDLLs.inet_dll = Defaults.inet SysDLLs.mmpt_dll = Defaults.mmpt SysDLLs.cwmm_dll = Defaults.cwmm SysDLLs.mfld_dll = Defaults.mfld SysDLLs.xwpres_dll = Defaults.xwpres END ELSE DO IF SysDLLs.pmwp_dll = "" THEN SysDLLs.pmwp_dll = Defaults.pmwp IF SysDLLs.pmmrg_dll = "" THEN SysDLLs.pmmrg_dll = Defaults.pmmrg IF SysDLLs.pmviop_dll = "" THEN SysDLLs.pmviop_dll = Defaults.pmviop IF SysDLLs.ecswp_dll = "" THEN SysDLLs.ecswp_dll = Defaults.ecswp IF SysDLLs.inet_dll = "" THEN SysDLLs.inet_dll = Defaults.inet IF SysDLLs.mmpt_dll = "" THEN SysDLLs.mmpt_dll = Defaults.mmpt IF SysDLLs.cwmm_dll = "" THEN SysDLLs.cwmm_dll = Defaults.cwmm IF SysDLLs.mfld_dll = "" THEN SysDLLs.mfld_dll = Defaults.mfld IF SysDLLs.xwpres_dll = "" THEN SysDLLs.xwpres_dll = Defaults.xwpres END /* * ECSWP and/or Multimedia may not be installed, so make sure. */ IF TRANSLATE( VRParseFilePath( SysDLLs.ecswp_dll, 'N')) == 'ECSWP' THEN SysDLLs.hasECS = VRFileExists( SysDLLs.ecswp_dll ) ELSE SysDLLs.hasECS = 0 SysDLLs.hasMMPM = VRFileExists( SysDLLs.mmpt_dll ) SysDLLs.hasCWMM = VRFileExists( SysDLLs.cwmm_dll ) SysDLLs.hasXWP = VRFileExists( SysDLLs.xwpres_dll ) /* * Determine the desktop layout style. */ Settings.layout = TRANSLATE( VRGetIni("Settings", "Layout", iniFile )) IF POS( Settings.layout, 'AEO12') == 0 THEN DO osdir = VALUE('OSDIR',,'OS2ENVIRONMENT') IF osdir == '' THEN osdir = bootdrv'\ECS' SELECT WHEN VRFileExists( bootdrv'\OS2\INSTALL\SYSLEVEL.ECS') THEN Settings.layout = "E" WHEN VRFileExists( osdir'\INSTALL\SYSLEVEL.ECS') THEN Settings.layout = "E" OTHERWISE DO Settings.layout = "O" install_flg = STREAM( osdir'\INSTALL\INSTALL.FLG', 'C', 'QUERY EXISTS') IF install_flg <> '' THEN DO PARSE UPPER VALUE LINEIN( install_flg ) WITH _os _release . CALL STREAM install_flg, 'C', 'CLOSE' IF _os == 'ARCAOS' THEN Settings.layout = "A" END END END END ELSE IF Settings.layout == '1' THEN Settings.layout = 'E' ELSE IF Settings.layout == '2' THEN Settings.layout = 'O' /* * Figure out if we're running on a DBCS system. */ IF VRFileExists( bootdrv'\OS2DBCS') == 1 THEN DO Settings.dbcs = 1 /* (2022-12-29) We're using the system default window-font now */ /* CALL VRSet 'Win_ITheme', 'Font', '9.WarpSans Combined' */ END ELSE Settings.dbcs = 0 /* * Set the preview area colours from the current desktop scheme colours. * (This queries the active scheme -- it cannot take into account subsequent * changes made in the Desktop's 'Background' notebook page, which are * stored as object properties.) */ PARSE VALUE VRGetIni("PM_Colors", "Background", "User", "NoClose") WITH pbg '00'x . PARSE VALUE VRGetIni("PM_Colors", "DesktopIconText", "User") WITH pfg '00'x . CALL VRSet "GB_Preview", "BackColor", "(" || TRANSLATE( STRIP( pbg ), ',', ' ') || ")" CALL VRSet "GB_Preview", "ForeColor", "(" || TRANSLATE( STRIP( pfg ), ',', ' ') || ")" /* * Initialize the log file. */ Settings.rundir = execDir Settings.logfile = execDir"\itheme.log" CALL VRCreateFile Settings.logfile /* Update the window font and rescale as needed */ Settings.!defaultSize = 9 PARSE VALUE VRGetIni('PM_SystemFonts', 'WindowText') WITH Settings.!windowText '00'x . IF Settings.!windowText <> '' THEN DO CALL VRSet 'Win_ITheme', 'Font', Settings.!windowText factor = GetScalingFactor( ParseFontSize( Settings.!windowText )) CALL RescaleObject 'Win_ITheme', factor, 0 CALL RescaleObject 'GB_ThemeList', factor CALL RescaleObject 'LB_Themes', factor CALL RescaleObject 'GB_1', factor CALL RescaleObject 'DT_Desc', factor CALL RescaleObject 'Pict_4', factor CALL RescaleObject 'Pict_5', factor CALL RescaleObject 'GB_Preview', factor CALL RescaleObject 'Icon_System', factor CALL RescaleObject 'Icon_Programs', factor CALL RescaleObject 'Icon_Internet', factor CALL RescaleObject 'Icon_Network', factor CALL RescaleObject 'Icon_Templates', factor CALL RescaleObject 'Icon_HDD', factor CALL RescaleObject 'Icon_VIO', factor CALL RescaleObject 'Icon_Folder', factor CALL RescaleObject 'Icon_PM', factor CALL RescaleObject 'Icon_File', factor CALL RescaleObject 'DT_1', factor CALL RescaleObject 'DT_2', factor CALL RescaleObject 'DT_3', factor CALL RescaleObject 'DT_4', factor CALL RescaleObject 'DT_5', factor CALL RescaleObject 'DT_6', factor CALL RescaleObject 'DT_7', factor CALL RescaleObject 'DT_8', factor CALL RescaleObject 'DT_9', factor CALL RescaleObject 'DT_10', factor CALL RescaleObject 'PB_Apply', factor CALL RescaleObject 'PB_Cancel', factor CALL RescaleObject 'PB_Help', factor END RETURN /*:VRX ReplDLL */ /* * Update the icon resources in the given system DLL, using the given theme * resource file. */ ReplDLL: PROCEDURE EXPOSE Settings. ARG dllname, themefile /* * Abort if either file doesn't exist. */ IF STREAM( dllname, 'C', 'QUERY EXISTS') == '' THEN DO CALL LINEOUT Settings.logfile, ' ->' dllname 'not found!' RETURN 1 END IF STREAM( themefile, 'C', 'QUERY EXISTS') == '' THEN DO CALL LINEOUT Settings.logfile, ' ->' themefile 'not found!' RETURN 2 END CALL VRSet "DT_APPLYING", "Caption", NLVGetMessageText( 51, dllname ) /* * Unlock the DLL file being replaced. */ ok = Sys2ReplaceModule( dllname ) IF ok == 0 THEN DO PARSE VAR SYS2ERR oops':' . CALL LINEOUT Settings.logfile, ' -> Failed to unlock' dllname': error' oops END /* The above isn't necessarily an error so reset the return value */ oops = 0 /* * Make sure the S/H/R attributes are cleared. */ ok = SysFileTree( dllname, 'stem.', 'FO', '*****', '**---') /* * Now patch the DLL with the resource file (preserving its timestamp). */ PARSE VALUE SysGetFileDateTime( dllname ) WITH org_date org_time . ADDRESS CMD '@resmgr -a' dllname themefile '2>&1 >NUL' IF rc \= 0 THEN DO CALL LINEOUT Settings.logfile, ' -> Failed to update' dllname 'with' themefile': RESMGR returned' rc oops = 3 CALL VRMessage VRWindow(), NLVGetMessageText( 100, dllname ) || rc, NLVGetMessageText( 95 ), "E" END ELSE DO CALL LINEOUT Settings.logfile, ' -> Updated' dllname 'with' themefile CALL SysSetFileDateTime dllname, org_date, org_time END RETURN oops /*:VRX RescaleObject */ RescaleObject: PROCEDURE PARSE ARG object, factor, move x = VRGet( object, 'Left') y = VRGet( object, 'Top') w = VRGet( object, 'Width') h = VRGet( object, 'Height') nx = TRUNC( x * factor ) ny = TRUNC( y * factor ) nw = TRUNC( w * factor ) nh = TRUNC( h * factor ) IF move <> 0 THEN DO ok = VRSet( object, 'Left', nx ) ok = VRSet( object, 'Top', ny ) END ok = VRSet( object, 'Width', nw ) ok = VRSet( object, 'Height', nh ) RETURN /*:VRX SetIconTitles */ SetIconTitles: SELECT WHEN Settings.layout == 'A' THEN DO CALL NLVSetText "DT_1", "Caption", 0 CALL NLVSetText "DT_2", "Caption", 3 CALL NLVSetText "DT_3", "Caption", 2 CALL NLVSetText "DT_4", "Caption", 1 CALL NLVSetText "DT_5", "Caption", 4 END WHEN Settings.layout == 'E' THEN DO CALL NLVSetText "DT_1", "Caption", 133 CALL NLVSetText "DT_2", "Caption", 3 CALL NLVSetText "DT_3", "Caption", 135 CALL NLVSetText "DT_4", "Caption", 134 CALL NLVSetText "DT_5", "Caption", 4 END OTHERWISE DO CALL NLVSetText "DT_1", "Caption", 130 CALL NLVSetText "DT_2", "Caption", 3 CALL NLVSetText "DT_3", "Caption", 135 CALL NLVSetText "DT_4", "Caption", 1 CALL NLVSetText "DT_5", "Caption", 4 END END CALL NLVSetText "DT_6", "Caption", 5 CALL NLVSetText "DT_7", "Caption", 6 CALL NLVSetText "DT_8", "Caption", 7 CALL NLVSetText "DT_9", "Caption", 8 CALL NLVSetText "DT_10", "Caption", 9 RETURN /*:VRX UnpackTheme */ UnpackTheme: PROCEDURE EXPOSE Settings. ThemeLibs. ARG theme_pkg /* Make sure UNZIP is available. */ unzip = SysSearchPath('PATH', 'UNZIP.EXE') IF unzip == '' THEN DO CALL VRMessage VRWindow(), NLVGetMessageText( 104 ), NLVGetMessageText( 108 ), 'E' RETURN 0 END /* Make a temporary working directory for extracting the files. */ tmpdir = VALUE('TMP',,'OS2ENVIRONMENT') IF tmpdir == '' THEN tmpdir = VALUE('TEMP',,'OS2ENVIRONMENT') workdir = SysTempFileName( tmpdir'\ITH_????') rc = SysMkDir( workdir ) IF rc = 0 THEN ok = 1 /* Now try to unzip the file. */ IF ok == 1 THEN DO CALL CHAROUT Settings.logfile, '['DATE() TIME()'] Extracting files from' theme_pkg 'to' workdir '...' ADDRESS CMD '@' unzip '-jqqoC' theme_pkg '-d' workdir '2>NUL 1>NUL' IF rc == 0 THEN ok = 1 ELSE ok = 0 CALL LINEOUT Settings.logfile, ' ('rc')' END IF ok <> 1 THEN DO messagetext.1 = NLVGetMessageText( 109, theme_pkg ) messagetext.2 = '' messagetext.3 = NLVGetMessageText( 110, 'UNZIP.EXE') rc messagetext.0 = 3 buttons.0 = 1 buttons.1 = NLVGetMessageText( 65 ) CALL VRMessageStem VRWindow(), 'messagetext.', NLVGetMessageText( 95 ), 'E', 'buttons.', 1 END /* Locate the theme ID file. */ IF ok == 1 THEN DO matches.0 = 0 CALL SysFileTree workdir'\*.LST', 'matches.', 'FO' IF matches.0 == 0 THEN DO CALL VRMessage VRWindow(), NLVGetMessageText( 111 ), NLVGetMessageText( 95 ), 'E' ok = 0 END ELSE DO theme_sig = '' def_sig = matches.1 DO i = 1 TO matches.0 sig_lang = TRANSLATE( VRParseFilePath( matches.i, 'N')) IF sig_lang == Settings.nlv THEN theme_sig = matches.i IF sig_lang == 'EN' THEN def_sig = matches.i END IF theme_sig == '' THEN theme_sig = def_sig END END /* Install the theme files from the working directory. */ IF ok == 1 THEN ok = InstallTheme( theme_sig ) CALL LINEOUT Settings.logfile, '['DATE() TIME()'] Removing temporary files from' workdir IF VRDeleteFile( workdir'\*') == 1 THEN CALL SysRmDir workdir RETURN ok /*:VRX UpdatePreview */ UpdatePreview: PROCEDURE EXPOSE SysDLLs. ARG themelib CALL VRSet "GB_Preview", "Painting", 0 /* If this is the 'Current Theme', then preview the icons straight from the active DLLs */ IF themelib = "PMWP" THEN DO call VRSet "Icon_System", PicturePath, "$61:PMWP" call VRSet "Icon_Network", PicturePath, "$33:PMWP" IF SysDLLs.hasECS THEN call VRSet "Icon_Internet", PicturePath, "$119:ECSWP" ELSE call VRSet "Icon_Internet", PicturePath, "$119:AUXWP" call VRSet "Icon_Programs", PicturePath, "$92:PMWP" call VRSet "Icon_Templates", PicturePath, "$48:PMWP" call VRSet "Icon_HDD", PicturePath, "$13:PMWP" call VRSet "Icon_VIO", PicturePath, "$2:PMWP" call VRSet "Icon_Folder", PicturePath, "$26:PMWP" call VRSet "Icon_PM", PicturePath, "$3:PMWP" call VRSet "Icon_File", PicturePath, "$24:PMWP" END /* Otherwise, try to use a preview DLL in the theme subdirectory */ ELSE IF STREAM( themelib'\'themelib'.DLL', 'C', 'QUERY EXISTS') \= '' THEN DO call VRSet "Icon_System", PicturePath, "$61:"themelib'\'themelib call VRSet "Icon_Network", PicturePath, "$33:"themelib'\'themelib call VRSet "Icon_Internet", PicturePath, "$119:"themelib'\'themelib call VRSet "Icon_Programs", PicturePath, "$92:"themelib'\'themelib call VRSet "Icon_Templates", PicturePath, "$48:"themelib'\'themelib call VRSet "Icon_HDD", PicturePath, "$13:"themelib'\'themelib call VRSet "Icon_VIO", PicturePath, "$2:"themelib'\'themelib call VRSet "Icon_Folder", PicturePath, "$26:"themelib'\'themelib call VRSet "Icon_PM", PicturePath, "$3:"themelib'\'themelib call VRSet "Icon_File", PicturePath, "$24:"themelib'\'themelib END /* If there's no DLL, look for icon files instead, or use a default icon if all else fails. */ ELSE DO IF STREAM( themelib"\061.ICO", 'C', 'QUERY EXISTS') \= '' THEN call VRSet "Icon_System", PicturePath, themelib"\061.ICO" ELSE call VRSet "Icon_System", PicturePath, "Question" IF STREAM( themelib"\033.ICO", 'C', 'QUERY EXISTS') \= '' THEN call VRSet "Icon_Network", PicturePath, themelib"\033.ICO" ELSE call VRSet "Icon_Network", PicturePath, "Question" IF STREAM( themelib"\119.ICO", 'C', 'QUERY EXISTS') \= '' THEN call VRSet "Icon_Internet", PicturePath, themelib"\119.ICO" ELSE call VRSet "Icon_Internet", PicturePath, "Question" IF STREAM( themelib"\092.ICO", 'C', 'QUERY EXISTS') \= '' THEN call VRSet "Icon_Programs", PicturePath, themelib"\092.ICO" ELSE call VRSet "Icon_Programs", PicturePath, "Question" IF STREAM( themelib"\048.ICO", 'C', 'QUERY EXISTS') \= '' THEN call VRSet "Icon_Templates", PicturePath, themelib"\048.ICO" ELSE call VRSet "Icon_Templates", PicturePath, "Question" IF STREAM( themelib"\013.ICO", 'C', 'QUERY EXISTS') \= '' THEN call VRSet "Icon_HDD", PicturePath, themelib"\013.ICO" ELSE call VRSet "Icon_HDD", PicturePath, "Question" IF STREAM( themelib"\002.ICO", 'C', 'QUERY EXISTS') \= '' THEN call VRSet "Icon_VIO", PicturePath, themelib"\002.ICO" ELSE call VRSet "Icon_VIO", PicturePath, "Question" IF STREAM( themelib"\026.ICO", 'C', 'QUERY EXISTS') \= '' THEN call VRSet "Icon_Folder", PicturePath, themelib"\026.ICO" ELSE call VRSet "Icon_Folder", PicturePath, "Question" IF STREAM( themelib"\003.ICO", 'C', 'QUERY EXISTS') \= '' THEN call VRSet "Icon_PM", PicturePath, themelib"\003.ICO" ELSE call VRSet "Icon_PM", PicturePath, "Question" IF STREAM( themelib"\024.ICO", 'C', 'QUERY EXISTS') \= '' THEN call VRSet "Icon_File", PicturePath, themelib"\024.ICO" ELSE call VRSet "Icon_File", PicturePath, "Question" END CALL VRSet "GB_Preview", "Painting", 1 RETURN /*:VRX VersionCheck */ VersionCheck: PROCEDURE EXPOSE SysDLLs. Settings. resmgr = SysSearchPath('PATH', 'RESMGR.CMD') ibmrc = SysSearchPath('PATH', 'RC.EXE') SELECT WHEN resmgr == '' THEN DO /* RESMGR not found */ CALL VRMessage VRWindow(), NLVGetMessageText( 105 ), NLVGetMessageText( 108 ), 'ERROR' RETURN -1 END WHEN ibmrc == '' THEN DO /* RC.EXE not found */ CALL VRMessage VRWindow(), NLVGetMessageText( 106 ), NLVGetMessageText( 108 ), 'ERROR' RETURN -1 END OTHERWISE NOP /* -- Probably don't need this anymore. DO PARSE UPPER VAR ibmrc . ':' rc_path '\RC.EXE' . IF ( rc_path \= '\OS2') & ( rc_path \= '\ECS\BIN') THEN DO * RC.EXE not in a "normal" location, so check the version number * rcq = RXQUEUE('CREATE') oq = RXQUEUE('SET', rcq ) '@' ibmrc '2>&1 | rxqueue' rcq rc_ver = 3 DO QUEUED() PARSE UPPER PULL rcline IF POS('VERSION', rcline ) \= 0 THEN DO PARSE VAR rcline . 'VERSION' mver'.' . rc_ver = mver LEAVE END END CALL RXQUEUE 'SET', oq CALL RXQUEUE 'DELETE', rcq IF rc_ver \= 4 THEN DO * Found a non-4.0 version of RC; display a warning. * buttons.0 = 2 buttons.1 = NLVGetMessageText( 97 ) * "Yes" * buttons.2 = NLVGetMessageText( 98 ) * "No" * ok = VRMessage( VRWindow(), NLVGetMessageText( 107, ibmrc ), NLVGetMessageText( 94 ), 'WARNING', 'buttons.', 1, 2 ) IF ok \= 1 THEN RETURN -1 END END END */ END /* Should I check the specific version of RESMGR as well? */ RETURN 0 /*:VRX Win_ITheme_Close */ Win_ITheme_Close: call Quit return /*:VRX Win_ITheme_DragDrop */ Win_ITheme_DragDrop: CALL ProcessDragDrop RETURN /*:VRX WriteSettings */ WriteSettings: iniFile = Settings.rundir || "\itheme.ini" IF Settings.nlvset == 1 THEN CALL VRSetIni "Settings", "Locale", Settings.nlv, iniFile, "NoClose" ELSE CALL VRSetIni "Settings", "Locale", "", iniFile, "NoClose" CALL VRSetIni "Settings", "Layout", Settings.layout, iniFile, "NoClose" CALL VRSetIni "Settings", "CustomDLLs", Settings.nondefault, iniFile, "NoClose" CALL VRSetIni "SysDLLs", "PMWP_DLL", SysDLLs.pmwp_dll, iniFile, "NoClose" CALL VRSetIni "SysDLLs", "PMMRGRES_DLL", SysDLLs.pmmrg_dll, iniFile, "NoClose" CALL VRSetIni "SysDLLs", "PMVIOP_DLL", SysDLLs.pmviop_dll, iniFile, "NoClose" CALL VRSetIni "SysDLLs", "ECSWP_DLL", SysDLLs.ecswp_dll, iniFile, "NoClose" CALL VRSetIni "SysDLLs", "MMPTMRI_DLL", SysDLLs.mmpt_dll, iniFile, "NoClose" CALL VRSetIni "SysDLLs", "CWMM_DLL", SysDLLs.cwmm_dll, iniFile, "NoClose" CALL VRSetIni "SysDLLs", "WPINET_DLL", SysDLLs.inet_dll, iniFile RETURN