Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/inis.c
r1185 r1209 43 43 44 44 #include "fm3dll.h" 45 #include "mainwnd2.h" // Data declaration(s) 46 #include "collect.h" // Data declaration(s) 47 #include "grep.h" // Data declaration(s) 48 #include "notebook.h" // Data declaration(s) 49 #include "init.h" // Data declaration(s) 45 50 #include "fm3dlg.h" 46 51 #include "fm3str.h" … … 67 72 #include "wrappers.h" // xfopen 68 73 #include "fortify.h" 74 75 // Data definitions 76 #pragma data_seg(GLOBAL1) 77 HELPINIT hini; 78 79 #pragma data_seg(GLOBAL2) 80 CHAR *DRF_FM2INI; 81 CHAR *DRM_FM2INIRECORD; 82 RGB2 RGBBLACK; 69 83 70 84 #pragma data_seg(DATA2) -
trunk/dll/inis.h
r1197 r1209 19 19 HWND StartIniEditor(HWND hwnd, CHAR * filename, INT flags); 20 20 21 // Data declarations 22 extern CHAR *DRF_FM2INI; 23 extern CHAR *DRM_FM2INIRECORD; 24 extern RGB2 RGBBLACK; 25 extern HELPINIT hini; 21 26 22 27 #endif // INIS_H -
trunk/dll/init.c
r1177 r1209 78 78 79 79 #include "fm3dll.h" 80 #include "mkdir.h" // Data declaration(s) 81 #include "dircnrs.h" // Data declaration(s) 82 #include "comp.h" // Data declaration(s) 83 #include "cmdline.h" // Data declaration(s) 84 #include "fm2cmd.h" // Data declaration(s) 85 #include "printer.h" // Data declaration(s) 86 #include "init.h" // Data declaration(s) 87 #include "flesh.h" // Data declaration(s) 88 #include "worker.h" // Data declaration(s) 89 #include "filldir.h" // Data declaration(s) 90 #include "defview.h" // Data declaration(s) 91 #include "draglist.h" // Data declaration(s) 80 92 #include "fm3dlg.h" 81 93 #include "datamin.h" … … 101 113 #include "notify.h" // NotifyWndProc 102 114 #include "treecnr.h" // OpenButtonProc 103 #include "seeall.h" // SeeAllWndProc, SeeStatusProc 104 #include "init.h" 105 #include "timer.h" // StartTimer, StopTimer 106 #include "treecnr.h" // TreeClientWndProc, TreeStatProc 107 #include "newview.h" // ViewStatusProc, ViewWndProc 108 #include "subj.h" // Subject 109 #include "select.h" // UnHilite 110 #include "dirs.h" // save_dir 111 #include "copyf.h" // unlinkf 112 #include "wrappers.h" // xDosSetPathInfo 115 #include "seeall.h" // SeeAllWndProc, SeeStatusProc 116 #include "timer.h" // StartTimer, StopTimer 117 #include "treecnr.h" // TreeClientWndProc, TreeStatProc 118 #include "newview.h" // ViewStatusProc, ViewWndProc 119 #include "subj.h" // Subject 120 #include "select.h" // UnHilite 121 #include "dirs.h" // save_dir 122 #include "copyf.h" // unlinkf 123 #include "wrappers.h" // xDosSetPathInfo 113 124 #include "misc.h" // HeapThread, LoadDetailsSwitches 114 125 #include "notebook.h" // command line variables (editor etc) 115 #include "strips.h" // bstrip116 #include "killproc.h" // GetDosPgmName117 #include "srchpath.h" // searchpath126 #include "strips.h" // bstrip 127 #include "killproc.h" // GetDosPgmName 128 #include "srchpath.h" // searchpath 118 129 #include "fortify.h" 119 130 … … 135 146 #endif 136 147 148 // Data definitions 137 149 static PSZ pszSrcFile = __FILE__; 138 150 static CHAR *WC_MAINWND; 151 152 #pragma data_seg(GLOBAL1) 153 ULONG OS2ver[2]; 154 PFNWP PFNWPCnr; 155 PFNWP PFNWPMLE; 156 CHAR ThousandsSeparator[2]; 157 BOOL fAmAV2; 158 BOOL fChangeTarget; 159 BOOL fIniExisted; 160 BOOL fLogFile; 161 BOOL fReminimize; 162 BOOL fWantFirstTimeInit; 163 HPOINTER hptrApp; 164 HPOINTER hptrArc; 165 HPOINTER hptrArrow; 166 HPOINTER hptrArt; 167 HPOINTER hptrBusy; 168 HPOINTER hptrCDROM; 169 HPOINTER hptrDrive; 170 HPOINTER hptrEW; 171 HPOINTER hptrFloppy; 172 HPOINTER hptrNS; 173 HPOINTER hptrRamdisk; 174 HPOINTER hptrRemote; 175 HPOINTER hptrRemovable; 176 HPOINTER hptrVirtual; 177 HPOINTER hptrZipstrm; 178 CHAR *pFM2SaveDirectory; 179 CHAR *pTmpDir; 180 181 #pragma data_seg(GLOBAL2) 182 CHAR *CBSIFS; 183 CHAR *DRF_FM2ARCHIVE; 184 CHAR *DRMDRFFM2ARC; 185 CHAR *DRMDRFOS2FILE; 186 CHAR *DRM_FM2ARCMEMBER; 187 CHAR *DRM_OS2FILE; 188 CHAR *FM2Str; 189 HMODULE FM3DllHandle; 190 CHAR *FM3Folder; 191 CHAR HomePath[CCHMAXPATH]; 192 CHAR *LONGNAME; 193 CHAR *NullStr; 194 CHAR *Settings; 195 CHAR SwapperDat[CCHMAXPATH]; 196 CHAR *WC_ARCCONTAINER; 197 CHAR *WC_ARCSTATUS; 198 CHAR *WC_AUTOVIEW; 199 CHAR *WC_BUBBLE; 200 CHAR *WC_COLLECTOR; 201 CHAR *WC_COLSTATUS; 202 CHAR *WC_DATABAR; 203 CHAR *WC_DIRCONTAINER; 204 CHAR *WC_DIRSTATUS; 205 CHAR *WC_DRIVEBACK; 206 CHAR *WC_DRIVEBUTTONS; 207 CHAR *WC_ERRORWND; 208 CHAR *WC_INIEDITOR; 209 CHAR *WC_LED; 210 CHAR *WC_MAINWND2; 211 CHAR *WC_MINITIME; 212 CHAR *WC_MLEEDITOR; 213 CHAR *WC_NEWVIEW; 214 CHAR *WC_OBJECTWINDOW; 215 CHAR *WC_SEEALL; 216 CHAR *WC_SEESTATUS; 217 CHAR *WC_STATUS; 218 CHAR *WC_TOOLBACK; 219 CHAR *WC_TOOLBUTTONS; 220 CHAR *WC_TREECONTAINER; 221 CHAR *WC_TREEOPENBUTTON; 222 CHAR *WC_TREESTATUS; 223 CHAR *WC_VIEWSTATUS; 139 224 VOID FindSwapperDat(VOID); 225 CHAR profile[CCHMAXPATH]; 226 ULONGLONG ullTmpSpaceNeeded; 140 227 141 228 BOOL CheckFileHeader(CHAR *filespec, CHAR *signature, LONG offset); -
trunk/dll/init.h
r1197 r1209 19 19 HWND StartFM3(HAB hab, INT argc, CHAR ** argv); 20 20 21 // Data declarations 22 extern CHAR *CBSIFS; 23 extern CHAR *DRMDRFFM2ARC; 24 extern CHAR *DRF_FM2ARCHIVE; 25 extern CHAR *DRMDRFOS2FILE; 26 extern CHAR *DRM_FM2ARCMEMBER; 27 extern CHAR *DRM_OS2FILE; 28 extern CHAR *FM2Str; 29 extern CHAR *FM3Folder; 30 extern CHAR HomePath[CCHMAXPATH]; 31 extern CHAR *LONGNAME; 32 extern CHAR *NullStr; 33 extern ULONG OS2ver[2]; 34 extern PFNWP PFNWPCnr; 35 extern PFNWP PFNWPMLE; 36 extern CHAR *Settings; 37 extern CHAR SwapperDat[CCHMAXPATH]; 38 extern CHAR ThousandsSeparator[2]; 39 extern CHAR *WC_ARCCONTAINER; 40 extern CHAR *WC_ARCSTATUS; 41 extern CHAR *WC_AUTOVIEW; 42 extern CHAR *WC_BUBBLE; 43 extern CHAR *WC_COLLECTOR; 44 extern CHAR *WC_COLSTATUS; 45 extern CHAR *WC_DATABAR; 46 extern CHAR *WC_DIRCONTAINER; 47 extern CHAR *WC_DIRSTATUS; 48 extern CHAR *WC_DRIVEBACK; 49 extern CHAR *WC_DRIVEBUTTONS; 50 extern CHAR *WC_ERRORWND; 51 extern CHAR *WC_INIEDITOR; 52 extern CHAR *WC_LED; 53 extern CHAR *WC_MAINWND2; 54 extern CHAR *WC_MINITIME; 55 extern CHAR *WC_MLEEDITOR; 56 extern CHAR *WC_NEWVIEW; 57 extern CHAR *WC_OBJECTWINDOW; 58 extern CHAR *WC_SEEALL; 59 extern CHAR *WC_SEESTATUS; 60 extern CHAR *WC_STATUS; 61 extern CHAR *WC_TOOLBACK; 62 extern CHAR *WC_TOOLBUTTONS; 63 extern CHAR *WC_TREECONTAINER; 64 extern CHAR *WC_TREEOPENBUTTON; 65 extern CHAR *WC_TREESTATUS; 66 extern CHAR *WC_VIEWSTATUS; 67 extern BOOL fAmAV2; 68 extern BOOL fChangeTarget; 69 extern BOOL fIniExisted; 70 extern BOOL fLogFile; 71 extern BOOL fReminimize; 72 extern BOOL fWantFirstTimeInit; 73 extern HPOINTER hptrApp; 74 extern HPOINTER hptrArc; 75 extern HPOINTER hptrArrow; 76 extern HPOINTER hptrArt; 77 extern HPOINTER hptrBusy; 78 extern HPOINTER hptrCDROM; 79 extern HPOINTER hptrDrive; 80 extern HPOINTER hptrEW; 81 extern HPOINTER hptrFloppy; 82 extern HPOINTER hptrNS; 83 extern HPOINTER hptrRamdisk; 84 extern HPOINTER hptrRemote; 85 extern HPOINTER hptrRemovable; 86 extern HPOINTER hptrVirtual; 87 extern HPOINTER hptrZipstrm; 88 extern CHAR *pFM2SaveDirectory; 89 extern CHAR *pTmpDir; 90 extern CHAR profile[CCHMAXPATH]; 91 extern ULONGLONG ullTmpSpaceNeeded; 21 92 22 93 #endif // INIT_H -
trunk/dll/key.c
r1179 r1209 24 24 25 25 #include "fm3dll.h" 26 #include "mainwnd2.h" // Data declaration(s) 27 #include "mainwnd.h" // Data declaration(s) 26 28 #include "fm3dlg.h" 27 29 #include "fm3str.h" … … 31 33 #include "key.h" // AboutDlgProc 32 34 #include "misc.h" // PostMsg 35 36 // Data declarations 37 #pragma data_seg(GLOBAL1) 38 static HWND AboutBox; 33 39 34 40 #pragma data_seg(DATA1) -
trunk/dll/killproc.c
r1188 r1209 34 34 35 35 #include "fm3dll.h" 36 #include "init.h" // Data declaration(s) 37 #include "notebook.h" // Data declaration(s) 38 #include "mainwnd.h" // Data declaration(s) 36 39 #include "fm3dlg.h" 37 40 #include "fm3str.h" … … 50 53 #include "fortify.h" 51 54 55 // Data definitions 52 56 #pragma data_seg(DATA2) 53 57 54 58 static PSZ pszSrcFile = __FILE__; 59 60 #pragma data_seg(GLOBAL1) 61 BOOL fUseQProcStat; 62 BOOL fUseQSysState; 63 PID mypid; 55 64 56 65 CHAR *GetDosPgmName(PID pid, CHAR * string) -
trunk/dll/killproc.h
r1198 r1209 19 19 MRESULT EXPENTRY KillDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2); 20 20 21 // Data declarations 22 extern BOOL fUseQSysState; 23 extern BOOL fUseQProcStat; 24 extern PID mypid; 21 25 22 26 #endif // KILLPROC_H -
trunk/dll/loadbmp.c
r1181 r1209 30 30 31 31 #include "fm3dll.h" 32 #include "init.h" // Data declaration(s) 32 33 #include "errutil.h" // Dos_Error... 33 34 #include "loadbmp.h" -
trunk/dll/mainwnd.c
r1181 r1209 59 59 07 Jul 08 JBS Ticket 242: Delete obsolete INI keys when re-saving a state 60 60 11 Jul 08 JBS Ticket 230: Simplified code and eliminated some local variables by incorporating 61 all the details view settings (both the global variables and those in the62 DIRCNRDATA struct) into a new struct: DETAILS_SETTINGS.61 all the details view settings (both the global variables and those in the 62 DIRCNRDATA struct) into a new struct: DETAILS_SETTINGS. 63 63 12 Jul 08 JBS Ticket 246: Allow saved directory container states to have no directory containers 64 (i.e. just a directory tree container).64 (i.e. just a directory tree container). 65 65 18 Jul 08 SHL Use new Fortify feature to avoid spurious reports 66 66 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory … … 75 75 #include <string.h> 76 76 #include <ctype.h> 77 #include <process.h> // _beginthread77 #include <process.h> // _beginthread 78 78 79 79 #define INCL_DOS 80 80 #define INCL_WIN 81 #define INCL_SHLERRORS // PMERR_NOT_IN_IDX81 #define INCL_SHLERRORS // PMERR_NOT_IN_IDX 82 82 #define INCL_WINHELP 83 83 #define INCL_GPI … … 85 85 86 86 #include "fm3dll.h" 87 #include "grep.h" // Data declaration(s) 88 #include "autoview.h" // Data declaration(s) 89 #include "dircnrs.h" // Data declaration(s) 90 #include "info.h" // Data declaration(s) 91 #include "defview.h" // Data declaration(s) 92 #include "init.h" // Data declaration(s) 87 93 #include "fm3dlg.h" 88 94 #include "fm3str.h" … … 90 96 #include "comp.h" 91 97 #include "datamin.h" 92 #include "pathutil.h" // BldQuotedFileName93 #include "errutil.h" // Dos_Error...94 #include "strutil.h" // GetPString95 #include "notebook.h" // CfgDlgProc CfgMenuInit96 #include "command.h" // LINKCMDS97 #include "avl.h" // free_archivers98 #include "walkem.h" // free_setups...99 #include "key.h" // AboutDlgProc100 #include "menu.h" // AddToMenu98 #include "pathutil.h" // BldQuotedFileName 99 #include "errutil.h" // Dos_Error... 100 #include "strutil.h" // GetPString 101 #include "notebook.h" // CfgDlgProc CfgMenuInit 102 #include "command.h" // LINKCMDS 103 #include "avl.h" // free_archivers 104 #include "walkem.h" // free_setups... 105 #include "key.h" // AboutDlgProc 106 #include "menu.h" // AddToMenu 101 107 #include "mainwnd.h" 102 #include "cmdline.h" // CmdLine2DlgProc, save_cmdlines103 #include "common.h" // CommonCreateMainChildren, CommonDriveCmd, CommonMainWndProc104 // CommonTextButton105 #include "notify.h" // DoNotify, HideNote, ShowNote106 #include "draglist.h" // DragOne107 #include "chklist.h" // DropListProc108 #include "avv.h" // EditArchiverDefinition109 #include "assoc.h" // EditAssociations110 #include "fm2cmd.h" // FM2Command111 #include "misc.h" // FindDirCnr, FixSwitchList, PaintSTextWindow,112 // SetConditionalCascade, SetMenuCheck, SetSysMenu113 // SwitchCommand, CheckMenu, DrawTargetEmphasis114 // IsFm2Window115 #include "instant.h" // InstantDlgProc116 #include "killproc.h" // KillDlgProc117 #include "loadbmp.h" // LoadBitmapFromFileNum118 #include "presparm.h" // SavePresParams119 #include "treecnr.h" // ShowTreeRec, StartTreeCnr120 #include "inis.h" // StartIniEditor121 #include "sysinfo.h" // SysInfoDlgProc122 #include "viewinf.h" // ViewInfProc123 #include "walkem.h" // WalkDlgProc, WalkTwoCmpDlgProc, add_setup, add_udir124 // fill_setups_list, free_ldir, free_udirs, load_udirs125 // remove_setup, remove_udir, save_setups, save_udirs126 #include "winlist.h" // WindowList127 #include "cmdline.h" // add_cmdline128 #include "assoc.h" // free_associations129 #include "droplist.h" // AcceptOneDrop, CheckPmDrgLimit, DropHelp, GetOneDrop130 #include "common.h" // CommonTextProc131 #include "presparm.h" // CopyPresParams132 #include "systemf.h" // ExecOnList133 #include "shadow.h" // OpenObject134 #include "mkdir.h" // PMMkDir135 #include "collect.h" // StartCollector136 #include "select.h" // UnHilite137 #include "strips.h" // bstrip138 #include "commafmt.h" // CommaFmtULL139 #include "valid.h" // IsFullName140 #include "dirs.h" // save_dir2141 #include "wrappers.h" // xfree108 #include "cmdline.h" // CmdLine2DlgProc, save_cmdlines 109 #include "common.h" // CommonCreateMainChildren, CommonDriveCmd, CommonMainWndProc 110 // CommonTextButton 111 #include "notify.h" // DoNotify, HideNote, ShowNote 112 #include "draglist.h" // DragOne 113 #include "chklist.h" // DropListProc 114 #include "avv.h" // EditArchiverDefinition 115 #include "assoc.h" // EditAssociations 116 #include "fm2cmd.h" // FM2Command 117 #include "misc.h" // FindDirCnr, FixSwitchList, PaintSTextWindow, 118 // SetConditionalCascade, SetMenuCheck, SetSysMenu 119 // SwitchCommand, CheckMenu, DrawTargetEmphasis 120 // IsFm2Window 121 #include "instant.h" // InstantDlgProc 122 #include "killproc.h" // KillDlgProc 123 #include "loadbmp.h" // LoadBitmapFromFileNum 124 #include "presparm.h" // SavePresParams 125 #include "treecnr.h" // ShowTreeRec, StartTreeCnr 126 #include "inis.h" // StartIniEditor 127 #include "sysinfo.h" // SysInfoDlgProc 128 #include "viewinf.h" // ViewInfProc 129 #include "walkem.h" // WalkDlgProc, WalkTwoCmpDlgProc, add_setup, add_udir 130 // fill_setups_list, free_ldir, free_udirs, load_udirs 131 // remove_setup, remove_udir, save_setups, save_udirs 132 #include "winlist.h" // WindowList 133 #include "cmdline.h" // add_cmdline 134 #include "assoc.h" // free_associations 135 #include "droplist.h" // AcceptOneDrop, CheckPmDrgLimit, DropHelp, GetOneDrop 136 #include "common.h" // CommonTextProc 137 #include "presparm.h" // CopyPresParams 138 #include "systemf.h" // ExecOnList 139 #include "shadow.h" // OpenObject 140 #include "mkdir.h" // PMMkDir 141 #include "collect.h" // StartCollector 142 #include "select.h" // UnHilite 143 #include "strips.h" // bstrip 144 #include "commafmt.h" // CommaFmtULL 145 #include "valid.h" // IsFullName 146 #include "dirs.h" // save_dir2 147 #include "wrappers.h" // xfree 142 148 #include "fortify.h" 143 144 #pragma data_seg(DATA1)145 146 static PSZ pszSrcFile = __FILE__;147 148 static USHORT firsttool = 0;149 149 150 150 static BOOL CloseDirCnrChildren(HWND hwndClient); … … 153 153 static VOID BuildTools(HWND hwndT, BOOL resize); 154 154 155 // Data definitions 156 #pragma data_seg(GLOBAL1) 157 ULONG DriveLines; 158 HWND MainObjectHwnd; 159 HWND MainPopupMenu; 160 BOOL MenuInvisible; 161 PFNWP PFNWPButton; 162 PFNWP PFNWPStatic; 163 BOOL fAmClosing; 164 BOOL fAutoTile; 165 BOOL fAutoView; 166 BOOL fComments; 167 BOOL fDrivebar; 168 BOOL fFreeTree; 169 BOOL fMoreButtons; 170 BOOL fNoFinger; 171 BOOL fNoSaveState; 172 BOOL fNoTileUpdate; 173 BOOL fRunning; 174 BOOL fSplitStatus; 175 BOOL fTextTools; 176 BOOL fToolTitles; 177 BOOL fToolbar; 178 BOOL fUserComboBox; 179 HBITMAP hbmLEDoff; 180 HBITMAP hbmLEDon; 181 HPOINTER hptrFinger; 182 HWND hwndAutoview; 183 HWND hwndBubble; 184 HWND hwndName; 185 HWND hwndStatelist; 186 HWND hwndToolback; 187 HWND hwndTree; 188 USHORT shiftstate; 189 190 #pragma data_seg(GLOBAL2) 191 HMODULE FM3ModHandle; 192 CHAR *FM3Str; 193 RGB2 RGBGREY; 194 195 #pragma data_seg(DATA1) 196 197 static PSZ pszSrcFile = __FILE__; 198 static USHORT firsttool = 0; 199 static HWND hwndButtonlist; 200 static HWND hwndCmdlist; 201 static HWND hwndDrivelist; 202 static HWND hwndUserlist; 203 204 155 205 static MRESULT EXPENTRY MainObjectWndProc(HWND hwnd, ULONG msg, MPARAM mp1, 156 MPARAM mp2)206 MPARAM mp2) 157 207 { 158 208 switch (msg) { … … 183 233 *dv = 0; 184 234 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwndB, QW_PARENT), 185 id + 50), sizeof(dv), dv);235 id + 50), sizeof(dv), dv); 186 236 d = toupper(*dv); 187 237 if (isalpha(d) && d > 'B' && 188 !(driveflags[d - 'A'] & (DRIVE_CDROM | DRIVE_INVALID |189 DRIVE_SLOW)) &&190 (!hwndBubble ||191 WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) &&192 !WinQueryCapture(HWND_DESKTOP)) {193 194 FSALLOCATE fsa;195 CHAR s[90], szQty[38];196 ULONG ulPctFree;197 ULONGLONG ullFreeQty;198 199 if (!DosQueryFSInfo((d - 'A') + 1,200 FSIL_ALLOC, &fsa, sizeof(FSALLOCATE))) {201 ullFreeQty = (ULONGLONG) fsa.cUnitAvail *202 (fsa.cSectorUnit * fsa.cbSector);203 ulPctFree = (fsa.cUnit && fsa.cUnitAvail) ?204 (fsa.cUnitAvail * 100) / fsa.cUnit : 0;205 CommaFmtULL(szQty, sizeof(szQty), ullFreeQty, ' ');206 sprintf(s, "%s (%lu%%) free", szQty, ulPctFree);207 }208 if ((!hwndBubble ||209 WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) &&210 !WinQueryCapture(HWND_DESKTOP))211 WinSendMsg(hwndB, UM_SETUP6, MPFROMP(s), MPVOID);238 !(driveflags[d - 'A'] & (DRIVE_CDROM | DRIVE_INVALID | 239 DRIVE_SLOW)) && 240 (!hwndBubble || 241 WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) && 242 !WinQueryCapture(HWND_DESKTOP)) { 243 244 FSALLOCATE fsa; 245 CHAR s[90], szQty[38]; 246 ULONG ulPctFree; 247 ULONGLONG ullFreeQty; 248 249 if (!DosQueryFSInfo((d - 'A') + 1, 250 FSIL_ALLOC, &fsa, sizeof(FSALLOCATE))) { 251 ullFreeQty = (ULONGLONG) fsa.cUnitAvail * 252 (fsa.cSectorUnit * fsa.cbSector); 253 ulPctFree = (fsa.cUnit && fsa.cUnitAvail) ? 254 (fsa.cUnitAvail * 100) / fsa.cUnit : 0; 255 CommaFmtULL(szQty, sizeof(szQty), ullFreeQty, ' '); 256 sprintf(s, "%s (%lu%%) free", szQty, ulPctFree); 257 } 258 if ((!hwndBubble || 259 WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) && 260 !WinQueryCapture(HWND_DESKTOP)) 261 WinSendMsg(hwndB, UM_SETUP6, MPFROMP(s), MPVOID); 212 262 } 213 263 } … … 220 270 221 271 if (DosQuerySysInfo(QSV_BOOT_DRIVE, 222 QSV_BOOT_DRIVE,223 (PVOID) & bd, (ULONG) sizeof(ULONG)))224 bd = 3L;272 QSV_BOOT_DRIVE, 273 (PVOID) & bd, (ULONG) sizeof(ULONG))) 274 bd = 3L; 225 275 *s = (CHAR) bd + '@'; 226 276 WinSendMsg(hwndMain, UM_SETDIR, MPFROMP(s), MPFROMLONG(1)); 227 277 if (!mp1) { 228 s[3] = 0;229 WinSendMsg(hwndMain, UM_SETDIR, MPFROMP(s), MPVOID);278 s[3] = 0; 279 WinSendMsg(hwndMain, UM_SETDIR, MPFROMP(s), MPVOID); 230 280 } 231 281 PostMsg(MainObjectHwnd, UM_RESTORE, MPFROMLONG(1), MPFROMLONG(1)); … … 285 335 DosError(FERR_DISABLEHARDERR); 286 336 WinRegisterClass(hab2, 287 (PSZ) WC_OBJECTWINDOW,288 MainObjectWndProc, 0, sizeof(PVOID));337 (PSZ) WC_OBJECTWINDOW, 338 MainObjectWndProc, 0, sizeof(PVOID)); 289 339 MainObjectHwnd = WinCreateWindow(HWND_OBJECT, 290 WC_OBJECTWINDOW,291 (PSZ) NULL,292 0,293 0L,294 0L,295 0L,296 0L,297 0L, HWND_TOP, OBJ_FRAME, NULL, NULL);340 WC_OBJECTWINDOW, 341 (PSZ) NULL, 342 0, 343 0L, 344 0L, 345 0L, 346 0L, 347 0L, HWND_TOP, OBJ_FRAME, NULL, NULL); 298 348 if (!MainObjectHwnd) 299 Win_Error2(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__,300 IDS_WINCREATEWINDOW);349 Win_Error2(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__, 350 IDS_WINCREATEWINDOW); 301 351 else { 302 WinSetWindowPtr(MainObjectHwnd, QWL_USER, args);303 # ifdef FORTIFY304 Fortify_EnterScope();305 # endif306 while (WinGetMsg(hab2, &qmsg2, (HWND) 0, 0, 0))307 WinDispatchMsg(hab2, &qmsg2);308 WinDestroyWindow(MainObjectHwnd);309 # ifdef FORTIFY310 Fortify_LeaveScope();311 # endif352 WinSetWindowPtr(MainObjectHwnd, QWL_USER, args); 353 # ifdef FORTIFY 354 Fortify_EnterScope(); 355 # endif 356 while (WinGetMsg(hab2, &qmsg2, (HWND) 0, 0, 0)) 357 WinDispatchMsg(hab2, &qmsg2); 358 WinDestroyWindow(MainObjectHwnd); 359 # ifdef FORTIFY 360 Fortify_LeaveScope(); 361 # endif 312 362 } 313 363 WinDestroyMsgQueue(hmq2); … … 318 368 319 369 static MRESULT EXPENTRY IdealButtonProc(HWND hwnd, ULONG msg, MPARAM mp1, 320 MPARAM mp2)370 MPARAM mp2) 321 371 { 322 372 switch (msg) { … … 338 388 while ((hwndC = WinGetNextWindow(henum)) != NULLHANDLE) { 339 389 if (hwndC != exclude) { 340 id = WinQueryWindowUShort(hwndC, QWS_ID);341 if (id)342 break;390 id = WinQueryWindowUShort(hwndC, QWS_ID); 391 if (id) 392 break; 343 393 } 344 394 } … … 360 410 henum = WinBeginEnumWindows(hwndMain); 361 411 while ((hwndC = WinGetNextWindow(henum)) != NULLHANDLE) { 362 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Tree = %lu\rExclude = %lu\rFound = %lu",hwndTree,exclude,hwndC);363 if (hwndC != exclude && hwndC != hwndTree) {364 id = WinQueryWindowUShort(hwndC, QWS_ID);365 if (id) {366 hwndClient = WinWindowFromID(hwndC, FID_CLIENT);367 if (hwndClient) {368 hwndDir = WinWindowFromID(hwndClient, DIR_CNR);369 if (hwndDir) {370 if (fLookInDir) {371 pci = (PCNRITEM) WinSendMsg(hwndDir,372 CM_QUERYRECORDEMPHASIS,373 MPFROMLONG(CMA_FIRST),374 MPFROMSHORT(CRA_CURSORED));375 if (pci && (INT) pci != -1)376 break;377 }378 if (WinSendMsg(hwndClient,379 UM_CONTAINERDIR, MPFROMP(ret), MPVOID)) {380 MakeValidDir(ret);381 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Tree = %lu\rExclude = %lu\rFound = %lu\r\"%s\"",hwndTree,exclude,hwndC,ret);382 WinEndEnumWindows(henum);383 return hwndC;384 }385 }386 }387 }388 }412 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Tree = %lu\rExclude = %lu\rFound = %lu",hwndTree,exclude,hwndC); 413 if (hwndC != exclude && hwndC != hwndTree) { 414 id = WinQueryWindowUShort(hwndC, QWS_ID); 415 if (id) { 416 hwndClient = WinWindowFromID(hwndC, FID_CLIENT); 417 if (hwndClient) { 418 hwndDir = WinWindowFromID(hwndClient, DIR_CNR); 419 if (hwndDir) { 420 if (fLookInDir) { 421 pci = (PCNRITEM) WinSendMsg(hwndDir, 422 CM_QUERYRECORDEMPHASIS, 423 MPFROMLONG(CMA_FIRST), 424 MPFROMSHORT(CRA_CURSORED)); 425 if (pci && (INT) pci != -1) 426 break; 427 } 428 if (WinSendMsg(hwndClient, 429 UM_CONTAINERDIR, MPFROMP(ret), MPVOID)) { 430 MakeValidDir(ret); 431 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Tree = %lu\rExclude = %lu\rFound = %lu\r\"%s\"",hwndTree,exclude,hwndC,ret); 432 WinEndEnumWindows(henum); 433 return hwndC; 434 } 435 } 436 } 437 } 438 } 389 439 } 390 440 WinEndEnumWindows(henum); 391 441 if (!pci || (INT) pci == -1) { 392 hwndC = hwndTree;393 pci = (PCNRITEM) WinSendMsg(WinWindowFromID(WinWindowFromID(hwndTree,394 FID_CLIENT),395 TREE_CNR),396 CM_QUERYRECORDEMPHASIS,397 MPFROMLONG(CMA_FIRST),398 MPFROMSHORT(CRA_CURSORED));442 hwndC = hwndTree; 443 pci = (PCNRITEM) WinSendMsg(WinWindowFromID(WinWindowFromID(hwndTree, 444 FID_CLIENT), 445 TREE_CNR), 446 CM_QUERYRECORDEMPHASIS, 447 MPFROMLONG(CMA_FIRST), 448 MPFROMSHORT(CRA_CURSORED)); 399 449 } 400 450 if (pci && (INT) pci != -1) { 401 strcpy(ret, pci->pszFileName);402 MakeValidDir(ret);451 strcpy(ret, pci->pszFileName); 452 MakeValidDir(ret); 403 453 } 404 454 else 405 strcpy(ret, pFM2SaveDirectory);455 strcpy(ret, pFM2SaveDirectory); 406 456 } 407 457 } … … 421 471 hwndDir = WinWindowFromID(hwndC, DIR_CNR); 422 472 if (hwndDir) 423 ret++;473 ret++; 424 474 } 425 475 } … … 439 489 hwndC = WinWindowFromID(hwndF, FID_CLIENT); 440 490 if (hwndC) { 441 hwndDir = WinWindowFromID(hwndC, DIR_CNR);442 if (hwndDir) {443 *retstr = 0;444 WinSendMsg(hwndC, UM_CONTAINERDIR, MPFROMP(retstr), MPVOID);445 if (*retstr && !stricmp(retstr, directory)) {446 if (restore)447 WinSetWindowPos(hwndF,448 HWND_TOP,449 0,450 0,451 0,452 0,453 SWP_RESTORE | SWP_SHOW |454 SWP_ACTIVATE | SWP_ZORDER);455 break;456 }457 }491 hwndDir = WinWindowFromID(hwndC, DIR_CNR); 492 if (hwndDir) { 493 *retstr = 0; 494 WinSendMsg(hwndC, UM_CONTAINERDIR, MPFROMP(retstr), MPVOID); 495 if (*retstr && !stricmp(retstr, directory)) { 496 if (restore) 497 WinSetWindowPos(hwndF, 498 HWND_TOP, 499 0, 500 0, 501 0, 502 0, 503 SWP_RESTORE | SWP_SHOW | 504 SWP_ACTIVATE | SWP_ZORDER); 505 break; 506 } 507 } 458 508 } 459 509 } … … 522 572 while (tool) { 523 573 if (!(tool->flags & T_INVISIBLE)) { 524 swp[x].x = butx;525 if (fTextTools || (tool->flags & T_TEXT)) {526 butx += 55L;527 swp[x].cx = 54L;528 swp[x].cy = 24L;529 swp[x].y = 3L;530 }531 else532 butx += 33L;533 if (tool->flags & T_SEPARATOR)534 butx += 12;574 swp[x].x = butx; 575 if (fTextTools || (tool->flags & T_TEXT)) { 576 butx += 55L; 577 swp[x].cx = 54L; 578 swp[x].cy = 24L; 579 swp[x].y = 3L; 580 } 581 else 582 butx += 33L; 583 if (tool->flags & T_SEPARATOR) 584 butx += 12; 535 585 } 536 586 else 537 swp[x].fl = noattrib;587 swp[x].fl = noattrib; 538 588 swp[x].hwnd = WinWindowFromID(hwnd, tool->id); 539 589 x++; … … 544 594 swp[x].x = butx; 545 595 if (!(tool->flags & T_INVISIBLE)) { 546 if (fTextTools || (tool->flags & T_TEXT)) {547 butx += 55L;548 swp[x].cx = 54L;549 swp[x].cy = 24L;550 swp[x].y = 3L;551 }552 else553 butx += 33L;554 if (tool->flags & T_SEPARATOR)555 butx += 12;596 if (fTextTools || (tool->flags & T_TEXT)) { 597 butx += 55L; 598 swp[x].cx = 54L; 599 swp[x].cy = 24L; 600 swp[x].y = 3L; 601 } 602 else 603 butx += 33L; 604 if (tool->flags & T_SEPARATOR) 605 butx += 12; 556 606 } 557 607 else 558 swp[x].fl = noattrib;608 swp[x].fl = noattrib; 559 609 swp[x].hwnd = WinWindowFromID(hwnd, tool->id); 560 610 x++; … … 564 614 if (!fTextTools && fToolTitles) { 565 615 for (x = 2L; x < numtools + 2L; x++) { 566 if (fTextTools || !fToolTitles)567 swp[x].fl = noattrib;568 else {569 tool = find_tool(WinQueryWindowUShort(swp[x].hwnd, QWS_ID));570 if (tool && (tool->flags & T_TEXT))571 swp[x].fl = noattrib;572 else {573 swp[x].hwndInsertBehind = HWND_TOP;574 swp[x].y = 1L;575 swp[x].cy = 10L;576 }577 }578 swp[x].hwnd = WinWindowFromID(hwnd,579 WinQueryWindowUShort(swp[x].hwnd,580 QWS_ID) + 25000);616 if (fTextTools || !fToolTitles) 617 swp[x].fl = noattrib; 618 else { 619 tool = find_tool(WinQueryWindowUShort(swp[x].hwnd, QWS_ID)); 620 if (tool && (tool->flags & T_TEXT)) 621 swp[x].fl = noattrib; 622 else { 623 swp[x].hwndInsertBehind = HWND_TOP; 624 swp[x].y = 1L; 625 swp[x].cy = 10L; 626 } 627 } 628 swp[x].hwnd = WinWindowFromID(hwnd, 629 WinQueryWindowUShort(swp[x].hwnd, 630 QWS_ID) + 25000); 581 631 } 582 632 WinSetMultWindowPos(WinQueryAnchorBlock(hwnd), &swp[2], numtools); … … 588 638 589 639 static MRESULT EXPENTRY DropDownListProc(HWND hwnd, ULONG msg, MPARAM mp1, 590 MPARAM mp2)640 MPARAM mp2) 591 641 { 592 642 PFNWP oldproc = (PFNWP) INSTDATA(hwnd); … … 626 676 id = WinQueryWindowUShort(hwndParent, QWS_ID); 627 677 if (SHORT1FROMMP(mp2)) { 628 // If getting focus 1st time - save original accelerator629 if (haccelSaved == NULLHANDLE) {630 haccelSaved = WinQueryAccelTable(hab, hwndFrame);631 if (haccelSaved == NULLHANDLE)632 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinQueryAccelTable");633 // else634 // DbgMsg(pszSrcFile, __LINE__, "WinQueryAccelTable SAVED %x", haccelSaved);635 }636 if (haccelSaved != NULLHANDLE) {637 switch (id) {638 case MAIN_DRIVELIST:639 if (haccelDriveList == NULLHANDLE) {640 haccelDriveList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_DRIVELIST);641 if (haccelDriveList == NULLHANDLE)642 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable");643 }644 if (haccelDriveList != NULLHANDLE) {645 if (!WinSetAccelTable(hab, haccelDriveList, hwndFrame))646 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable");647 // else648 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_DRIVELIST %x %x", hwndFrame, haccelDriveList);649 }650 break;651 case MAIN_SETUPLIST:652 if (haccelSetupList == NULLHANDLE) {653 haccelSetupList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_SETUPLIST);654 if (haccelSetupList == NULLHANDLE)655 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable");656 }657 if (haccelSetupList != NULLHANDLE) {658 if (!WinSetAccelTable(hab, haccelSetupList, hwndFrame))659 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable");660 // else661 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_SETUPLIST %x %x", hwndFrame, haccelSetupList);662 }663 break;664 case MAIN_CMDLIST:665 if (haccelCmdList == NULLHANDLE) {666 haccelCmdList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_CMDLIST);667 if (haccelCmdList == NULLHANDLE)668 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable");669 }670 if (haccelCmdList != NULLHANDLE) {671 if (!WinSetAccelTable(hab, haccelCmdList, hwndFrame))672 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable");673 // else674 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_CMDLIST %x %x", hwndFrame, haccelCmdList);675 }676 break;677 case MAIN_USERLIST:678 if (haccelUserList == NULLHANDLE) {679 haccelUserList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_USERLIST);680 if (haccelUserList == NULLHANDLE)681 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable");682 }683 if (haccelUserList != NULLHANDLE) {684 if (!WinSetAccelTable(hab, haccelUserList, hwndFrame))685 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable");686 // else687 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_USERLIST %x %x", hwndFrame, haccelUserList);688 }689 break;690 case MAIN_BUTTONLIST:691 if (haccelButtonList == NULLHANDLE) {692 haccelButtonList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_BUTTONLIST);693 if (haccelButtonList == NULLHANDLE)694 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable");695 }696 if (haccelButtonList != NULLHANDLE) {697 if (!WinSetAccelTable(hab, haccelButtonList, hwndFrame))698 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable");699 // else700 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_BUTTONLIST %x %x", hwndFrame, haccelButtonList);701 }702 break;703 } // switch704 }678 // If getting focus 1st time - save original accelerator 679 if (haccelSaved == NULLHANDLE) { 680 haccelSaved = WinQueryAccelTable(hab, hwndFrame); 681 if (haccelSaved == NULLHANDLE) 682 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinQueryAccelTable"); 683 // else 684 // DbgMsg(pszSrcFile, __LINE__, "WinQueryAccelTable SAVED %x", haccelSaved); 685 } 686 if (haccelSaved != NULLHANDLE) { 687 switch (id) { 688 case MAIN_DRIVELIST: 689 if (haccelDriveList == NULLHANDLE) { 690 haccelDriveList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_DRIVELIST); 691 if (haccelDriveList == NULLHANDLE) 692 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable"); 693 } 694 if (haccelDriveList != NULLHANDLE) { 695 if (!WinSetAccelTable(hab, haccelDriveList, hwndFrame)) 696 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 697 // else 698 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_DRIVELIST %x %x", hwndFrame, haccelDriveList); 699 } 700 break; 701 case MAIN_SETUPLIST: 702 if (haccelSetupList == NULLHANDLE) { 703 haccelSetupList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_SETUPLIST); 704 if (haccelSetupList == NULLHANDLE) 705 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable"); 706 } 707 if (haccelSetupList != NULLHANDLE) { 708 if (!WinSetAccelTable(hab, haccelSetupList, hwndFrame)) 709 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 710 // else 711 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_SETUPLIST %x %x", hwndFrame, haccelSetupList); 712 } 713 break; 714 case MAIN_CMDLIST: 715 if (haccelCmdList == NULLHANDLE) { 716 haccelCmdList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_CMDLIST); 717 if (haccelCmdList == NULLHANDLE) 718 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable"); 719 } 720 if (haccelCmdList != NULLHANDLE) { 721 if (!WinSetAccelTable(hab, haccelCmdList, hwndFrame)) 722 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 723 // else 724 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_CMDLIST %x %x", hwndFrame, haccelCmdList); 725 } 726 break; 727 case MAIN_USERLIST: 728 if (haccelUserList == NULLHANDLE) { 729 haccelUserList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_USERLIST); 730 if (haccelUserList == NULLHANDLE) 731 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable"); 732 } 733 if (haccelUserList != NULLHANDLE) { 734 if (!WinSetAccelTable(hab, haccelUserList, hwndFrame)) 735 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 736 // else 737 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_USERLIST %x %x", hwndFrame, haccelUserList); 738 } 739 break; 740 case MAIN_BUTTONLIST: 741 if (haccelButtonList == NULLHANDLE) { 742 haccelButtonList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_BUTTONLIST); 743 if (haccelButtonList == NULLHANDLE) 744 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable"); 745 } 746 if (haccelButtonList != NULLHANDLE) { 747 if (!WinSetAccelTable(hab, haccelButtonList, hwndFrame)) 748 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 749 // else 750 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_BUTTONLIST %x %x", hwndFrame, haccelButtonList); 751 } 752 break; 753 } // switch 754 } 705 755 } 706 756 else { 707 // Losing focus708 switch (id) {709 case MAIN_DRIVELIST:710 case MAIN_SETUPLIST:711 case MAIN_CMDLIST:712 case MAIN_USERLIST:713 case MAIN_BUTTONLIST:714 if (haccelSaved != NULLHANDLE) {715 if (!WinSetAccelTable(hab, haccelSaved, hwndFrame))716 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable");717 // else718 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable SAVED %x %x", hwndFrame, haccelSaved);719 }720 break;721 } // switch757 // Losing focus 758 switch (id) { 759 case MAIN_DRIVELIST: 760 case MAIN_SETUPLIST: 761 case MAIN_CMDLIST: 762 case MAIN_USERLIST: 763 case MAIN_BUTTONLIST: 764 if (haccelSaved != NULLHANDLE) { 765 if (!WinSetAccelTable(hab, haccelSaved, hwndFrame)) 766 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 767 // else 768 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable SAVED %x %x", hwndFrame, haccelSaved); 769 } 770 break; 771 } // switch 722 772 } 723 773 } … … 729 779 730 780 if (hwndMenu) 731 WinDestroyWindow(hwndMenu);781 WinDestroyWindow(hwndMenu); 732 782 hwndMenu = (HWND) 0; 733 783 id = WinQueryWindowUShort(WinQueryWindow(hwnd, QW_PARENT), QWS_ID); 734 784 switch (id) { 735 785 case MAIN_CMDLIST: 736 WinPostMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd,737 QW_PARENT),738 QW_PARENT),739 FID_CLIENT),740 WM_COMMAND, MPFROM2SHORT(IDM_EDITCOMMANDS, 0), MPVOID);741 break;786 WinPostMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd, 787 QW_PARENT), 788 QW_PARENT), 789 FID_CLIENT), 790 WM_COMMAND, MPFROM2SHORT(IDM_EDITCOMMANDS, 0), MPVOID); 791 break; 742 792 case MAIN_USERLIST: 743 793 case MAIN_SETUPLIST: 744 hwndMenu = WinLoadMenu(HWND_DESKTOP, FM3ModHandle, id);745 if (hwndMenu)746 PopupMenu(hwnd,747 WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd,748 QW_PARENT),749 QW_PARENT),750 FID_CLIENT), hwndMenu);751 break;794 hwndMenu = WinLoadMenu(HWND_DESKTOP, FM3ModHandle, id); 795 if (hwndMenu) 796 PopupMenu(hwnd, 797 WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd, 798 QW_PARENT), 799 QW_PARENT), 800 FID_CLIENT), hwndMenu); 801 break; 752 802 default: 753 ret = FALSE;754 break;803 ret = FALSE; 804 break; 755 805 } // switch 756 806 return ret; … … 761 811 switch (SHORT1FROMMP(mp1)) { 762 812 case CBID_EDIT: 763 id = WinQueryWindowUShort(hwnd, QWS_ID);764 switch (SHORT2FROMMP(mp1)) {765 case EN_SETFOCUS:766 switch (id) {767 case MAIN_CMDLIST:768 WinSetWindowText(hwndStatus2, GetPString(IDS_CMDLISTHELP));769 break;770 case MAIN_SETUPLIST:771 WinSetWindowText(hwndStatus2, GetPString(IDS_SETUPLISTHELP));772 break;773 case MAIN_USERLIST:774 WinSetWindowText(hwndStatus2, GetPString(IDS_USERLISTHELP));775 break;776 case MAIN_DRIVELIST:777 WinSetWindowText(hwndStatus2, GetPString(IDS_DRIVELISTHELP));778 break;779 case MAIN_BUTTONLIST:780 WinSetWindowText(hwndStatus2, GetPString(IDS_BUTTONLISTHELP));781 break;782 default:783 break;784 }785 break;786 787 default:788 break;789 }813 id = WinQueryWindowUShort(hwnd, QWS_ID); 814 switch (SHORT2FROMMP(mp1)) { 815 case EN_SETFOCUS: 816 switch (id) { 817 case MAIN_CMDLIST: 818 WinSetWindowText(hwndStatus2, GetPString(IDS_CMDLISTHELP)); 819 break; 820 case MAIN_SETUPLIST: 821 WinSetWindowText(hwndStatus2, GetPString(IDS_SETUPLISTHELP)); 822 break; 823 case MAIN_USERLIST: 824 WinSetWindowText(hwndStatus2, GetPString(IDS_USERLISTHELP)); 825 break; 826 case MAIN_DRIVELIST: 827 WinSetWindowText(hwndStatus2, GetPString(IDS_DRIVELISTHELP)); 828 break; 829 case MAIN_BUTTONLIST: 830 WinSetWindowText(hwndStatus2, GetPString(IDS_BUTTONLISTHELP)); 831 break; 832 default: 833 break; 834 } 835 break; 836 837 default: 838 break; 839 } 790 840 } 791 841 break; … … 800 850 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"%u %s %u",id,(id == CBID_EDIT) ? "TRUE" : "FALSE",WinQueryWindowUShort(WinQueryWindow(hwnd,QW_PARENT),QWS_ID) == MAIN_USERLIST); 801 851 if (id == CBID_EDIT && 802 WinQueryWindowUShort(WinQueryWindow(hwnd, QW_PARENT), QWS_ID) ==803 MAIN_USERLIST) {852 WinQueryWindowUShort(WinQueryWindow(hwnd, QW_PARENT), QWS_ID) == 853 MAIN_USERLIST) { 804 854 805 855 CHAR path[CCHMAXPATH]; … … 810 860 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Dragging: %s",path); 811 861 if (*path && !IsRoot(path)) 812 DragOne(hwnd, (HWND) 0, path, FALSE);862 DragOne(hwnd, (HWND) 0, path, FALSE); 813 863 return 0; 814 864 } … … 819 869 if (id == MAIN_USERLIST) { 820 870 if (!emphasized) { 821 emphasized = TRUE;822 DrawTargetEmphasis(hwnd, emphasized);871 emphasized = TRUE; 872 DrawTargetEmphasis(hwnd, emphasized); 823 873 } 824 874 if (AcceptOneDrop(hwnd, mp1, mp2)) 825 return MRFROM2SHORT(DOR_DROP, DO_MOVE);875 return MRFROM2SHORT(DOR_DROP, DO_MOVE); 826 876 return MRFROM2SHORT(DOR_NEVERDROP, 0); 827 877 } … … 832 882 if (id == MAIN_USERLIST) { 833 883 if (emphasized) { 834 emphasized = FALSE;835 DrawTargetEmphasis(hwnd, emphasized);884 emphasized = FALSE; 885 DrawTargetEmphasis(hwnd, emphasized); 836 886 } 837 887 } … … 853 903 854 904 if (emphasized) { 855 emphasized = FALSE;856 DrawTargetEmphasis(hwnd, emphasized);905 emphasized = FALSE; 906 DrawTargetEmphasis(hwnd, emphasized); 857 907 } 858 908 if (GetOneDrop(hwnd, mp1, mp2, szFrom, sizeof(szFrom))) { 859 MakeValidDir(szFrom);860 WinSetWindowText(hwnd, szFrom);861 PostMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd,862 QW_PARENT),863 QW_PARENT),864 FID_CLIENT),865 UM_COMMAND, MPFROM2SHORT(IDM_ADDTOUSERLIST, 0), MPVOID);866 return 0;909 MakeValidDir(szFrom); 910 WinSetWindowText(hwnd, szFrom); 911 PostMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd, 912 QW_PARENT), 913 QW_PARENT), 914 FID_CLIENT), 915 UM_COMMAND, MPFROM2SHORT(IDM_ADDTOUSERLIST, 0), MPVOID); 916 return 0; 867 917 } 868 918 } … … 885 935 (other && fOtherHelp) || (!other && !drive && fToolbarHelp))) { 886 936 if ((!hwndBubble || 887 WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) &&888 !WinQueryCapture(HWND_DESKTOP))937 WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) && 938 !WinQueryCapture(HWND_DESKTOP)) 889 939 MakeBubble(hwnd, above, help); 890 940 } … … 907 957 /* don't bring up help if window isn't active */ 908 958 if (!WinIsChild(hwnd, hwndActive)) 909 return;959 return; 910 960 } 911 961 hwndActive = WinQueryFocus(HWND_DESKTOP); … … 913 963 /* don't bring up help if a menu is active */ 914 964 if (!strcmp(ucClassname, "#4")) 915 return;965 return; 916 966 } 917 967 } 918 968 919 969 hwndBubble = WinCreateWindow(HWND_DESKTOP, 920 WC_BUBBLE,921 help,922 WS_CLIPSIBLINGS | SS_TEXT |923 DT_CENTER | DT_VCENTER,924 0,925 0,926 0,927 0,928 HWND_DESKTOP, HWND_TOP, MAIN_HELP, NULL, NULL);970 WC_BUBBLE, 971 help, 972 WS_CLIPSIBLINGS | SS_TEXT | 973 DT_CENTER | DT_VCENTER, 974 0, 975 0, 976 0, 977 0, 978 HWND_DESKTOP, HWND_TOP, MAIN_HELP, NULL, NULL); 929 979 if (!hwndBubble) 930 980 Win_Error2(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__, 931 IDS_WINCREATEWINDOW);981 IDS_WINCREATEWINDOW); 932 982 else { 933 983 HPS hps; … … 949 999 pp = strchr(p, '\r'); 950 1000 if (pp) { 951 wp = pp;952 *pp = 0;953 pp++;1001 wp = pp; 1002 *pp = 0; 1003 pp++; 954 1004 } 955 1005 GpiQueryTextBox(hps, strlen(p), p, TXTBOX_COUNT, aptl); 956 1006 tptl.x = max(aptl[TXTBOX_TOPRIGHT].x, tptl.x); 957 1007 if (tptl.y) 958 tptl.y += extra;1008 tptl.y += extra; 959 1009 else 960 extra = aptl[TXTBOX_TOPLEFT].y / 4;1010 extra = aptl[TXTBOX_TOPLEFT].y / 4; 961 1011 tptl.y += aptl[TXTBOX_TOPLEFT].y; 962 1012 if (wp) 963 *wp = '\r';1013 *wp = '\r'; 964 1014 p = pp; 965 1015 } … … 971 1021 sy = ptl.y + swp.cy + 4; 972 1022 if (sy + tptl.y + 12 > lyScreen) { 973 above = FALSE;974 sy = ptl.y - (tptl.y + 14);1023 above = FALSE; 1024 sy = ptl.y - (tptl.y + 14); 975 1025 } 976 1026 } … … 988 1038 sy = ptl.y + swp.cy + 4; 989 1039 if (sy + tptl.y + 12 > lyScreen) 990 sy = 0;1040 sy = 0; 991 1041 } 992 1042 WinSetWindowPos(hwndBubble, HWND_TOP, sx, sy, 993 tptl.x + 14,994 tptl.y + 12,995 SWP_DEACTIVATE | SWP_SHOW | SWP_ZORDER |996 SWP_MOVE | SWP_SIZE);1043 tptl.x + 14, 1044 tptl.y + 12, 1045 SWP_DEACTIVATE | SWP_SHOW | SWP_ZORDER | 1046 SWP_MOVE | SWP_SIZE); 997 1047 } 998 1048 } … … 1020 1070 WinQueryPointerPos(HWND_DESKTOP, &ptl); 1021 1071 if (WinWindowFromPoint(HWND_DESKTOP, &ptl, TRUE) != 1022 WinQueryWindowULong(hwnd, QWL_USER) || !WinIsWindowVisible(hwnd))1023 WinDestroyWindow(hwnd);1072 WinQueryWindowULong(hwnd, QWL_USER) || !WinIsWindowVisible(hwnd)) 1073 WinDestroyWindow(hwnd); 1024 1074 } 1025 1075 return 0; … … 1035 1085 hps = WinBeginPaint(hwnd, (HPS) 0, NULL); 1036 1086 if (hps) { 1037 WinQueryWindowPos(hwnd, &swp);1038 GpiCreateLogColorTable(hps, 0, LCOLF_RGB, 0, 0, 0);1039 GpiSetColor(hps, ((255 << 16) | (255 << 8) | 198));1040 GpiSetBackMix(hps, BM_LEAVEALONE);1041 GpiSetMix(hps, FM_OVERPAINT);1042 ptl.x = ptl.y = 0;1043 GpiMove(hps, &ptl);1044 ptl.x = swp.cx - 1;1045 ptl.y = swp.cy - 1;1046 GpiBox(hps, DRO_OUTLINEFILL, &ptl, 0, 0);1047 tlen = WinQueryWindowTextLength(hwnd);1048 if (tlen) {1049 s = xmalloc(tlen + 2, pszSrcFile, __LINE__);1050 if (s) {1051 WinQueryWindowText(hwnd, tlen + 1, s);1052 if (*s) {1053 p = s;1054 y = swp.cy - 3;1055 extra = WinQueryWindowULong(hwnd, QWL_USER + 4);1056 GpiSetColor(hps, 0);1057 GpiSetMix(hps, FM_OVERPAINT);1058 while (p && *p) {1059 wp = NULL;1060 pp = strchr(p, '\r');1061 if (pp) {1062 wp = pp;1063 *pp = 0;1064 pp++;1065 }1066 GpiQueryTextBox(hps, strlen(p), p, TXTBOX_COUNT, aptl);1067 ptl.x = 7;1068 y -= aptl[TXTBOX_TOPLEFT].y;1069 if (p != s)1070 y -= extra;1071 ptl.y = y;1072 GpiCharStringAt(hps, &ptl, strlen(p), p);1073 if (wp)1074 *wp = '\r';1075 p = pp;1076 }1077 }1078 free(s);1079 }1080 }1081 if (!(swp.fl & (SWP_HIDE | SWP_MINIMIZE)) && swp.cx > 6 && swp.cy > 6) {1082 GpiSetColor(hps, CLR_WHITE);1083 ptl.x = 1;1084 ptl.y = 1;1085 GpiMove(hps, &ptl);1086 ptl.y = swp.cy - 2;1087 GpiLine(hps, &ptl);1088 ptl.x = swp.cx - 2;1089 GpiLine(hps, &ptl);1090 ptl.x = 2;1091 ptl.y = 2;1092 GpiMove(hps, &ptl);1093 ptl.y = swp.cy - 3;1094 GpiLine(hps, &ptl);1095 ptl.x = swp.cx - 3;1096 GpiLine(hps, &ptl);1097 GpiSetColor(hps, CLR_BROWN);1098 ptl.x = 1;1099 ptl.y = 1;1100 GpiMove(hps, &ptl);1101 ptl.x = swp.cx - 2;1102 GpiLine(hps, &ptl);1103 ptl.y = swp.cy - 2;1104 GpiLine(hps, &ptl);1105 ptl.x = 2;1106 ptl.y = 2;1107 GpiMove(hps, &ptl);1108 ptl.x = swp.cx - 3;1109 GpiLine(hps, &ptl);1110 ptl.y = swp.cy - 3;1111 GpiLine(hps, &ptl);1112 }1113 WinEndPaint(hps);1087 WinQueryWindowPos(hwnd, &swp); 1088 GpiCreateLogColorTable(hps, 0, LCOLF_RGB, 0, 0, 0); 1089 GpiSetColor(hps, ((255 << 16) | (255 << 8) | 198)); 1090 GpiSetBackMix(hps, BM_LEAVEALONE); 1091 GpiSetMix(hps, FM_OVERPAINT); 1092 ptl.x = ptl.y = 0; 1093 GpiMove(hps, &ptl); 1094 ptl.x = swp.cx - 1; 1095 ptl.y = swp.cy - 1; 1096 GpiBox(hps, DRO_OUTLINEFILL, &ptl, 0, 0); 1097 tlen = WinQueryWindowTextLength(hwnd); 1098 if (tlen) { 1099 s = xmalloc(tlen + 2, pszSrcFile, __LINE__); 1100 if (s) { 1101 WinQueryWindowText(hwnd, tlen + 1, s); 1102 if (*s) { 1103 p = s; 1104 y = swp.cy - 3; 1105 extra = WinQueryWindowULong(hwnd, QWL_USER + 4); 1106 GpiSetColor(hps, 0); 1107 GpiSetMix(hps, FM_OVERPAINT); 1108 while (p && *p) { 1109 wp = NULL; 1110 pp = strchr(p, '\r'); 1111 if (pp) { 1112 wp = pp; 1113 *pp = 0; 1114 pp++; 1115 } 1116 GpiQueryTextBox(hps, strlen(p), p, TXTBOX_COUNT, aptl); 1117 ptl.x = 7; 1118 y -= aptl[TXTBOX_TOPLEFT].y; 1119 if (p != s) 1120 y -= extra; 1121 ptl.y = y; 1122 GpiCharStringAt(hps, &ptl, strlen(p), p); 1123 if (wp) 1124 *wp = '\r'; 1125 p = pp; 1126 } 1127 } 1128 free(s); 1129 } 1130 } 1131 if (!(swp.fl & (SWP_HIDE | SWP_MINIMIZE)) && swp.cx > 6 && swp.cy > 6) { 1132 GpiSetColor(hps, CLR_WHITE); 1133 ptl.x = 1; 1134 ptl.y = 1; 1135 GpiMove(hps, &ptl); 1136 ptl.y = swp.cy - 2; 1137 GpiLine(hps, &ptl); 1138 ptl.x = swp.cx - 2; 1139 GpiLine(hps, &ptl); 1140 ptl.x = 2; 1141 ptl.y = 2; 1142 GpiMove(hps, &ptl); 1143 ptl.y = swp.cy - 3; 1144 GpiLine(hps, &ptl); 1145 ptl.x = swp.cx - 3; 1146 GpiLine(hps, &ptl); 1147 GpiSetColor(hps, CLR_BROWN); 1148 ptl.x = 1; 1149 ptl.y = 1; 1150 GpiMove(hps, &ptl); 1151 ptl.x = swp.cx - 2; 1152 GpiLine(hps, &ptl); 1153 ptl.y = swp.cy - 2; 1154 GpiLine(hps, &ptl); 1155 ptl.x = 2; 1156 ptl.y = 2; 1157 GpiMove(hps, &ptl); 1158 ptl.x = swp.cx - 3; 1159 GpiLine(hps, &ptl); 1160 ptl.y = swp.cy - 3; 1161 GpiLine(hps, &ptl); 1162 } 1163 WinEndPaint(hps); 1114 1164 } 1115 1165 } … … 1138 1188 switch (WinQueryWindowUShort(hwnd, QWS_ID)) { 1139 1189 case MAIN_LED: 1140 hps = WinGetPS(hwnd);1141 hbmold = (HBITMAP) WinSendMsg(hwnd, SM_QUERYHANDLE, MPVOID, MPVOID);1142 if (!fBlueLED) {1143 hbmLEDon = GpiLoadBitmap(hps, 0, LEDON_BMP, 12, 12);1144 hbmLEDoff = GpiLoadBitmap(hps, 0, LEDOFF_BMP, 12, 12);1145 }1146 else {1147 hbmLEDon = GpiLoadBitmap(hps, 0, LEDON2_BMP, 12, 12);1148 hbmLEDoff = GpiLoadBitmap(hps, 0, LEDOFF2_BMP, 12, 12);1149 }1150 if (hbmLEDoff && hbmLEDon)1151 WinSendMsg(hwnd, SM_SETHANDLE, MPFROMLONG(hbmLEDoff), MPVOID);1152 else {1153 if (hbmLEDoff)1154 GpiDeleteBitmap(hbmLEDoff);1155 if (hbmLEDon)1156 GpiDeleteBitmap(hbmLEDon);1157 }1158 if (hbmold &&1159 hbmLEDon &&1160 hbmLEDoff && hbmold != hbmLEDon && hbmold != hbmLEDoff)1161 GpiDeleteBitmap(hbmold);1162 if (hps)1163 WinReleasePS(hps);1164 break;1190 hps = WinGetPS(hwnd); 1191 hbmold = (HBITMAP) WinSendMsg(hwnd, SM_QUERYHANDLE, MPVOID, MPVOID); 1192 if (!fBlueLED) { 1193 hbmLEDon = GpiLoadBitmap(hps, 0, LEDON_BMP, 12, 12); 1194 hbmLEDoff = GpiLoadBitmap(hps, 0, LEDOFF_BMP, 12, 12); 1195 } 1196 else { 1197 hbmLEDon = GpiLoadBitmap(hps, 0, LEDON2_BMP, 12, 12); 1198 hbmLEDoff = GpiLoadBitmap(hps, 0, LEDOFF2_BMP, 12, 12); 1199 } 1200 if (hbmLEDoff && hbmLEDon) 1201 WinSendMsg(hwnd, SM_SETHANDLE, MPFROMLONG(hbmLEDoff), MPVOID); 1202 else { 1203 if (hbmLEDoff) 1204 GpiDeleteBitmap(hbmLEDoff); 1205 if (hbmLEDon) 1206 GpiDeleteBitmap(hbmLEDon); 1207 } 1208 if (hbmold && 1209 hbmLEDon && 1210 hbmLEDoff && hbmold != hbmLEDon && hbmold != hbmLEDoff) 1211 GpiDeleteBitmap(hbmold); 1212 if (hps) 1213 WinReleasePS(hps); 1214 break; 1165 1215 default: 1166 SetPresParams(hwnd,1167 &RGBGREY,1168 &RGBBLACK, &RGBGREY, GetPString(IDS_6HELVTEXT));1169 break;1216 SetPresParams(hwnd, 1217 &RGBGREY, 1218 &RGBBLACK, &RGBGREY, GetPString(IDS_6HELVTEXT)); 1219 break; 1170 1220 } 1171 1221 return mr; … … 1191 1241 case WM_BUTTON1CLICK: 1192 1242 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 1193 WM_COMMAND, MPFROM2SHORT(IDM_SHOWNOTEWND, 0), MPVOID);1243 WM_COMMAND, MPFROM2SHORT(IDM_SHOWNOTEWND, 0), MPVOID); 1194 1244 break; 1195 1245 1196 1246 case WM_BUTTON2CLICK: 1197 1247 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 1198 WM_COMMAND, MPFROM2SHORT(IDM_HIDENOTEWND, 0), MPVOID);1248 WM_COMMAND, MPFROM2SHORT(IDM_HIDENOTEWND, 0), MPVOID); 1199 1249 break; 1200 1250 … … 1202 1252 case WM_BUTTON3CLICK: 1203 1253 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 1204 WM_COMMAND, MPFROM2SHORT(IDM_WINDOWDLG, 0), MPVOID);1254 WM_COMMAND, MPFROM2SHORT(IDM_WINDOWDLG, 0), MPVOID); 1205 1255 break; 1206 1256 } … … 1225 1275 if (fToolbarHelp) { 1226 1276 if ((!hwndBubble || WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) 1227 && !WinQueryCapture(HWND_DESKTOP)) {1228 id = WinQueryWindowUShort(hwnd, QWS_ID);1229 tool = find_tool(id);1230 if (tool && tool->help && *tool->help) {1231 1232 char s[128];1233 1234 strcpy(s, tool->help);1235 if (tool->flags & T_DROPABLE)1236 strcat(s, GetPString(IDS_DROPONMETEXT));1237 MakeBubble(hwnd, FALSE, s);1238 }1277 && !WinQueryCapture(HWND_DESKTOP)) { 1278 id = WinQueryWindowUShort(hwnd, QWS_ID); 1279 tool = find_tool(id); 1280 if (tool && tool->help && *tool->help) { 1281 1282 char s[128]; 1283 1284 strcpy(s, tool->help); 1285 if (tool->flags & T_DROPABLE) 1286 strcat(s, GetPString(IDS_DROPONMETEXT)); 1287 MakeBubble(hwnd, FALSE, s); 1288 } 1239 1289 } 1240 1290 } … … 1245 1295 case IDM_HELP: 1246 1296 if (hwndHelp) 1247 WinSendMsg(hwndHelp,1248 HM_DISPLAY_HELP,1249 MPFROM2SHORT(HELP_TOOLBAR, 0), MPFROMSHORT(HM_RESOURCEID));1297 WinSendMsg(hwndHelp, 1298 HM_DISPLAY_HELP, 1299 MPFROM2SHORT(HELP_TOOLBAR, 0), MPFROMSHORT(HM_RESOURCEID)); 1250 1300 break; 1251 1301 … … 1253 1303 case IDM_HIDETOOL: /* hide tool */ 1254 1304 if (SHORT1FROMMP(mp1) == IDM_HIDETOOL) 1255 id = WinQueryWindowUShort(hwnd, QWS_ID);1305 id = WinQueryWindowUShort(hwnd, QWS_ID); 1256 1306 else 1257 id = (USHORT) WinDlgBox(HWND_DESKTOP, hwnd,1258 PickToolProc, FM3ModHandle,1259 PICKBTN_FRAME, GetPString(IDS_HIDETEXT));1307 id = (USHORT) WinDlgBox(HWND_DESKTOP, hwnd, 1308 PickToolProc, FM3ModHandle, 1309 PICKBTN_FRAME, GetPString(IDS_HIDETEXT)); 1260 1310 if (id) { 1261 tool = find_tool(id);1262 if (tool) {1263 tool->flags |= T_INVISIBLE;1311 tool = find_tool(id); 1312 if (tool) { 1313 tool->flags |= T_INVISIBLE; 1264 1314 save_tools(NULL); 1265 }1315 } 1266 1316 } 1267 1317 break; … … 1270 1320 tool = toolhead; 1271 1321 while (tool) { 1272 tool->flags &= (~T_INVISIBLE);1273 tool = tool->next;1322 tool->flags &= (~T_INVISIBLE); 1323 tool = tool->next; 1274 1324 } 1275 1325 save_tools(NULL); … … 1279 1329 case IDM_DELETETOOL: /* delete button */ 1280 1330 if (SHORT1FROMMP(mp1) == IDM_DELETETOOL) 1281 id = WinQueryWindowUShort(hwnd, QWS_ID);1331 id = WinQueryWindowUShort(hwnd, QWS_ID); 1282 1332 else 1283 id =1284 (USHORT) WinDlgBox(HWND_DESKTOP, hwnd, PickToolProc, FM3ModHandle,1285 PICKBTN_FRAME, GetPString(IDS_DELETETEXT));1333 id = 1334 (USHORT) WinDlgBox(HWND_DESKTOP, hwnd, PickToolProc, FM3ModHandle, 1335 PICKBTN_FRAME, GetPString(IDS_DELETETEXT)); 1286 1336 if (id) 1287 PostMsg(WinQueryWindow(hwnd, QW_PARENT), UM_SETUP,1337 PostMsg(WinQueryWindow(hwnd, QW_PARENT), UM_SETUP, 1288 1338 MPFROM2SHORT(id, 0), MPVOID); 1289 1339 return 0; … … 1292 1342 case IDM_EDITTOOL: /* edit button */ 1293 1343 if (SHORT1FROMMP(mp1) == IDM_EDITTOOL) 1294 id = WinQueryWindowUShort(hwnd, QWS_ID);1344 id = WinQueryWindowUShort(hwnd, QWS_ID); 1295 1345 else 1296 id =1297 (USHORT) WinDlgBox(HWND_DESKTOP, hwnd, PickToolProc, FM3ModHandle,1298 PICKBTN_FRAME, GetPString(IDS_EDITTEXT));1346 id = 1347 (USHORT) WinDlgBox(HWND_DESKTOP, hwnd, PickToolProc, FM3ModHandle, 1348 PICKBTN_FRAME, GetPString(IDS_EDITTEXT)); 1299 1349 if (id) { 1300 tool = find_tool(id);1301 if (tool) {1302 if (WinDlgBox(HWND_DESKTOP, hwnd, AddToolProc, FM3ModHandle,1303 ADDBTN_FRAME, (PVOID) tool))1304 WinSendMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd,1305 QW_PARENT),1306 QW_PARENT), FID_CLIENT),1307 WM_COMMAND, MPFROM2SHORT(IDM_CREATETOOL, 0),1308 MPFROM2SHORT(id, 0));1309 }1350 tool = find_tool(id); 1351 if (tool) { 1352 if (WinDlgBox(HWND_DESKTOP, hwnd, AddToolProc, FM3ModHandle, 1353 ADDBTN_FRAME, (PVOID) tool)) 1354 WinSendMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd, 1355 QW_PARENT), 1356 QW_PARENT), FID_CLIENT), 1357 WM_COMMAND, MPFROM2SHORT(IDM_CREATETOOL, 0), 1358 MPFROM2SHORT(id, 0)); 1359 } 1310 1360 } 1311 1361 break; … … 1313 1363 case IDM_ADDTOOL: /* add tool */ 1314 1364 id = (USHORT) WinDlgBox(HWND_DESKTOP, hwnd, AddToolProc, FM3ModHandle, 1315 ADDBTN_FRAME, MPVOID);1365 ADDBTN_FRAME, MPVOID); 1316 1366 if (id && id != (USHORT) - 1) 1317 WinSendMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd,1318 QW_PARENT),1319 QW_PARENT), FID_CLIENT),1320 WM_COMMAND, MPFROM2SHORT(IDM_CREATETOOL, 0),1321 MPFROM2SHORT(id, 0));1367 WinSendMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd, 1368 QW_PARENT), 1369 QW_PARENT), FID_CLIENT), 1370 WM_COMMAND, MPFROM2SHORT(IDM_CREATETOOL, 0), 1371 MPFROM2SHORT(id, 0)); 1322 1372 break; 1323 1373 1324 1374 case IDM_REORDERTOOLS: /* reorder tools */ 1325 1375 WinDlgBox(HWND_DESKTOP, 1326 hwnd, ReOrderToolsProc, FM3ModHandle, RE_FRAME, MPVOID);1376 hwnd, ReOrderToolsProc, FM3ModHandle, RE_FRAME, MPVOID); 1327 1377 break; 1328 1378 … … 1330 1380 case IDM_LOADTOOLS: 1331 1381 if (WinDlgBox(HWND_DESKTOP, 1332 hwnd,1333 ToolIODlgProc,1334 FM3ModHandle,1335 SVBTN_FRAME,1336 (PVOID) (SHORT1FROMMP(mp1) == IDM_SAVETOOLS) ?1337 "TRUE" : NULL))1382 hwnd, 1383 ToolIODlgProc, 1384 FM3ModHandle, 1385 SVBTN_FRAME, 1386 (PVOID) (SHORT1FROMMP(mp1) == IDM_SAVETOOLS) ? 1387 "TRUE" : NULL)) 1338 1388 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID); 1339 1389 break; … … 1368 1418 tool = find_tool(id); 1369 1419 if (!tool) { 1370 DrgFreeDraginfo(pDInfo);1371 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); /* Drop not valid */1420 DrgFreeDraginfo(pDInfo); 1421 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); /* Drop not valid */ 1372 1422 } 1373 1423 if (!(tool->flags & T_DROPABLE)) { 1374 DrgFreeDraginfo(pDInfo);1375 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); /* Drop not valid */1424 DrgFreeDraginfo(pDInfo); 1425 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); /* Drop not valid */ 1376 1426 } 1377 1427 { 1378 PDRAGITEM pDItem; /* Pointer to DRAGITEM */1379 1380 pDItem = DrgQueryDragitemPtr(pDInfo, /* Access DRAGITEM */1381 0); /* Index to DRAGITEM */1382 if (DrgVerifyRMF(pDItem, /* Check valid rendering */1383 DRM_OS2FILE, /* mechanisms and data */1384 NULL)) { /* formats */1385 if (!(tool->flags & T_EMPHASIZED)) {1386 tool->flags |= T_EMPHASIZED;1387 DrawTargetEmphasis(hwnd, ((tool->flags & T_EMPHASIZED) != 0));1388 DrgFreeDraginfo(pDInfo);1389 }1390 return (MRFROM2SHORT(DOR_DROP, /* Return okay to drop */1391 DO_MOVE)); /* Move operation valid */1392 }1393 DrgFreeDraginfo(pDInfo);1428 PDRAGITEM pDItem; /* Pointer to DRAGITEM */ 1429 1430 pDItem = DrgQueryDragitemPtr(pDInfo, /* Access DRAGITEM */ 1431 0); /* Index to DRAGITEM */ 1432 if (DrgVerifyRMF(pDItem, /* Check valid rendering */ 1433 DRM_OS2FILE, /* mechanisms and data */ 1434 NULL)) { /* formats */ 1435 if (!(tool->flags & T_EMPHASIZED)) { 1436 tool->flags |= T_EMPHASIZED; 1437 DrawTargetEmphasis(hwnd, ((tool->flags & T_EMPHASIZED) != 0)); 1438 DrgFreeDraginfo(pDInfo); 1439 } 1440 return (MRFROM2SHORT(DOR_DROP, /* Return okay to drop */ 1441 DO_MOVE)); /* Move operation valid */ 1442 } 1443 DrgFreeDraginfo(pDInfo); 1394 1444 } 1395 1445 } … … 1408 1458 if (tool && (tool->flags & T_DROPABLE)) { 1409 1459 if (tool->flags & T_EMPHASIZED) { 1410 tool->flags &= (~T_EMPHASIZED);1411 DrawTargetEmphasis(hwnd, ((tool->flags & T_EMPHASIZED) != 0));1460 tool->flags &= (~T_EMPHASIZED); 1461 DrawTargetEmphasis(hwnd, ((tool->flags & T_EMPHASIZED) != 0)); 1412 1462 } 1413 1463 } … … 1422 1472 1423 1473 if (tool->flags & T_EMPHASIZED) { 1424 DrawTargetEmphasis(hwnd, ((tool->flags & T_EMPHASIZED) != 0));1425 tool->flags &= (~T_EMPHASIZED);1474 DrawTargetEmphasis(hwnd, ((tool->flags & T_EMPHASIZED) != 0)); 1475 tool->flags &= (~T_EMPHASIZED); 1426 1476 } 1427 1477 memset(&cdi, 0, sizeof(cdi)); … … 1430 1480 CheckPmDrgLimit(cdi.pDragInfo); 1431 1481 if (li) { 1432 li->type = id;1433 if (!li->list || !li->list[0])1434 FreeListInfo(li);1435 else {1436 HWND hwndActive;1437 1438 hwndActive = TopWindow(hwndMain, (HWND) 0);1439 if (hwndActive) {1440 if (!WinSendMsg(hwndActive, UM_COMMAND, MPFROMP(li), MPVOID))1441 FreeListInfo(li);1442 }1443 else1444 FreeListInfo(li);1445 }1482 li->type = id; 1483 if (!li->list || !li->list[0]) 1484 FreeListInfo(li); 1485 else { 1486 HWND hwndActive; 1487 1488 hwndActive = TopWindow(hwndMain, (HWND) 0); 1489 if (hwndActive) { 1490 if (!WinSendMsg(hwndActive, UM_COMMAND, MPFROMP(li), MPVOID)) 1491 FreeListInfo(li); 1492 } 1493 else 1494 FreeListInfo(li); 1495 } 1446 1496 } 1447 1497 } … … 1481 1531 if (!fTextTools) { 1482 1532 if (!(tool->flags & T_MYICON)) { 1483 hwndTool = WinCreateWindow(hwndT,1484 WC_TOOLBUTTONS,1485 s,1486 BS_NOPOINTERFOCUS |1487 BS_BITMAP | BS_PUSHBUTTON,1488 ctrlxpos,1489 14,1490 32,1491 32, hwndT, HWND_TOP, tool->id, NULL, NULL);1533 hwndTool = WinCreateWindow(hwndT, 1534 WC_TOOLBUTTONS, 1535 s, 1536 BS_NOPOINTERFOCUS | 1537 BS_BITMAP | BS_PUSHBUTTON, 1538 ctrlxpos, 1539 14, 1540 32, 1541 32, hwndT, HWND_TOP, tool->id, NULL, NULL); 1492 1542 } 1493 1543 if (!hwndTool) { 1494 HBITMAP hbm = LoadBitmapFromFileNum(tool->id);1495 1496 if (hbm) {1497 BTNCDATA btc;1498 1499 memset(&btc, 0, sizeof(btc));1500 btc.cb = sizeof(btc);1501 btc.hImage = hbm;1502 hwndTool = WinCreateWindow(hwndT,1503 WC_TOOLBUTTONS,1504 NullStr,1505 BS_NOPOINTERFOCUS |1506 BS_BITMAP | BS_PUSHBUTTON,1507 ctrlxpos,1508 14,1509 32,1510 32,1511 hwndT, HWND_TOP, tool->id, &btc, NULL);1512 if (!hwndTool)1513 GpiDeleteBitmap(hbm);1514 }1544 HBITMAP hbm = LoadBitmapFromFileNum(tool->id); 1545 1546 if (hbm) { 1547 BTNCDATA btc; 1548 1549 memset(&btc, 0, sizeof(btc)); 1550 btc.cb = sizeof(btc); 1551 btc.hImage = hbm; 1552 hwndTool = WinCreateWindow(hwndT, 1553 WC_TOOLBUTTONS, 1554 NullStr, 1555 BS_NOPOINTERFOCUS | 1556 BS_BITMAP | BS_PUSHBUTTON, 1557 ctrlxpos, 1558 14, 1559 32, 1560 32, 1561 hwndT, HWND_TOP, tool->id, &btc, NULL); 1562 if (!hwndTool) 1563 GpiDeleteBitmap(hbm); 1564 } 1515 1565 } 1516 1566 if (hwndTool) 1517 tool->flags &= (~T_TEXT);1567 tool->flags &= (~T_TEXT); 1518 1568 } 1519 1569 if (!hwndTool) { 1520 1570 hwndTool = WinCreateWindow(hwndT, 1521 WC_TOOLBUTTONS,1522 (!tool->text && tool->id >= IDM_COMMANDSTART1523 && tool->id <1524 IDM_QUICKTOOLSTART) ? command_title(tool->1525 id -1526 IDM_COMMANDSTART)1527 : tool->text,1528 BS_NOPOINTERFOCUS | BS_PUSHBUTTON, ctrlxpos,1529 2, 54, 24, hwndT, HWND_TOP, tool->id, NULL,1530 NULL);1571 WC_TOOLBUTTONS, 1572 (!tool->text && tool->id >= IDM_COMMANDSTART 1573 && tool->id < 1574 IDM_QUICKTOOLSTART) ? command_title(tool-> 1575 id - 1576 IDM_COMMANDSTART) 1577 : tool->text, 1578 BS_NOPOINTERFOCUS | BS_PUSHBUTTON, ctrlxpos, 1579 2, 54, 24, hwndT, HWND_TOP, tool->id, NULL, 1580 NULL); 1531 1581 if (!hwndTool) 1532 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,1533 IDS_WINCREATEWINDOW);1582 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 1583 IDS_WINCREATEWINDOW); 1534 1584 tool->flags |= T_TEXT; 1535 1585 } 1536 1586 if (fToolTitles && !fTextTools) { 1537 1587 hwndTool = WinCreateWindow(hwndT, 1538 WC_STATIC,1539 tool->text,1540 SS_TEXT | DT_LEFT | DT_VCENTER,1541 ctrlxpos,1542 1,1543 32,1544 10,1545 hwndT,1546 HWND_TOP, tool->id + 25000, NULL, NULL);1588 WC_STATIC, 1589 tool->text, 1590 SS_TEXT | DT_LEFT | DT_VCENTER, 1591 ctrlxpos, 1592 1, 1593 32, 1594 10, 1595 hwndT, 1596 HWND_TOP, tool->id + 25000, NULL, NULL); 1547 1597 if (!hwndTool) 1548 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,1549 IDS_WINCREATEWINDOW);1598 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 1599 IDS_WINCREATEWINDOW); 1550 1600 else { 1551 SetPresParams(hwndTool,1552 &RGBGREY,1553 &RGBBLACK, &RGBGREY, GetPString(IDS_2SYSTEMVIOTEXT));1601 SetPresParams(hwndTool, 1602 &RGBGREY, 1603 &RGBBLACK, &RGBGREY, GetPString(IDS_2SYSTEMVIOTEXT)); 1554 1604 } 1555 1605 } 1556 1606 ctrlxpos += ((tool->flags & T_TEXT) ? 55L : 33L); 1557 1607 SetPresParams(WinWindowFromID(hwndT, tool->id), 1558 NULL, NULL, NULL, GetPString(IDS_8HELVTEXT));1608 NULL, NULL, NULL, GetPString(IDS_8HELVTEXT)); 1559 1609 tool = tool->next; 1560 1610 } // while tool 1561 1611 1562 1612 hwndTool = WinCreateWindow(hwndT, 1563 WC_BUTTON,1564 "#6010",1565 BS_NOPOINTERFOCUS |1566 BS_BITMAP | BS_PUSHBUTTON,1567 1,1568 19,1569 14,1570 13, hwndT, HWND_TOP, IDM_TOOLLEFT, NULL, NULL);1613 WC_BUTTON, 1614 "#6010", 1615 BS_NOPOINTERFOCUS | 1616 BS_BITMAP | BS_PUSHBUTTON, 1617 1, 1618 19, 1619 14, 1620 13, hwndT, HWND_TOP, IDM_TOOLLEFT, NULL, NULL); 1571 1621 if (!hwndTool) 1572 1622 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 1573 IDS_WINCREATEWINDOW);1623 IDS_WINCREATEWINDOW); 1574 1624 hwndTool = 1575 1625 WinCreateWindow(hwndT, WC_BUTTON, "#6011", 1576 BS_NOPOINTERFOCUS | BS_BITMAP | BS_PUSHBUTTON, 1, 4, 14,1577 13, hwndT, HWND_TOP, IDM_TOOLRIGHT, NULL, NULL);1626 BS_NOPOINTERFOCUS | BS_BITMAP | BS_PUSHBUTTON, 1, 4, 14, 1627 13, hwndT, HWND_TOP, IDM_TOOLRIGHT, NULL, NULL); 1578 1628 if (!hwndTool) 1579 1629 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 1580 IDS_WINCREATEWINDOW);1630 IDS_WINCREATEWINDOW); 1581 1631 if (resize) 1582 1632 ResizeTools(hwndT); … … 1584 1634 1585 1635 static MRESULT EXPENTRY CommandLineProc(HWND hwnd, ULONG msg, MPARAM mp1, 1586 MPARAM mp2)1636 MPARAM mp2) 1587 1637 { 1588 1638 PFNWP oldproc = (PFNWP) WinQueryWindowPtr(hwnd, QWL_USER); … … 1601 1651 1602 1652 if (WinQueryWindowUShort((HWND) mp1, QWS_ID) == COMMAND_BUTTON) 1603 break;1653 break; 1604 1654 if (!WinQueryWindowProcess((HWND) mp1, &pid, &tid) || pid == mypid) 1605 WinDestroyWindow(hwnd);1655 WinDestroyWindow(hwnd); 1606 1656 } 1607 1657 break; … … 1613 1663 pszCmdLine = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__); 1614 1664 if (pszCmdLine) { 1615 lbup = TRUE;1616 if (WinDlgBox(HWND_DESKTOP,1617 hwnd,1618 CmdLine2DlgProc,1619 FM3ModHandle, EXEC2_FRAME, MPFROMP(pszCmdLine))) {1620 lstrip(pszCmdLine);1621 WinSetWindowText(hwnd, pszCmdLine);1622 }1623 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID);1624 PostMsg(hwnd, UM_SETUP, MPVOID, MPVOID);1625 free(pszCmdLine);1665 lbup = TRUE; 1666 if (WinDlgBox(HWND_DESKTOP, 1667 hwnd, 1668 CmdLine2DlgProc, 1669 FM3ModHandle, EXEC2_FRAME, MPFROMP(pszCmdLine))) { 1670 lstrip(pszCmdLine); 1671 WinSetWindowText(hwnd, pszCmdLine); 1672 } 1673 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID); 1674 PostMsg(hwnd, UM_SETUP, MPVOID, MPVOID); 1675 free(pszCmdLine); 1626 1676 } 1627 1677 } … … 1640 1690 case COMMAND_BUTTON: 1641 1691 if (!lbup) 1642 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);1692 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 1643 1693 break; 1644 1694 } … … 1659 1709 bstrip(cl + len); 1660 1710 if (strlen(cl) > len) { 1661 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT),1662 UM_SETUP, MPFROMP(cl + len), MPVOID);1663 WinQueryWindowText(hwndStatus, CCHMAXPATH, directory);1664 bstrip(directory);1665 if (*directory && (IsRoot(directory) || !IsFile(directory))) {1666 if (!FM2Command(directory, cl + len)) {1667 hwndCnr = TopWindow(hwndMain, (HWND) 0);1668 if (hwndCnr) {1669 hwndCnr = WinWindowFromID(hwndCnr, FID_CLIENT);1670 if (hwndCnr) {1671 hwndCnr = WinWindowFromID(hwndCnr, DIR_CNR);1672 if (hwndCnr)1673 list = BuildList(hwndCnr);1674 }1675 }1676 WinSetActiveWindow(HWND_DESKTOP, hwndCnr);1677 if (add_cmdline(cl + len, FALSE) && fSaveMiniCmds)1678 save_cmdlines(FALSE);1679 ExecOnList(hwndCnr,1680 cl,1681 WINDOWED | ((fKeepCmdLine) ?1682 SEPARATEKEEP : SEPARATE),1683 directory, list, NULL, pszSrcFile, __LINE__);1684 xfree(list, pszSrcFile, __LINE__);1685 WinDestroyWindow(hwnd);1686 break;1687 }1688 }1711 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), 1712 UM_SETUP, MPFROMP(cl + len), MPVOID); 1713 WinQueryWindowText(hwndStatus, CCHMAXPATH, directory); 1714 bstrip(directory); 1715 if (*directory && (IsRoot(directory) || !IsFile(directory))) { 1716 if (!FM2Command(directory, cl + len)) { 1717 hwndCnr = TopWindow(hwndMain, (HWND) 0); 1718 if (hwndCnr) { 1719 hwndCnr = WinWindowFromID(hwndCnr, FID_CLIENT); 1720 if (hwndCnr) { 1721 hwndCnr = WinWindowFromID(hwndCnr, DIR_CNR); 1722 if (hwndCnr) 1723 list = BuildList(hwndCnr); 1724 } 1725 } 1726 WinSetActiveWindow(HWND_DESKTOP, hwndCnr); 1727 if (add_cmdline(cl + len, FALSE) && fSaveMiniCmds) 1728 save_cmdlines(FALSE); 1729 ExecOnList(hwndCnr, 1730 cl, 1731 WINDOWED | ((fKeepCmdLine) ? 1732 SEPARATEKEEP : SEPARATE), 1733 directory, list, NULL, pszSrcFile, __LINE__); 1734 xfree(list, pszSrcFile, __LINE__); 1735 WinDestroyWindow(hwnd); 1736 break; 1737 } 1738 } 1689 1739 } 1690 1740 WinSendMsg(hwnd, EM_SETSEL, MPFROM2SHORT(0, 1024), MPVOID); … … 1695 1745 if (!lbup && !(SHORT1FROMMP(mp1) & KC_KEYUP)) { 1696 1746 if (SHORT1FROMMP(mp1) & KC_VIRTUALKEY) { 1697 if ((SHORT1FROMMP(mp2) & 255) == '\r')1698 PostMsg(hwnd, UM_OPENWINDOWFORME, MPVOID, MPVOID);1699 else if ((SHORT1FROMMP(mp2) & 0xff) == 0x1b)1700 WinDestroyWindow(hwnd);1701 else if (SHORT2FROMMP(mp2) == VK_UP || SHORT2FROMMP(mp2) == VK_DOWN)1702 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);1747 if ((SHORT1FROMMP(mp2) & 255) == '\r') 1748 PostMsg(hwnd, UM_OPENWINDOWFORME, MPVOID, MPVOID); 1749 else if ((SHORT1FROMMP(mp2) & 0xff) == 0x1b) 1750 WinDestroyWindow(hwnd); 1751 else if (SHORT2FROMMP(mp2) == VK_UP || SHORT2FROMMP(mp2) == VK_DOWN) 1752 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 1703 1753 } 1704 1754 } 1705 1755 else if ((SHORT1FROMMP(mp1) & KC_VIRTUALKEY) && 1706 ((SHORT2FROMMP(mp2) == VK_UP ||1707 SHORT2FROMMP(mp2) == VK_DOWN) ||1708 (SHORT1FROMMP(mp2) == '\x1b') || (SHORT1FROMMP(mp2) == '\r')))1756 ((SHORT2FROMMP(mp2) == VK_UP || 1757 SHORT2FROMMP(mp2) == VK_DOWN) || 1758 (SHORT1FROMMP(mp2) == '\x1b') || (SHORT1FROMMP(mp2) == '\r'))) 1709 1759 return 0; 1710 1760 break; … … 1732 1782 rgb.bRed = (BYTE)128; 1733 1783 SetPresParams(hwnd, 1734 &RGBGREY, &rgb, &RGBGREY, GetPString(IDS_8HELVTEXT));1784 &RGBGREY, &rgb, &RGBGREY, GetPString(IDS_8HELVTEXT)); 1735 1785 SetTargetDir(hwnd, TRUE); 1736 1786 } … … 1762 1812 case WM_CONTROLPOINTER: 1763 1813 if (!fNoFinger && 1764 (SHORT1FROMMP(mp1) >= IDM_DRIVEA &&1765 SHORT1FROMMP(mp1) < IDM_DRIVEA + 26))1814 (SHORT1FROMMP(mp1) >= IDM_DRIVEA && 1815 SHORT1FROMMP(mp1) < IDM_DRIVEA + 26)) 1766 1816 return MRFROMLONG(hptrFinger); 1767 1817 break; … … 1773 1823 *dv = 0; 1774 1824 WinQueryWindowText(WinWindowFromID(hwnd, SHORT1FROMMP(mp1) + 50), 1775 2, dv);1825 2, dv); 1776 1826 if (isalpha(*dv)) { 1777 1827 1778 HWND hwndActive;1779 1780 dv[1] = ':';1781 dv[2] = '\\';1782 dv[3] = 0;1783 hwndActive = TopWindow(hwnd, (HWND) 0);1784 if (hwndActive)1785 WinSendMsg(WinWindowFromID(hwndActive, FID_CLIENT),1786 UM_DRIVECMD, MPFROMP(dv), MPVOID);1828 HWND hwndActive; 1829 1830 dv[1] = ':'; 1831 dv[2] = '\\'; 1832 dv[3] = 0; 1833 hwndActive = TopWindow(hwnd, (HWND) 0); 1834 if (hwndActive) 1835 WinSendMsg(WinWindowFromID(hwndActive, FID_CLIENT), 1836 UM_DRIVECMD, MPFROMP(dv), MPVOID); 1787 1837 } 1788 1838 } … … 1812 1862 case WM_MOUSEMOVE: 1813 1863 if (fDrivebarHelp && 1814 (!hwndBubble ||1815 WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) &&1816 !WinQueryCapture(HWND_DESKTOP)) {1864 (!hwndBubble || 1865 WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) && 1866 !WinQueryCapture(HWND_DESKTOP)) { 1817 1867 id = WinQueryWindowUShort(hwnd, QWS_ID); 1818 1868 if (helpid != id) { 1819 helpid = id;1820 PostMsg(MainObjectHwnd, UM_SETUP6, MPFROMLONG((ULONG) hwnd), MPVOID);1869 helpid = id; 1870 PostMsg(MainObjectHwnd, UM_SETUP6, MPFROMLONG((ULONG) hwnd), MPVOID); 1821 1871 } 1822 1872 else 1823 helpid = 0;1873 helpid = 0; 1824 1874 } 1825 1875 break; … … 1828 1878 if (helpid == WinQueryWindowUShort(hwnd, QWS_ID)) { 1829 1879 if ((char *)mp1 && 1830 (!hwndBubble ||1831 WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) &&1832 !WinQueryCapture(HWND_DESKTOP)) {1833 1834 RECTL rcl;1835 POINTL ptl;1836 1837 WinQueryPointerPos(HWND_DESKTOP, &ptl);1838 WinMapWindowPoints(HWND_DESKTOP, hwnd, &ptl, 1);1839 WinQueryWindowRect(hwnd, &rcl);1840 if (WinPtInRect(WinQueryAnchorBlock(hwnd), &rcl, &ptl))1841 BubbleHelp(hwnd, FALSE, TRUE, FALSE, (char *)mp1);1880 (!hwndBubble || 1881 WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) && 1882 !WinQueryCapture(HWND_DESKTOP)) { 1883 1884 RECTL rcl; 1885 POINTL ptl; 1886 1887 WinQueryPointerPos(HWND_DESKTOP, &ptl); 1888 WinMapWindowPoints(HWND_DESKTOP, hwnd, &ptl, 1); 1889 WinQueryWindowRect(hwnd, &rcl); 1890 if (WinPtInRect(WinQueryAnchorBlock(hwnd), &rcl, &ptl)) 1891 BubbleHelp(hwnd, FALSE, TRUE, FALSE, (char *)mp1); 1842 1892 } 1843 1893 } … … 1858 1908 *szDrv = 0; 1859 1909 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1860 id + 50), sizeof(szDrv), szDrv);1910 id + 50), sizeof(szDrv), szDrv); 1861 1911 if (isalpha(*szDrv)) { 1862 1912 hwndMenu = WinLoadMenu(HWND_DESKTOP, FM3ModHandle, MAIN_DRIVES); 1863 1913 if (hwndMenu) { 1864 BOOL rdy;1865 CHAR chDrv = *szDrv;1866 UINT iDrv;1867 1868 strcpy(szDrv + 2, "\\");1869 MakeValidDir(szDrv);1870 // Disable menus if MakeValidDir changes drive letter fixme this section doesn't do anything see treecnt.c1871 rdy = toupper(*szDrv) == toupper(chDrv);1872 iDrv = toupper(*szDrv) - 'A';1873 if (!rdy || ~driveflags[iDrv] & DRIVE_REMOTE)1874 WinEnableMenuItem(hwndMenu, IDM_DETACH, FALSE);1875 1876 if (!rdy || driveflags[iDrv] & DRIVE_NOTWRITEABLE) {1877 WinEnableMenuItem(hwndMenu, IDM_MKDIR, FALSE);1878 WinEnableMenuItem(hwndMenu, IDM_FORMAT, FALSE);1879 WinEnableMenuItem(hwndMenu, IDM_OPTIMIZE, FALSE);1880 WinEnableMenuItem(hwndMenu, IDM_UNDELETE, FALSE);1881 }1882 if (!rdy || ~driveflags[iDrv] & DRIVE_REMOVABLE) {1883 WinEnableMenuItem(hwndMenu, IDM_EJECT, FALSE);1884 WinEnableMenuItem(hwndMenu, IDM_LOCK, FALSE);1885 WinEnableMenuItem(hwndMenu, IDM_UNLOCK, FALSE);1886 }1887 if (!rdy) {1888 WinEnableMenuItem(hwndMenu, IDM_INFO, FALSE);1889 WinEnableMenuItem(hwndMenu, IDM_ARCHIVE, FALSE);1890 WinEnableMenuItem(hwndMenu, IDM_SIZES, FALSE);1891 WinEnableMenuItem(hwndMenu, IDM_SHOWALLFILES, FALSE);1892 WinEnableMenuItem(hwndMenu, IDM_CHKDSK, FALSE);1893 }1894 /* fixme to be gone?1895 if (!rdy || ~driveflags[iDrv] & DRIVE_CDROM) {1896 WinEnableMenuItem(hwndMenu, IDM_CLOSETRAY, FALSE);1897 }1898 */1899 PopupMenu(hwnd, hwnd, hwndMenu);1914 BOOL rdy; 1915 CHAR chDrv = *szDrv; 1916 UINT iDrv; 1917 1918 strcpy(szDrv + 2, "\\"); 1919 MakeValidDir(szDrv); 1920 // Disable menus if MakeValidDir changes drive letter fixme this section doesn't do anything see treecnt.c 1921 rdy = toupper(*szDrv) == toupper(chDrv); 1922 iDrv = toupper(*szDrv) - 'A'; 1923 if (!rdy || ~driveflags[iDrv] & DRIVE_REMOTE) 1924 WinEnableMenuItem(hwndMenu, IDM_DETACH, FALSE); 1925 1926 if (!rdy || driveflags[iDrv] & DRIVE_NOTWRITEABLE) { 1927 WinEnableMenuItem(hwndMenu, IDM_MKDIR, FALSE); 1928 WinEnableMenuItem(hwndMenu, IDM_FORMAT, FALSE); 1929 WinEnableMenuItem(hwndMenu, IDM_OPTIMIZE, FALSE); 1930 WinEnableMenuItem(hwndMenu, IDM_UNDELETE, FALSE); 1931 } 1932 if (!rdy || ~driveflags[iDrv] & DRIVE_REMOVABLE) { 1933 WinEnableMenuItem(hwndMenu, IDM_EJECT, FALSE); 1934 WinEnableMenuItem(hwndMenu, IDM_LOCK, FALSE); 1935 WinEnableMenuItem(hwndMenu, IDM_UNLOCK, FALSE); 1936 } 1937 if (!rdy) { 1938 WinEnableMenuItem(hwndMenu, IDM_INFO, FALSE); 1939 WinEnableMenuItem(hwndMenu, IDM_ARCHIVE, FALSE); 1940 WinEnableMenuItem(hwndMenu, IDM_SIZES, FALSE); 1941 WinEnableMenuItem(hwndMenu, IDM_SHOWALLFILES, FALSE); 1942 WinEnableMenuItem(hwndMenu, IDM_CHKDSK, FALSE); 1943 } 1944 /* fixme to be gone? 1945 if (!rdy || ~driveflags[iDrv] & DRIVE_CDROM) { 1946 WinEnableMenuItem(hwndMenu, IDM_CLOSETRAY, FALSE); 1947 } 1948 */ 1949 PopupMenu(hwnd, hwnd, hwndMenu); 1900 1950 } 1901 1951 } … … 1912 1962 *szDrv = 0; 1913 1963 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1914 id + 50), sizeof(szDrv), szDrv);1964 id + 50), sizeof(szDrv), szDrv); 1915 1965 if (isalpha(*szDrv)) { 1916 1966 strcat(szDrv, "\\"); 1917 1967 if (!FindDirCnrByName(szDrv, TRUE)) 1918 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, szDrv);1968 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, szDrv); 1919 1969 } 1920 1970 break; … … 1928 1978 *szDrv = 0; 1929 1979 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1930 id + 50), sizeof(szDrv), szDrv);1980 id + 50), sizeof(szDrv), szDrv); 1931 1981 if (isalpha(*szDrv)) { 1932 1982 strcat(szDrv, "\\"); … … 1939 1989 *szDrv = 0; 1940 1990 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1941 id + 50), sizeof(szDrv), szDrv);1991 id + 50), sizeof(szDrv), szDrv); 1942 1992 if (isalpha(*szDrv) && 1943 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) {1993 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) { 1944 1994 if (!emphasized) { 1945 emphasized = TRUE;1946 DrawTargetEmphasis(hwnd, emphasized);1995 emphasized = TRUE; 1996 DrawTargetEmphasis(hwnd, emphasized); 1947 1997 } 1948 1998 if (AcceptOneDrop(hwnd, mp1, mp2)) 1949 return MRFROM2SHORT(DOR_DROP, DO_MOVE);1999 return MRFROM2SHORT(DOR_DROP, DO_MOVE); 1950 2000 return MRFROM2SHORT(DOR_NEVERDROP, 0); 1951 2001 } … … 1956 2006 *szDrv = 0; 1957 2007 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1958 id + 50), sizeof(szDrv), szDrv);2008 id + 50), sizeof(szDrv), szDrv); 1959 2009 if (isalpha(*szDrv) && 1960 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) {2010 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) { 1961 2011 if (emphasized) { 1962 emphasized = FALSE;1963 DrawTargetEmphasis(hwnd, emphasized);2012 emphasized = FALSE; 2013 DrawTargetEmphasis(hwnd, emphasized); 1964 2014 } 1965 2015 } … … 1970 2020 *szDrv = 0; 1971 2021 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1972 id + 50), sizeof(szDrv), szDrv);2022 id + 50), sizeof(szDrv), szDrv); 1973 2023 if (isalpha(*szDrv) && 1974 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) {2024 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) { 1975 2025 DropHelp(mp1, mp2, hwnd, GetPString(IDS_DRIVEDROPHELP)); 1976 2026 return 0; … … 1982 2032 *szDrv = 0; 1983 2033 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1984 id + 50), sizeof(szDrv), szDrv);2034 id + 50), sizeof(szDrv), szDrv); 1985 2035 if (isalpha(*szDrv) && 1986 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) {2036 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) { 1987 2037 1988 2038 CNRDRAGINFO cnd; … … 1991 2041 1992 2042 if (emphasized) { 1993 emphasized = FALSE;1994 DrawTargetEmphasis(hwnd, emphasized);2043 emphasized = FALSE; 2044 DrawTargetEmphasis(hwnd, emphasized); 1995 2045 } 1996 2046 memset(&cnd, 0, sizeof(cnd)); … … 1998 2048 cnd.pRecord = NULL; 1999 2049 li = DoFileDrop(hwnd, 2000 NULL,2001 TRUE, MPFROM2SHORT(TREE_CNR, CN_DROP), MPFROMP(&cnd));2050 NULL, 2051 TRUE, MPFROM2SHORT(TREE_CNR, CN_DROP), MPFROMP(&cnd)); 2002 2052 CheckPmDrgLimit(cnd.pDragInfo); 2003 2053 if (li) { 2004 strcpy(li->targetpath, szDrv);2005 strcat(li->targetpath, "\\");2006 if (li->list && li->list[0] && IsRoot(li->list[0]))2007 li->type = DO_LINK;2008 else if (fDragndropDlg && (!*li->arcname || !li->info)) {2009 2010 CHECKLIST cl;2011 2012 memset(&cl, 0, sizeof(cl));2013 cl.size = sizeof(cl);2014 cl.flags = li->type;2015 cl.list = li->list;2016 cl.cmd = li->type;2017 cl.prompt = li->targetpath;2018 li->type = WinDlgBox(HWND_DESKTOP,2019 hwndMain,2020 DropListProc,2021 FM3ModHandle, DND_FRAME, MPFROMP(&cl));2022 if (li->type == DID_ERROR)2023 Win_Error(DND_FRAME, HWND_DESKTOP, pszSrcFile, __LINE__,2024 "Drag & Drop Dialog");2025 if (!li->type) {2026 FreeListInfo(li);2027 return 0;2028 }2029 li->list = cl.list;2030 if (!li->list || !li->list[0]) {2031 FreeListInfo(li);2032 return 0;2033 }2034 }2035 else {2036 if (!WinDlgBox(HWND_DESKTOP,2037 hwndMain,2038 WalkDlgProc,2039 FM3ModHandle,2040 WALK_FRAME,2041 MPFROMP(li->targetpath)) || !*li->targetpath) {2042 FreeListInfo(li);2043 return 0;2044 }2045 }2046 switch (li->type) {2047 case DND_LAUNCH:2048 strcat(li->targetpath, " %a");2049 ExecOnList(hwndMain,2050 li->targetpath, PROMPT | WINDOWED, NULL, li->list, NULL,2051 pszSrcFile, __LINE__);2052 FreeList(li->list);2053 li->list = NULL;2054 break;2055 case DO_LINK:2056 if (fLinkSetsIcon) {2057 li->type = IDM_SETICON;2058 action = UM_MASSACTION;2059 }2060 else2061 li->type = IDM_COMPARE;2062 break;2063 case DND_EXTRACT:2064 if (*li->targetpath && !IsFile(li->targetpath))2065 li->type = IDM_EXTRACT;2066 break;2067 case DND_MOVE:2068 li->type = IDM_MOVE;2069 if (*li->targetpath && IsFile(li->targetpath) == 1) {2070 action = UM_MASSACTION;2071 li->type = IDM_ARCHIVEM;2072 }2073 break;2074 case DND_WILDMOVE:2075 li->type = IDM_WILDMOVE;2076 if (*li->targetpath && IsFile(li->targetpath) == 1) {2077 action = UM_MASSACTION;2078 li->type = IDM_ARCHIVEM;2079 }2080 break;2081 case DND_OBJECT:2082 li->type = IDM_OBJECT;2083 action = UM_MASSACTION;2084 break;2085 case DND_SHADOW:2086 li->type = IDM_SHADOW;2087 action = UM_MASSACTION;2088 break;2089 case DND_COMPARE:2090 li->type = IDM_COMPARE;2091 break;2092 case DND_SETICON:2093 action = UM_MASSACTION;2094 li->type = IDM_SETICON;2095 break;2096 case DND_COPY:2097 li->type = IDM_COPY;2098 if (*li->targetpath && IsFile(li->targetpath) == 1) {2099 action = UM_MASSACTION;2100 li->type = IDM_ARCHIVE;2101 }2102 break;2103 case DND_WILDCOPY:2104 li->type = IDM_WILDCOPY;2105 if (*li->targetpath && IsFile(li->targetpath) == 1) {2106 action = UM_MASSACTION;2107 li->type = IDM_ARCHIVE;2108 }2109 break;2110 default:2111 if (*li->arcname && li->info) {2112 action = UM_MASSACTION;2113 li->type = (li->type == DO_MOVE) ? IDM_FAKEEXTRACTM :2114 IDM_FAKEEXTRACT;2115 }2116 else if (*li->targetpath && IsFile(li->targetpath) == 1) {2117 action = UM_MASSACTION;2118 li->type = (li->type == DO_MOVE) ? IDM_ARCHIVEM : IDM_ARCHIVE;2119 }2120 else2121 li->type = (li->type == DO_MOVE) ? IDM_MOVE : IDM_COPY;2122 break;2123 }2124 if (!li->list || !li->list[0])2125 FreeListInfo(li);2126 else2127 WinSendMsg(hwndTree, UM_ACTION, MPFROMP(li), MPFROMLONG(action));2054 strcpy(li->targetpath, szDrv); 2055 strcat(li->targetpath, "\\"); 2056 if (li->list && li->list[0] && IsRoot(li->list[0])) 2057 li->type = DO_LINK; 2058 else if (fDragndropDlg && (!*li->arcname || !li->info)) { 2059 2060 CHECKLIST cl; 2061 2062 memset(&cl, 0, sizeof(cl)); 2063 cl.size = sizeof(cl); 2064 cl.flags = li->type; 2065 cl.list = li->list; 2066 cl.cmd = li->type; 2067 cl.prompt = li->targetpath; 2068 li->type = WinDlgBox(HWND_DESKTOP, 2069 hwndMain, 2070 DropListProc, 2071 FM3ModHandle, DND_FRAME, MPFROMP(&cl)); 2072 if (li->type == DID_ERROR) 2073 Win_Error(DND_FRAME, HWND_DESKTOP, pszSrcFile, __LINE__, 2074 "Drag & Drop Dialog"); 2075 if (!li->type) { 2076 FreeListInfo(li); 2077 return 0; 2078 } 2079 li->list = cl.list; 2080 if (!li->list || !li->list[0]) { 2081 FreeListInfo(li); 2082 return 0; 2083 } 2084 } 2085 else { 2086 if (!WinDlgBox(HWND_DESKTOP, 2087 hwndMain, 2088 WalkDlgProc, 2089 FM3ModHandle, 2090 WALK_FRAME, 2091 MPFROMP(li->targetpath)) || !*li->targetpath) { 2092 FreeListInfo(li); 2093 return 0; 2094 } 2095 } 2096 switch (li->type) { 2097 case DND_LAUNCH: 2098 strcat(li->targetpath, " %a"); 2099 ExecOnList(hwndMain, 2100 li->targetpath, PROMPT | WINDOWED, NULL, li->list, NULL, 2101 pszSrcFile, __LINE__); 2102 FreeList(li->list); 2103 li->list = NULL; 2104 break; 2105 case DO_LINK: 2106 if (fLinkSetsIcon) { 2107 li->type = IDM_SETICON; 2108 action = UM_MASSACTION; 2109 } 2110 else 2111 li->type = IDM_COMPARE; 2112 break; 2113 case DND_EXTRACT: 2114 if (*li->targetpath && !IsFile(li->targetpath)) 2115 li->type = IDM_EXTRACT; 2116 break; 2117 case DND_MOVE: 2118 li->type = IDM_MOVE; 2119 if (*li->targetpath && IsFile(li->targetpath) == 1) { 2120 action = UM_MASSACTION; 2121 li->type = IDM_ARCHIVEM; 2122 } 2123 break; 2124 case DND_WILDMOVE: 2125 li->type = IDM_WILDMOVE; 2126 if (*li->targetpath && IsFile(li->targetpath) == 1) { 2127 action = UM_MASSACTION; 2128 li->type = IDM_ARCHIVEM; 2129 } 2130 break; 2131 case DND_OBJECT: 2132 li->type = IDM_OBJECT; 2133 action = UM_MASSACTION; 2134 break; 2135 case DND_SHADOW: 2136 li->type = IDM_SHADOW; 2137 action = UM_MASSACTION; 2138 break; 2139 case DND_COMPARE: 2140 li->type = IDM_COMPARE; 2141 break; 2142 case DND_SETICON: 2143 action = UM_MASSACTION; 2144 li->type = IDM_SETICON; 2145 break; 2146 case DND_COPY: 2147 li->type = IDM_COPY; 2148 if (*li->targetpath && IsFile(li->targetpath) == 1) { 2149 action = UM_MASSACTION; 2150 li->type = IDM_ARCHIVE; 2151 } 2152 break; 2153 case DND_WILDCOPY: 2154 li->type = IDM_WILDCOPY; 2155 if (*li->targetpath && IsFile(li->targetpath) == 1) { 2156 action = UM_MASSACTION; 2157 li->type = IDM_ARCHIVE; 2158 } 2159 break; 2160 default: 2161 if (*li->arcname && li->info) { 2162 action = UM_MASSACTION; 2163 li->type = (li->type == DO_MOVE) ? IDM_FAKEEXTRACTM : 2164 IDM_FAKEEXTRACT; 2165 } 2166 else if (*li->targetpath && IsFile(li->targetpath) == 1) { 2167 action = UM_MASSACTION; 2168 li->type = (li->type == DO_MOVE) ? IDM_ARCHIVEM : IDM_ARCHIVE; 2169 } 2170 else 2171 li->type = (li->type == DO_MOVE) ? IDM_MOVE : IDM_COPY; 2172 break; 2173 } 2174 if (!li->list || !li->list[0]) 2175 FreeListInfo(li); 2176 else 2177 WinSendMsg(hwndTree, UM_ACTION, MPFROMP(li), MPFROMLONG(action)); 2128 2178 } 2129 2179 return 0; … … 2159 2209 for (x = 0; x < 26; x++) { 2160 2210 if ((ulDriveMap & (1L << x)) && !(driveflags[x] & DRIVE_IGNORE)) { 2161 if (x > 1) {2162 if (driveflags[x] & DRIVE_CDROM)2163 iconid = CDROM_ICON;2164 else2165 iconid = (driveflags[x] & DRIVE_REMOVABLE) ?2166 REMOVABLE_ICON :2167 (driveflags[x] & DRIVE_VIRTUAL) ?2168 VIRTUAL_ICON :2169 (driveflags[x] & DRIVE_REMOTE) ?2170 REMOTE_ICON :2171 (driveflags[x] & DRIVE_RAMDISK) ?2172 RAMDISK_ICON :2173 (driveflags[x] & DRIVE_ZIPSTREAM) ?2174 ZIPSTREAM_ICON :DRIVE_ICON;2175 }2176 else2177 iconid = FLOPPY_ICON;2178 sprintf(s, "#%lu", iconid);2179 hwndB = WinCreateWindow(hwndT,2180 WC_DRIVEBUTTONS,2181 s,2182 BS_NOPOINTERFOCUS | BS_BITMAP | BS_PUSHBUTTON,2183 0,2184 0,2185 28,2186 18,2187 hwndT, HWND_TOP, y + IDM_DRIVEA, NULL, NULL);2188 if (!hwndB)2189 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,2190 IDS_WINCREATEWINDOW);2191 else {2192 WinSetWindowPos(hwndB, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER);2193 sprintf(s, "%c:", (CHAR) x + 'A');2194 hwndB = WinCreateWindow(hwndT,2195 WC_STATIC,2196 s,2197 SS_TEXT | DT_LEFT | DT_VCENTER,2198 0,2199 0,2200 10,2201 18,2202 hwndT,2203 HWND_TOP, y + IDM_DRIVEATEXT, NULL, NULL);2204 if (!hwndB)2205 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,2206 IDS_WINCREATEWINDOW);2207 else {2208 SetPresParams(hwndB,2209 &RGBGREY,2210 &RGBBLACK, &RGBGREY, GetPString(IDS_6HELVTEXT));2211 WinSetWindowPos(hwndB, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER);2212 }2213 y++;2214 }2211 if (x > 1) { 2212 if (driveflags[x] & DRIVE_CDROM) 2213 iconid = CDROM_ICON; 2214 else 2215 iconid = (driveflags[x] & DRIVE_REMOVABLE) ? 2216 REMOVABLE_ICON : 2217 (driveflags[x] & DRIVE_VIRTUAL) ? 2218 VIRTUAL_ICON : 2219 (driveflags[x] & DRIVE_REMOTE) ? 2220 REMOTE_ICON : 2221 (driveflags[x] & DRIVE_RAMDISK) ? 2222 RAMDISK_ICON : 2223 (driveflags[x] & DRIVE_ZIPSTREAM) ? 2224 ZIPSTREAM_ICON :DRIVE_ICON; 2225 } 2226 else 2227 iconid = FLOPPY_ICON; 2228 sprintf(s, "#%lu", iconid); 2229 hwndB = WinCreateWindow(hwndT, 2230 WC_DRIVEBUTTONS, 2231 s, 2232 BS_NOPOINTERFOCUS | BS_BITMAP | BS_PUSHBUTTON, 2233 0, 2234 0, 2235 28, 2236 18, 2237 hwndT, HWND_TOP, y + IDM_DRIVEA, NULL, NULL); 2238 if (!hwndB) 2239 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 2240 IDS_WINCREATEWINDOW); 2241 else { 2242 WinSetWindowPos(hwndB, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER); 2243 sprintf(s, "%c:", (CHAR) x + 'A'); 2244 hwndB = WinCreateWindow(hwndT, 2245 WC_STATIC, 2246 s, 2247 SS_TEXT | DT_LEFT | DT_VCENTER, 2248 0, 2249 0, 2250 10, 2251 18, 2252 hwndT, 2253 HWND_TOP, y + IDM_DRIVEATEXT, NULL, NULL); 2254 if (!hwndB) 2255 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 2256 IDS_WINCREATEWINDOW); 2257 else { 2258 SetPresParams(hwndB, 2259 &RGBGREY, 2260 &RGBBLACK, &RGBGREY, GetPString(IDS_6HELVTEXT)); 2261 WinSetWindowPos(hwndB, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER); 2262 } 2263 y++; 2264 } 2215 2265 } 2216 2266 } // for 2217 2267 } // if drivebar 2218 2268 PostMsg(WinQueryWindow(hwndT, QW_PARENT), 2219 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID);2269 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 2220 2270 } 2221 2271 … … 2233 2283 WinQueryWindowRect(hwndT, &rcl); 2234 2284 xwidth = rcl.xRight - ((WinQuerySysValue(HWND_DESKTOP, 2235 SV_CYSIZEBORDER) * 2) + 2);2285 SV_CYSIZEBORDER) * 2) + 2); 2236 2286 } 2237 2287 henum = WinBeginEnumWindows(hwndT); … … 2242 2292 ctrlxsize = 28; 2243 2293 WinSetWindowPos(hwndB, 2244 HWND_TOP,2245 ctrlxpos, ctrlypos, ctrlxsize, 18, SWP_MOVE | SWP_SHOW);2294 HWND_TOP, 2295 ctrlxpos, ctrlypos, ctrlxsize, 18, SWP_MOVE | SWP_SHOW); 2246 2296 ctrlxpos += (ctrlxsize + 2); 2247 2297 if (ctrlxsize == 10) { 2248 2298 if (ctrlxpos + (42 + ((fShowTarget && DriveLines == 0) ? 2249 256 : 0)) > xwidth) {2250 ctrlxpos = 2;2251 ctrlypos += 18;2252 DriveLines++;2299 256 : 0)) > xwidth) { 2300 ctrlxpos = 2; 2301 ctrlypos += 18; 2302 DriveLines++; 2253 2303 } 2254 2304 } … … 2269 2319 2270 2320 SetPresParams(hwnd, 2271 &RGBGREY,2272 &RGBBLACK, &RGBGREY, GetPString(IDS_8HELVBOLDTEXT));2321 &RGBGREY, 2322 &RGBBLACK, &RGBGREY, GetPString(IDS_8HELVBOLDTEXT)); 2273 2323 return mr; 2274 2324 } … … 2280 2330 2281 2331 cbRetLen = WinQueryPresParam(hwnd, 2282 (ULONG) mp1,2283 0,2284 &AttrFound,2285 (ULONG) sizeof(AttrValue), &AttrValue, 0);2332 (ULONG) mp1, 2333 0, 2334 &AttrFound, 2335 (ULONG) sizeof(AttrValue), &AttrValue, 0); 2286 2336 if (cbRetLen) { 2287 PostMsg(WinQueryWindow(hwnd, QW_PARENT),2288 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID);2337 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 2338 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 2289 2339 } 2290 2340 } … … 2303 2353 WinQueryWindowPos(hwndTree, &swp); 2304 2354 if (!(swp.fl & SWP_MAXIMIZE)) 2305 fl |= SWP_RESTORE;2355 fl |= SWP_RESTORE; 2306 2356 WinSetWindowPos(hwndTree, HWND_TOP, 0, 0, 0, 0, fl); 2307 2357 } … … 2336 2386 2337 2387 if (fOtherHelp) { 2338 if ((!hwndBubble || WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd)2339 && !WinQueryCapture(HWND_DESKTOP)) {2340 switch (id) {2341 case IDM_ATTRS:2342 if (WinQueryWindowTextLength(hwnd))2343 s = GetPString(IDS_ATTRSBUTTONHELP);2344 break;2345 case IDM_INFO:2346 if (WinQueryWindowTextLength(hwnd))2347 s = GetPString(IDS_INFOBUTTONHELP);2348 break;2349 case IDM_RENAME:2350 if (WinQueryWindowTextLength(hwnd))2351 s = GetPString(IDS_NAMEBUTTONHELP);2352 break;2353 case MAIN_STATUS2:2354 if (!hwndE)2355 s = GetPString(IDS_STATUS2HELP);2356 break;2357 default:2358 break;2359 }2360 if (s)2361 MakeBubble(hwnd, FALSE, s);2362 else if (hwndBubble)2363 WinDestroyWindow(hwndBubble);2364 }2388 if ((!hwndBubble || WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) 2389 && !WinQueryCapture(HWND_DESKTOP)) { 2390 switch (id) { 2391 case IDM_ATTRS: 2392 if (WinQueryWindowTextLength(hwnd)) 2393 s = GetPString(IDS_ATTRSBUTTONHELP); 2394 break; 2395 case IDM_INFO: 2396 if (WinQueryWindowTextLength(hwnd)) 2397 s = GetPString(IDS_INFOBUTTONHELP); 2398 break; 2399 case IDM_RENAME: 2400 if (WinQueryWindowTextLength(hwnd)) 2401 s = GetPString(IDS_NAMEBUTTONHELP); 2402 break; 2403 case MAIN_STATUS2: 2404 if (!hwndE) 2405 s = GetPString(IDS_STATUS2HELP); 2406 break; 2407 default: 2408 break; 2409 } 2410 if (s) 2411 MakeBubble(hwnd, FALSE, s); 2412 else if (hwndBubble) 2413 WinDestroyWindow(hwndBubble); 2414 } 2365 2415 } 2366 2416 switch (id) { … … 2369 2419 case IDM_RENAME: 2370 2420 case MAIN_STATUS2: 2371 return CommonTextProc(hwnd, msg, mp1, mp2);2421 return CommonTextProc(hwnd, msg, mp1, mp2); 2372 2422 default: 2373 break;2423 break; 2374 2424 } 2375 2425 } … … 2394 2444 case IDM_RENAME: 2395 2445 case MAIN_STATUS2: 2396 return CommonTextButton(hwnd, msg, mp1, mp2);2446 return CommonTextButton(hwnd, msg, mp1, mp2); 2397 2447 default: 2398 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID);2399 break;2448 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID); 2449 break; 2400 2450 } 2401 2451 } … … 2409 2459 id = WinQueryWindowUShort(hwnd, QWS_ID); 2410 2460 if (id == MAIN_STATUS2 && hwndE) 2411 WinSendMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);2461 WinSendMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 2412 2462 else 2413 return CommonTextButton(hwnd, msg, mp1, mp2);2463 return CommonTextButton(hwnd, msg, mp1, mp2); 2414 2464 } 2415 2465 break; … … 2421 2471 id = WinQueryWindowUShort(hwnd, QWS_ID); 2422 2472 if (id == MAIN_STATUS) { 2423 if (SHORT2FROMMP(mp2) & KC_CTRL)2424 PostMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),2425 FID_CLIENT),2426 WM_COMMAND, MPFROM2SHORT(IDM_WINDOWDLG, 0), MPVOID);2427 else if (hwndTree)2428 PostMsg(hwndTree, UM_TIMER, MPVOID, MPVOID);2473 if (SHORT2FROMMP(mp2) & KC_CTRL) 2474 PostMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 2475 FID_CLIENT), 2476 WM_COMMAND, MPFROM2SHORT(IDM_WINDOWDLG, 0), MPVOID); 2477 else if (hwndTree) 2478 PostMsg(hwndTree, UM_TIMER, MPVOID, MPVOID); 2429 2479 } 2430 2480 } … … 2439 2489 if (id == MAIN_STATUS2 && !hwndE) { 2440 2490 2441 SWP swp;2442 CHAR directory[CCHMAXPATH];2443 PFNWP oldproce;2444 2445 *directory = 0;2446 TopWindowName(hwndMain, (HWND) 0, directory);2447 WinQueryWindowPos(hwnd, &swp);2448 hwndB = WinCreateWindow(hwnd,2449 WC_BUTTON,2450 "+",2451 WS_VISIBLE | BS_PUSHBUTTON |2452 BS_NOPOINTERFOCUS,2453 swp.cx - swp.cy,2454 0,2455 swp.cy,2456 swp.cy,2457 hwnd, HWND_TOP, COMMAND_BUTTON, NULL, NULL);2458 if (!hwndB)2459 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);2460 hwndE = WinCreateWindow(hwnd,2461 WC_ENTRYFIELD,2462 NULL,2463 WS_VISIBLE | ES_AUTOSCROLL,2464 0,2465 0,2466 swp.cx - swp.cy,2467 swp.cy,2468 hwnd, HWND_TOP, COMMAND_LINE, NULL, NULL);2469 if (!hwndE)2470 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);2471 if (!hwndE || !hwndB) {2472 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);2473 return 0;2474 }2475 WinSendMsg(hwndE, EM_SETTEXTLIMIT, MPFROM2SHORT(1024, 0), MPVOID);2476 WinSetWindowText(hwndStatus, directory);2477 if (*lastcmd)2478 WinSetWindowText(hwndE, lastcmd);2479 else2480 WinSetWindowText(hwndE, GetPString(IDS_HELPCMDTEXT));2481 oldproce = WinSubclassWindow(hwndE, (PFNWP) CommandLineProc);2482 if (oldproce)2483 WinSetWindowPtr(hwndE, QWL_USER, (PVOID) oldproce);2484 PostMsg(hwndE, UM_FOCUSME, MPVOID, MPVOID);2485 PostMsg(hwndE, EM_SETSEL, MPFROM2SHORT(0, 1024), MPVOID);2486 return 0;2491 SWP swp; 2492 CHAR directory[CCHMAXPATH]; 2493 PFNWP oldproce; 2494 2495 *directory = 0; 2496 TopWindowName(hwndMain, (HWND) 0, directory); 2497 WinQueryWindowPos(hwnd, &swp); 2498 hwndB = WinCreateWindow(hwnd, 2499 WC_BUTTON, 2500 "+", 2501 WS_VISIBLE | BS_PUSHBUTTON | 2502 BS_NOPOINTERFOCUS, 2503 swp.cx - swp.cy, 2504 0, 2505 swp.cy, 2506 swp.cy, 2507 hwnd, HWND_TOP, COMMAND_BUTTON, NULL, NULL); 2508 if (!hwndB) 2509 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 2510 hwndE = WinCreateWindow(hwnd, 2511 WC_ENTRYFIELD, 2512 NULL, 2513 WS_VISIBLE | ES_AUTOSCROLL, 2514 0, 2515 0, 2516 swp.cx - swp.cy, 2517 swp.cy, 2518 hwnd, HWND_TOP, COMMAND_LINE, NULL, NULL); 2519 if (!hwndE) 2520 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 2521 if (!hwndE || !hwndB) { 2522 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 2523 return 0; 2524 } 2525 WinSendMsg(hwndE, EM_SETTEXTLIMIT, MPFROM2SHORT(1024, 0), MPVOID); 2526 WinSetWindowText(hwndStatus, directory); 2527 if (*lastcmd) 2528 WinSetWindowText(hwndE, lastcmd); 2529 else 2530 WinSetWindowText(hwndE, GetPString(IDS_HELPCMDTEXT)); 2531 oldproce = WinSubclassWindow(hwndE, (PFNWP) CommandLineProc); 2532 if (oldproce) 2533 WinSetWindowPtr(hwndE, QWL_USER, (PVOID) oldproce); 2534 PostMsg(hwndE, UM_FOCUSME, MPVOID, MPVOID); 2535 PostMsg(hwndE, EM_SETSEL, MPFROM2SHORT(0, 1024), MPVOID); 2536 return 0; 2487 2537 } 2488 2538 if (msg == UM_CLICKED3 || (SHORT2FROMMP(mp2) & KC_CTRL)) { 2489 switch (id) {2490 case IDM_ATTRS:2491 id = IDM_SORTSIZE;2492 break;2493 case IDM_INFO:2494 id = IDM_SORTLWDATE;2495 break;2496 case IDM_RENAME:2497 id = IDM_SORTFILENAME;2498 break;2499 }2539 switch (id) { 2540 case IDM_ATTRS: 2541 id = IDM_SORTSIZE; 2542 break; 2543 case IDM_INFO: 2544 id = IDM_SORTLWDATE; 2545 break; 2546 case IDM_RENAME: 2547 id = IDM_SORTFILENAME; 2548 break; 2549 } 2500 2550 } 2501 2551 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 2502 WM_COMMAND, MPFROM2SHORT(id, 0), MPVOID);2552 WM_COMMAND, MPFROM2SHORT(id, 0), MPVOID); 2503 2553 } 2504 2554 return 0; … … 2514 2564 case IDM_RENAME: 2515 2565 case MAIN_STATUS2: 2516 PaintRecessedWindow(hwnd, (HPS) 0, TRUE, FALSE);2517 break;2566 PaintRecessedWindow(hwnd, (HPS) 0, TRUE, FALSE); 2567 break; 2518 2568 default: 2519 PaintRecessedWindow(hwnd, (HPS) 0, FALSE, TRUE);2520 break;2569 PaintRecessedWindow(hwnd, (HPS) 0, FALSE, TRUE); 2570 break; 2521 2571 } 2522 2572 if (id == IDM_RENAME) { 2523 2573 2524 HPS hps;2525 2526 hps = WinBeginPaint(hwnd, (HPS) 0, NULL);2527 if (hps) {2528 PaintSTextWindow(hwnd, hps);2529 WinEndPaint(hps);2530 }2531 return 0;2574 HPS hps; 2575 2576 hps = WinBeginPaint(hwnd, (HPS) 0, NULL); 2577 if (hps) { 2578 PaintSTextWindow(hwnd, hps); 2579 WinEndPaint(hps); 2580 } 2581 return 0; 2532 2582 } 2533 2583 } … … 2562 2612 case UM_COMMAND: 2563 2613 return WinSendMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 2564 FID_CLIENT), msg, mp1, mp2);2614 FID_CLIENT), msg, mp1, mp2); 2565 2615 2566 2616 case WM_PAINT: … … 2575 2625 hps = WinBeginPaint(hwnd, (HPS)0, NULL); 2576 2626 if (hps) { 2577 GpiCreateLogColorTable(hps, 0, LCOLF_RGB, 0, 0, NULL);2578 WinQueryPresParam(hwnd, PP_BACKGROUNDCOLOR, 0, NULL,2627 GpiCreateLogColorTable(hps, 0, LCOLF_RGB, 0, 0, NULL); 2628 WinQueryPresParam(hwnd, PP_BACKGROUNDCOLOR, 0, NULL, 2579 2629 sizeof(lColor), &lColor, 0); 2580 2630 if (!lColor) 2581 2631 lColor = CLR_PALEGRAY; 2582 WinQueryWindowRect(hwnd, &rcl);2583 WinFillRect(hps, &rcl, lColor);2584 WinEndPaint(hps);2632 WinQueryWindowRect(hwnd, &rcl); 2633 WinFillRect(hps, &rcl, lColor); 2634 WinEndPaint(hps); 2585 2635 } 2586 2636 … … 2601 2651 tool = find_tool(id); 2602 2652 if (tool) { 2603 del_tool(tool);2604 WinShowWindow(WinWindowFromID(hwnd, id), FALSE);2605 if (fToolTitles)2606 WinShowWindow(WinWindowFromID(hwnd, id + 25000), FALSE);2653 del_tool(tool); 2654 WinShowWindow(WinWindowFromID(hwnd, id), FALSE); 2655 if (fToolTitles) 2656 WinShowWindow(WinWindowFromID(hwnd, id + 25000), FALSE); 2607 2657 ResizeTools(hwnd); 2608 2658 save_tools(NULL); … … 2620 2670 2621 2671 id = (USHORT) WinDlgBox(HWND_DESKTOP, 2622 hwnd,2623 AddToolProc,2624 FM3ModHandle, ADDBTN_FRAME, MPVOID);2672 hwnd, 2673 AddToolProc, 2674 FM3ModHandle, ADDBTN_FRAME, MPVOID); 2625 2675 if (id && id != (USHORT) - 1) 2626 WinSendMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),2627 FID_CLIENT),2628 WM_COMMAND,2629 MPFROM2SHORT(IDM_CREATETOOL, 0), MPFROM2SHORT(id, 0));2676 WinSendMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 2677 FID_CLIENT), 2678 WM_COMMAND, 2679 MPFROM2SHORT(IDM_CREATETOOL, 0), MPFROM2SHORT(id, 0)); 2630 2680 } 2631 2681 break; … … 2633 2683 case WM_CONTEXTMENU: 2634 2684 if (WinDlgBox(HWND_DESKTOP, 2635 hwnd, ToolIODlgProc, FM3ModHandle, SVBTN_FRAME, MPVOID))2685 hwnd, ToolIODlgProc, FM3ModHandle, SVBTN_FRAME, MPVOID)) 2636 2686 PostMsg(hwnd, UM_SETUP2, MPVOID, MPVOID); 2637 2687 return MRFROMSHORT(TRUE); … … 2656 2706 if (pswp) { 2657 2707 if (WinQueryWindowPos(hwndTree, &swp) && 2658 !(swp.fl & (SWP_MINIMIZE | SWP_HIDE | SWP_MAXIMIZE))) {2708 !(swp.fl & (SWP_MINIMIZE | SWP_HIDE | SWP_MAXIMIZE))) { 2659 2709 pswp->x = swp.cx; 2660 2710 pswp->cx -= swp.cx; … … 2663 2713 if (prectl) { 2664 2714 if (WinQueryWindowPos(hwndTree, &swp) && 2665 !(swp.fl & (SWP_MINIMIZE | SWP_HIDE | SWP_MAXIMIZE)) &&2666 WinQueryWindowRect(hwndTree, &rectl)) {2715 !(swp.fl & (SWP_MINIMIZE | SWP_HIDE | SWP_MAXIMIZE)) && 2716 WinQueryWindowRect(hwndTree, &rectl)) { 2667 2717 prectl->xLeft = rectl.xRight; 2668 2718 prectl->xRight -= rectl.xRight; … … 2716 2766 if (!(swp.fl & (SWP_MAXIMIZE | SWP_HIDE | SWP_MINIMIZE))) { 2717 2767 if (swp.x < swpT.cx) { 2718 swp.x = swpT.cx;2719 if (swp.x + swp.cx > swpC.cx)2720 swp.cx = swpC.cx - swp.x;2721 if (swp.cx > 24)2722 WinSetWindowPos(hwndChild, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy,2723 SWP_SIZE | SWP_MOVE | SWP_SHOW);2768 swp.x = swpT.cx; 2769 if (swp.x + swp.cx > swpC.cx) 2770 swp.cx = swpC.cx - swp.x; 2771 if (swp.cx > 24) 2772 WinSetWindowPos(hwndChild, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy, 2773 SWP_SIZE | SWP_MOVE | SWP_SHOW); 2724 2774 } 2725 2775 } … … 2741 2791 WinSetWindowUShort(hwndChild, QWS_YMINIMIZE, (USHORT) - 1); 2742 2792 WinSetWindowPos(hwndChild, HWND_TOP, 0, 0, 0, 0, 2743 SWP_MOVE | SWP_SHOW | SWP_FOCUSDEACTIVATE);2793 SWP_MOVE | SWP_SHOW | SWP_FOCUSDEACTIVATE); 2744 2794 } 2745 2795 } … … 2763 2813 if (hwndNext) { 2764 2814 if (!WinQueryWindowUShort(hwndNext, QWS_ID)) 2765 continue;2815 continue; 2766 2816 if (next) 2767 break;2817 break; 2768 2818 if (hwndNext == hwndActive) { 2769 if (!previous && hwndPrev) {2770 hwndNext = hwndPrev;2771 break;2772 }2773 else if (previous)2774 next = TRUE;2819 if (!previous && hwndPrev) { 2820 hwndNext = hwndPrev; 2821 break; 2822 } 2823 else if (previous) 2824 next = TRUE; 2775 2825 } 2776 2826 hwndPrev = hwndNext; … … 2778 2828 else { 2779 2829 if ((!next && previous) || once) 2780 break;2830 break; 2781 2831 else if (!previous) { 2782 hwndNext = hwndPrev;2783 break;2832 hwndNext = hwndPrev; 2833 break; 2784 2834 } 2785 2835 else 2786 once = next = TRUE;2836 once = next = TRUE; 2787 2837 } 2788 2838 } … … 2791 2841 if (hwndNext && hwndNext != hwndActive) { 2792 2842 WinSetWindowPos(hwndNext, HWND_TOP, 0, 0, 0, 0, 2793 SWP_ZORDER | SWP_ACTIVATE);2843 SWP_ZORDER | SWP_ACTIVATE); 2794 2844 WinSetWindowPos(hwndActive, ((previous) ? HWND_BOTTOM : hwndNext), 0, 0, 2795 0, 0, SWP_ZORDER);2845 0, 0, SWP_ZORDER); 2796 2846 } 2797 2847 } … … 2808 2858 if (hwndChild != hwndTree) { 2809 2859 WinSendMsg(WinWindowFromID(hwndChild, FID_CLIENT), 2810 WM_SAVEAPPLICATION, MPVOID, MPVOID);2860 WM_SAVEAPPLICATION, MPVOID, MPVOID); 2811 2861 if (WinSendMsg(WinWindowFromID(hwndChild, FID_CLIENT), 2812 WM_CLOSE, MPVOID, MPVOID)) {2813 ret = TRUE;2814 break;2862 WM_CLOSE, MPVOID, MPVOID)) { 2863 ret = TRUE; 2864 break; 2815 2865 } 2816 2866 } … … 2835 2885 hwndTemp = WinWindowFromID(hwndChild, FID_CLIENT); 2836 2886 if (hwndTemp) { 2837 hwndDir = WinWindowFromID(hwndTemp, DIR_CNR);2838 if (hwndDir) {2839 WinSendMsg(WinWindowFromID(hwndChild, FID_CLIENT),2840 WM_CLOSE, MPVOID, MPVOID);2841 ret = TRUE;2842 }2887 hwndDir = WinWindowFromID(hwndTemp, DIR_CNR); 2888 if (hwndDir) { 2889 WinSendMsg(WinWindowFromID(hwndChild, FID_CLIENT), 2890 WM_CLOSE, MPVOID, MPVOID); 2891 ret = TRUE; 2892 } 2843 2893 } 2844 2894 } … … 2898 2948 hwndC = WinWindowFromID(hwndChild, FID_CLIENT); 2899 2949 if (hwndC) { 2900 hwndDir = WinWindowFromID(hwndC, DIR_CNR);2901 if (hwndDir) {2902 WinQueryWindowPos(hwndChild, &swp);2903 *szDir = 0;2904 WinSendMsg(hwndC, UM_CONTAINERDIR, MPFROMP(szDir), MPVOID);2905 if (*szDir) {2906 // If saving shutdown state skip no prescan drives2907 if (fIsShutDownState &&2908 driveflags[toupper(*szDir) - 'A'] & DRIVE_NOPRESCAN) {2909 continue;2910 }2911 sprintf(szKey, "%sDirCnrPos.%lu", szPrefix, numsaves);2912 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & swp,2913 sizeof(SWP));2914 dcd =2915 WinQueryWindowPtr(WinWindowFromID(hwndC, DIR_CNR), QWL_USER);2916 if (dcd) {2917 sprintf(szKey, "%sDirCnrSort.%lu", szPrefix, numsaves);2918 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->sortFlags,2919 sizeof(INT));2920 sprintf(szKey, "%sDirCnrFilter.%lu", szPrefix, numsaves);2921 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->mask,2922 sizeof(MASK));2923 sprintf(szKey, "%sDirCnrView.%lu", szPrefix, numsaves);2924 flWindowAttr = dcd->flWindowAttr;2925 if (!fLeaveTree && (flWindowAttr & CV_TREE)) {2926 flWindowAttr &= (~(CV_TREE | CV_ICON | CV_DETAIL | CV_TEXT));2927 if (dcd->lastattr) {2928 if (dcd->lastattr & CV_TEXT)2929 flWindowAttr |= CV_TEXT;2930 else if (dcd->lastattr & CV_DETAIL)2931 flWindowAttr |= CV_DETAIL;2932 else if (dcd->lastattr & CV_ICON)2933 flWindowAttr |= CV_ICON;2934 else2935 flWindowAttr |= CV_NAME;2936 }2937 else2938 flWindowAttr |= CV_NAME;2939 }2940 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & flWindowAttr,2941 sizeof(ULONG));2942 sprintf(szKey, "%sDirCnr.%lu.DetailsLongname", szPrefix, numsaves);2943 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailslongname,2944 sizeof(BOOL));2945 sprintf(szKey, "%sDirCnr.%lu.DetailsSubject", szPrefix, numsaves);2946 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailssubject,2947 sizeof(BOOL));2948 sprintf(szKey, "%sDirCnr.%lu.DetailsSize", szPrefix, numsaves);2949 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailssize,2950 sizeof(BOOL));2951 sprintf(szKey, "%sDirCnr.%lu.DetailsEA", szPrefix, numsaves);2952 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailsea,2953 sizeof(BOOL));2954 sprintf(szKey, "%sDirCnr.%lu.DetailsAttr", szPrefix, numsaves);2955 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailsattr,2956 sizeof(BOOL));2957 sprintf(szKey, "%sDirCnr.%lu.DetailsIcon", szPrefix, numsaves);2958 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailsicon,2959 sizeof(BOOL));2960 sprintf(szKey, "%sDirCnr.%lu.DetailsLWDate", szPrefix, numsaves);2961 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailslwdate,2962 sizeof(BOOL));2963 sprintf(szKey, "%sDirCnr.%lu.DetailsLWTime", szPrefix, numsaves);2964 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailslwtime,2965 sizeof(BOOL));2966 sprintf(szKey, "%sDirCnr.%lu.DetailsLADate", szPrefix, numsaves);2967 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailsladate,2968 sizeof(BOOL));2969 sprintf(szKey, "%sDirCnr.%lu.DetailsLATime", szPrefix, numsaves);2970 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailslatime,2971 sizeof(BOOL));2972 sprintf(szKey, "%sDirCnr.%lu.DetailsCRDate", szPrefix, numsaves);2973 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailscrdate,2974 sizeof(BOOL));2975 sprintf(szKey, "%sDirCnr.%lu.DetailsCRTime", szPrefix, numsaves);2976 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailscrtime,2977 sizeof(BOOL));2978 sprintf(szKey, "%sDirCnr.%lu", szPrefix, numsaves);2979 SavePresParams(hwndDir, szKey);2980 }2981 sprintf(szKey, "%sDirCnrDir.%lu", szPrefix, numsaves++);2982 PrfWriteProfileString(fmprof, FM3Str, szKey, szDir);2983 }2984 }2950 hwndDir = WinWindowFromID(hwndC, DIR_CNR); 2951 if (hwndDir) { 2952 WinQueryWindowPos(hwndChild, &swp); 2953 *szDir = 0; 2954 WinSendMsg(hwndC, UM_CONTAINERDIR, MPFROMP(szDir), MPVOID); 2955 if (*szDir) { 2956 // If saving shutdown state skip no prescan drives 2957 if (fIsShutDownState && 2958 driveflags[toupper(*szDir) - 'A'] & DRIVE_NOPRESCAN) { 2959 continue; 2960 } 2961 sprintf(szKey, "%sDirCnrPos.%lu", szPrefix, numsaves); 2962 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & swp, 2963 sizeof(SWP)); 2964 dcd = 2965 WinQueryWindowPtr(WinWindowFromID(hwndC, DIR_CNR), QWL_USER); 2966 if (dcd) { 2967 sprintf(szKey, "%sDirCnrSort.%lu", szPrefix, numsaves); 2968 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->sortFlags, 2969 sizeof(INT)); 2970 sprintf(szKey, "%sDirCnrFilter.%lu", szPrefix, numsaves); 2971 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->mask, 2972 sizeof(MASK)); 2973 sprintf(szKey, "%sDirCnrView.%lu", szPrefix, numsaves); 2974 flWindowAttr = dcd->flWindowAttr; 2975 if (!fLeaveTree && (flWindowAttr & CV_TREE)) { 2976 flWindowAttr &= (~(CV_TREE | CV_ICON | CV_DETAIL | CV_TEXT)); 2977 if (dcd->lastattr) { 2978 if (dcd->lastattr & CV_TEXT) 2979 flWindowAttr |= CV_TEXT; 2980 else if (dcd->lastattr & CV_DETAIL) 2981 flWindowAttr |= CV_DETAIL; 2982 else if (dcd->lastattr & CV_ICON) 2983 flWindowAttr |= CV_ICON; 2984 else 2985 flWindowAttr |= CV_NAME; 2986 } 2987 else 2988 flWindowAttr |= CV_NAME; 2989 } 2990 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & flWindowAttr, 2991 sizeof(ULONG)); 2992 sprintf(szKey, "%sDirCnr.%lu.DetailsLongname", szPrefix, numsaves); 2993 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailslongname, 2994 sizeof(BOOL)); 2995 sprintf(szKey, "%sDirCnr.%lu.DetailsSubject", szPrefix, numsaves); 2996 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailssubject, 2997 sizeof(BOOL)); 2998 sprintf(szKey, "%sDirCnr.%lu.DetailsSize", szPrefix, numsaves); 2999 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailssize, 3000 sizeof(BOOL)); 3001 sprintf(szKey, "%sDirCnr.%lu.DetailsEA", szPrefix, numsaves); 3002 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailsea, 3003 sizeof(BOOL)); 3004 sprintf(szKey, "%sDirCnr.%lu.DetailsAttr", szPrefix, numsaves); 3005 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailsattr, 3006 sizeof(BOOL)); 3007 sprintf(szKey, "%sDirCnr.%lu.DetailsIcon", szPrefix, numsaves); 3008 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailsicon, 3009 sizeof(BOOL)); 3010 sprintf(szKey, "%sDirCnr.%lu.DetailsLWDate", szPrefix, numsaves); 3011 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailslwdate, 3012 sizeof(BOOL)); 3013 sprintf(szKey, "%sDirCnr.%lu.DetailsLWTime", szPrefix, numsaves); 3014 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailslwtime, 3015 sizeof(BOOL)); 3016 sprintf(szKey, "%sDirCnr.%lu.DetailsLADate", szPrefix, numsaves); 3017 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailsladate, 3018 sizeof(BOOL)); 3019 sprintf(szKey, "%sDirCnr.%lu.DetailsLATime", szPrefix, numsaves); 3020 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailslatime, 3021 sizeof(BOOL)); 3022 sprintf(szKey, "%sDirCnr.%lu.DetailsCRDate", szPrefix, numsaves); 3023 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailscrdate, 3024 sizeof(BOOL)); 3025 sprintf(szKey, "%sDirCnr.%lu.DetailsCRTime", szPrefix, numsaves); 3026 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->ds.detailscrtime, 3027 sizeof(BOOL)); 3028 sprintf(szKey, "%sDirCnr.%lu", szPrefix, numsaves); 3029 SavePresParams(hwndDir, szKey); 3030 } 3031 sprintf(szKey, "%sDirCnrDir.%lu", szPrefix, numsaves++); 3032 PrfWriteProfileString(fmprof, FM3Str, szKey, szDir); 3033 } 3034 } 2985 3035 } 2986 3036 } … … 3067 3117 if (hwnd) { 3068 3118 if (WinQueryWindowPos(hwnd, &swp)) { 3069 if (pswp->x > swp.cx)3070 pswp->x = (swp.cx > 24) ? swp.cx - 24 : swp.cx;3071 if (pswp->y > swp.cy)3072 pswp->y = (swp.cy > 24) ? swp.cy - 24 : swp.cy;3073 if (pswp->x + pswp->cx > swp.cx)3074 pswp->cx = swp.cx - pswp->x;3075 if (pswp->y + pswp->cy > swp.cy)3076 pswp->cy = swp.cy - pswp->y;3119 if (pswp->x > swp.cx) 3120 pswp->x = (swp.cx > 24) ? swp.cx - 24 : swp.cx; 3121 if (pswp->y > swp.cy) 3122 pswp->y = (swp.cy > 24) ? swp.cy - 24 : swp.cy; 3123 if (pswp->x + pswp->cx > swp.cx) 3124 pswp->cx = swp.cx - pswp->x; 3125 if (pswp->y + pswp->cy > swp.cy) 3126 pswp->cy = swp.cy - pswp->y; 3077 3127 } 3078 3128 } … … 3141 3191 sprintf(szKey, "%sMySizeLastTime", szPrefix); 3142 3192 if (!PrfQueryProfileData(fmprof, 3143 FM3Str,3144 szKey,3145 (PVOID) & swpO,3146 &size) ||3193 FM3Str, 3194 szKey, 3195 (PVOID) & swpO, 3196 &size) || 3147 3197 size != sizeof(SWP) || !swp.cx || !swp.cy) 3148 3198 { … … 3172 3222 swp.fl &= (~SWP_ACTIVATE); 3173 3223 WinSetWindowPos(hwndTree, 3174 HWND_TOP,3175 swp.x,3176 swp.y,3177 swp.cx,3178 swp.cy,3179 swp.fl | SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_ZORDER);3224 HWND_TOP, 3225 swp.x, 3226 swp.y, 3227 swp.cx, 3228 swp.cy, 3229 swp.fl | SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_ZORDER); 3180 3230 } 3181 3231 else { 3182 3232 WinSetWindowPos(hwndTree, 3183 HWND_TOP, 0, 0, 0, 0, SWP_MINIMIZE | SWP_SHOW);3233 HWND_TOP, 0, 0, 0, 0, SWP_MINIMIZE | SWP_SHOW); 3184 3234 WinSetWindowUShort(hwndTree, QWS_XRESTORE, (USHORT) swp.x); 3185 3235 WinSetWindowUShort(hwndTree, QWS_CXRESTORE, (USHORT) swp.cx); … … 3191 3241 sprintf(szKey, "%sNumDirsLastTime", szPrefix); 3192 3242 if (PrfQueryProfileData(fmprof, 3193 FM3Str, szKey, (PVOID) & numsaves, &size)) {3243 FM3Str, szKey, (PVOID) & numsaves, &size)) { 3194 3244 if (fDeleteState) 3195 3245 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); … … 3198 3248 size = sizeof(SWP); 3199 3249 if (PrfQueryProfileData(fmprof, FM3Str, szKey, (PVOID) &swp, &size)) { 3200 if (fDeleteState)3201 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3202 sprintf(szKey, "%sDirCnrDir.%lu", szPrefix, x);3203 size = sizeof(szDir);3204 if (PrfQueryProfileData(fmprof, FM3Str, szKey, (PVOID) szDir, &size)) {3205 // If restoring shutdown state and drive marked no prescan3206 // bypass window restore3207 if (fIsShutDownState &&3208 driveflags[toupper(*szDir) - 'A'] & DRIVE_NOPRESCAN) {3209 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3210 continue;3211 }3212 if (fDeleteState)3213 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3214 localdcd.ds.detailslongname = dsDirCnrDefault.detailslongname; // Set default3215 size = sizeof(BOOL);3216 sprintf(szKey, "%sDirCnr.%lu.DetailsLongname", szPrefix, x);3217 if (PrfQueryProfileData(fmprof,3218 FM3Str,3219 szKey,3220 (PVOID)&localdcd.ds.detailslongname,3221 &size) &&3222 size == sizeof(BOOL))3223 {3224 if (fDeleteState)3225 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3226 }3227 localdcd.ds.detailssubject = dsDirCnrDefault.detailssubject; // Set default3228 size = sizeof(BOOL);3229 sprintf(szKey, "%sDirCnr.%lu.DetailsSubject", szPrefix, x);3230 if (PrfQueryProfileData(fmprof,3231 FM3Str,3232 szKey,3233 (PVOID)&localdcd.ds.detailssubject,3234 &size) &&3235 size == sizeof(BOOL))3236 {3237 if (fDeleteState)3238 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3239 }3240 localdcd.ds.detailsea = dsDirCnrDefault.detailsea; // Set default3241 size = sizeof(BOOL);3242 sprintf(szKey, "%sDirCnr.%lu.DetailsEA", szPrefix, x);3243 if (PrfQueryProfileData(fmprof,3244 FM3Str,3245 szKey,3246 (PVOID) & localdcd.ds.detailsea,3247 &size) &&3248 size == sizeof(BOOL))3249 {3250 if (fDeleteState)3251 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3252 }3253 localdcd.ds.detailssize = dsDirCnrDefault.detailssize; // Set default3254 size = sizeof(BOOL);3255 sprintf(szKey, "%sDirCnr.%lu.DetailsSize", szPrefix, x);3256 if (PrfQueryProfileData(fmprof,3257 FM3Str,3258 szKey,3259 (PVOID) & localdcd.ds.detailssize,3260 &size) &&3261 size == sizeof(BOOL))3262 {3263 if (fDeleteState)3264 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3265 }3266 localdcd.ds.detailsicon = dsDirCnrDefault.detailsicon; // Set default3267 size = sizeof(BOOL);3268 sprintf(szKey, "%sDirCnr.%lu.DetailsIcon", szPrefix, x);3269 if (PrfQueryProfileData(fmprof,3270 FM3Str,3271 szKey,3272 (PVOID) & localdcd.ds.detailsicon,3273 &size) &&3274 size == sizeof(BOOL))3275 {3276 if (fDeleteState)3277 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3278 }3279 localdcd.ds.detailsattr = dsDirCnrDefault.detailsattr; // Set default3280 size = sizeof(BOOL);3281 sprintf(szKey, "%sDirCnr.%lu.DetailsAttr", szPrefix, x);3282 if (PrfQueryProfileData(fmprof,3283 FM3Str,3284 szKey,3285 (PVOID)&localdcd.ds.detailsattr,3286 &size) &&3287 size == sizeof(BOOL))3288 {3289 if (fDeleteState)3290 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3291 }3292 localdcd.ds.detailscrdate = dsDirCnrDefault.detailscrdate; // Set default3293 size = sizeof(BOOL);3294 sprintf(szKey, "%sDirCnr.%lu.DetailsCRDate", szPrefix, x);3295 if (PrfQueryProfileData(fmprof,3296 FM3Str,3297 szKey,3298 (PVOID) & localdcd.ds.detailscrdate,3299 &size) && size == sizeof(BOOL))3300 {3301 if (fDeleteState)3302 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3303 }3304 localdcd.ds.detailscrtime = dsDirCnrDefault.detailscrtime; // Set default3305 size = sizeof(BOOL);3306 sprintf(szKey, "%sDirCnr.%lu.DetailsCRTime", szPrefix, x);3307 if (PrfQueryProfileData(fmprof,3308 FM3Str,3309 szKey,3310 (PVOID)&localdcd.ds.detailscrtime,3311 &size) &&3312 size == sizeof(BOOL))3313 {3314 if (fDeleteState)3315 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3316 }3317 localdcd.ds.detailslwdate = dsDirCnrDefault.detailslwdate; // Set default3318 size = sizeof(BOOL);3319 sprintf(szKey, "%sDirCnr.%lu.DetailsLWDate", szPrefix, x);3320 if (PrfQueryProfileData(fmprof,3321 FM3Str,3322 szKey,3323 (PVOID) & localdcd.ds.detailslwdate,3324 &size) &&3325 size == sizeof(BOOL))3326 {3327 if (fDeleteState)3328 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3329 }3330 localdcd.ds.detailslwtime = dsDirCnrDefault.detailslwtime; // Set default3331 size = sizeof(BOOL);3332 sprintf(szKey, "%sDirCnr.%lu.DetailsLWTime", szPrefix, x);3333 if (PrfQueryProfileData(fmprof,3334 FM3Str,3335 szKey,3336 (PVOID) & localdcd.ds.detailslwtime,3337 &size) &&3338 size == sizeof(BOOL))3339 {3340 if (fDeleteState)3341 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3342 }3343 localdcd.ds.detailsladate = dsDirCnrDefault.detailsladate; // Set default3344 size = sizeof(BOOL);3345 sprintf(szKey, "%sDirCnr.%lu.DetailsLADate", szPrefix, x);3346 if (PrfQueryProfileData(fmprof,3347 FM3Str,3348 szKey,3349 (PVOID) & localdcd.ds.detailsladate,3350 &size) &&3351 size == sizeof(BOOL))3352 {3353 if (fDeleteState)3354 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3355 }3356 localdcd.ds.detailslatime = dsDirCnrDefault.detailslatime; // Set default3357 size = sizeof(BOOL);3358 sprintf(szKey, "%sDirCnr.%lu.DetailsLATime", szPrefix, x);3359 if (PrfQueryProfileData(fmprof,3360 FM3Str,3361 szKey,3362 (PVOID) & localdcd.ds.detailslatime,3363 &size) &&3364 size == sizeof(BOOL))3365 {3366 if (fDeleteState)3367 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3368 }3369 hwndDir = (HWND) WinSendMsg(hwndClient,3370 UM_SETDIR,3371 MPFROMP(szDir), MPFROMLONG(1));3372 if (hwndDir) {3373 hwndC = WinWindowFromID(hwndDir, FID_CLIENT);3374 if (hwndC) {3375 HWND hwndCnr = WinWindowFromID(hwndC, DIR_CNR);3376 if (!hwndPPSave) {3377 hwndPPSave = WinCreateWindow(hwndCnr, // Create a window (used to save default presparams)3378 WC_CONTAINER,3379 NULL,3380 CCS_AUTOPOSITION | CCS_MINIICONS |3381 CCS_MINIRECORDCORE | ulCnrType |3382 WS_VISIBLE,3383 0,3384 0,3385 0,3386 0,3387 hwndCnr,3388 HWND_TOP, (ULONG) -1, NULL, NULL);3389 CopyPresParams(hwndPPSave, hwndC);3390 RestorePresParams(hwndPPSave, "DirCnr");3391 }3392 sprintf(szKey, "%sDirCnr.%lu", szPrefix, x);3393 RestorePresParams(hwndCnr, szKey);3394 dcd = WinQueryWindowPtr(hwndCnr, QWL_USER);3395 if (dcd) {3396 dcd->ds.detailslongname = localdcd.ds.detailslongname;3397 dcd->ds.detailssubject = localdcd.ds.detailssubject ;3398 dcd->ds.detailsattr = localdcd.ds.detailsattr ;3399 dcd->ds.detailsea = localdcd.ds.detailsea ;3400 dcd->ds.detailssize = localdcd.ds.detailssize ;3401 dcd->ds.detailsicon = localdcd.ds.detailsicon ;3402 dcd->ds.detailscrdate = localdcd.ds.detailscrdate ;3403 dcd->ds.detailscrtime = localdcd.ds.detailscrtime ;3404 dcd->ds.detailsladate = localdcd.ds.detailsladate ;3405 dcd->ds.detailslatime = localdcd.ds.detailslatime ;3406 dcd->ds.detailslwdate = localdcd.ds.detailslwdate ;3407 dcd->ds.detailslwtime = localdcd.ds.detailslwtime ;3408 size = sizeof(INT);3409 sprintf(szKey, "%sDirCnrSort.%lu", szPrefix, x);3410 if (PrfQueryProfileData(fmprof,3411 FM3Str,3412 szKey,3413 (PVOID) & dcd->sortFlags,3414 &size) && size == sizeof(INT)) {3415 if (!dcd->sortFlags)3416 dcd->sortFlags = SORT_PATHNAME;3417 }3418 if (fDeleteState)3419 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3420 size = sizeof(MASK);3421 sprintf(szKey, "%sDirCnrFilter.%lu", szPrefix, x);3422 if (PrfQueryProfileData(fmprof,3423 FM3Str,3424 szKey,3425 (PVOID) & dcd->mask, &size) && size) {3426 if (*dcd->mask.szMask)3427 WinSendMsg(WinWindowFromID(hwndC, DIR_CNR),3428 UM_FILTER, MPFROMP(dcd->mask.szMask), MPVOID);3429 }3430 *(dcd->mask.prompt) = 0;3431 if (fDeleteState)3432 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3433 size = sizeof(ULONG);3434 sprintf(szKey, "%sDirCnrView.%lu", szPrefix, x);3435 if (!noview) {3436 if (PrfQueryProfileData(fmprof,3437 FM3Str,3438 szKey,3439 (PVOID) & dcd->flWindowAttr,3440 &size) && size == sizeof(ULONG)) {3441 3442 CNRINFO cnri;3443 3444 memset(&cnri, 0, sizeof(CNRINFO));3445 cnri.cb = sizeof(CNRINFO);3446 if (WinSendMsg(WinWindowFromID(hwndC, DIR_CNR),3447 CM_QUERYCNRINFO,3448 MPFROMP(&cnri),3449 MPFROMLONG(sizeof(CNRINFO)))) {3450 cnri.flWindowAttr = dcd->flWindowAttr;3451 WinSendMsg(WinWindowFromID(hwndC, DIR_CNR),3452 CM_SETCNRINFO,3453 MPFROMP(&cnri),3454 MPFROMLONG(CMA_FLWINDOWATTR));3455 }3456 }3457 }3458 if (fDeleteState)3459 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3460 if (!PostMsg(hwndCnr, UM_SETUP2, NULL, NULL))3461 WinSendMsg(hwndCnr, UM_SETUP2, NULL, NULL);3462 }3463 }3464 fRestored = TRUE;3465 swp.hwnd = hwndDir;3466 TransformSwp(&swp, xtrans, ytrans);3467 if (swp.fl & (SWP_HIDE | SWP_MINIMIZE)) {3468 WinSetWindowPos(hwndDir,3469 HWND_TOP, 0, 0, 0, 0, SWP_MINIMIZE | SWP_SHOW);3470 WinSetWindowUShort(hwndDir, QWS_XRESTORE, (USHORT) swp.x);3471 WinSetWindowUShort(hwndDir, QWS_CXRESTORE, (USHORT) swp.cx);3472 WinSetWindowUShort(hwndDir, QWS_YRESTORE, (USHORT) swp.y);3473 WinSetWindowUShort(hwndDir, QWS_CYRESTORE, (USHORT) swp.cy);3474 } else3475 WinSetWindowPos(hwndDir,3476 HWND_TOP,3477 swp.x,3478 swp.y,3479 swp.cx,3480 swp.cy,3481 swp.fl | SWP_MOVE |3482 SWP_SIZE | SWP_SHOW | SWP_ZORDER |3483 SWP_ACTIVATE);3484 }3485 }3250 if (fDeleteState) 3251 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3252 sprintf(szKey, "%sDirCnrDir.%lu", szPrefix, x); 3253 size = sizeof(szDir); 3254 if (PrfQueryProfileData(fmprof, FM3Str, szKey, (PVOID) szDir, &size)) { 3255 // If restoring shutdown state and drive marked no prescan 3256 // bypass window restore 3257 if (fIsShutDownState && 3258 driveflags[toupper(*szDir) - 'A'] & DRIVE_NOPRESCAN) { 3259 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3260 continue; 3261 } 3262 if (fDeleteState) 3263 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3264 localdcd.ds.detailslongname = dsDirCnrDefault.detailslongname; // Set default 3265 size = sizeof(BOOL); 3266 sprintf(szKey, "%sDirCnr.%lu.DetailsLongname", szPrefix, x); 3267 if (PrfQueryProfileData(fmprof, 3268 FM3Str, 3269 szKey, 3270 (PVOID)&localdcd.ds.detailslongname, 3271 &size) && 3272 size == sizeof(BOOL)) 3273 { 3274 if (fDeleteState) 3275 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3276 } 3277 localdcd.ds.detailssubject = dsDirCnrDefault.detailssubject; // Set default 3278 size = sizeof(BOOL); 3279 sprintf(szKey, "%sDirCnr.%lu.DetailsSubject", szPrefix, x); 3280 if (PrfQueryProfileData(fmprof, 3281 FM3Str, 3282 szKey, 3283 (PVOID)&localdcd.ds.detailssubject, 3284 &size) && 3285 size == sizeof(BOOL)) 3286 { 3287 if (fDeleteState) 3288 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3289 } 3290 localdcd.ds.detailsea = dsDirCnrDefault.detailsea; // Set default 3291 size = sizeof(BOOL); 3292 sprintf(szKey, "%sDirCnr.%lu.DetailsEA", szPrefix, x); 3293 if (PrfQueryProfileData(fmprof, 3294 FM3Str, 3295 szKey, 3296 (PVOID) & localdcd.ds.detailsea, 3297 &size) && 3298 size == sizeof(BOOL)) 3299 { 3300 if (fDeleteState) 3301 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3302 } 3303 localdcd.ds.detailssize = dsDirCnrDefault.detailssize; // Set default 3304 size = sizeof(BOOL); 3305 sprintf(szKey, "%sDirCnr.%lu.DetailsSize", szPrefix, x); 3306 if (PrfQueryProfileData(fmprof, 3307 FM3Str, 3308 szKey, 3309 (PVOID) & localdcd.ds.detailssize, 3310 &size) && 3311 size == sizeof(BOOL)) 3312 { 3313 if (fDeleteState) 3314 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3315 } 3316 localdcd.ds.detailsicon = dsDirCnrDefault.detailsicon; // Set default 3317 size = sizeof(BOOL); 3318 sprintf(szKey, "%sDirCnr.%lu.DetailsIcon", szPrefix, x); 3319 if (PrfQueryProfileData(fmprof, 3320 FM3Str, 3321 szKey, 3322 (PVOID) & localdcd.ds.detailsicon, 3323 &size) && 3324 size == sizeof(BOOL)) 3325 { 3326 if (fDeleteState) 3327 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3328 } 3329 localdcd.ds.detailsattr = dsDirCnrDefault.detailsattr; // Set default 3330 size = sizeof(BOOL); 3331 sprintf(szKey, "%sDirCnr.%lu.DetailsAttr", szPrefix, x); 3332 if (PrfQueryProfileData(fmprof, 3333 FM3Str, 3334 szKey, 3335 (PVOID)&localdcd.ds.detailsattr, 3336 &size) && 3337 size == sizeof(BOOL)) 3338 { 3339 if (fDeleteState) 3340 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3341 } 3342 localdcd.ds.detailscrdate = dsDirCnrDefault.detailscrdate; // Set default 3343 size = sizeof(BOOL); 3344 sprintf(szKey, "%sDirCnr.%lu.DetailsCRDate", szPrefix, x); 3345 if (PrfQueryProfileData(fmprof, 3346 FM3Str, 3347 szKey, 3348 (PVOID) & localdcd.ds.detailscrdate, 3349 &size) && size == sizeof(BOOL)) 3350 { 3351 if (fDeleteState) 3352 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3353 } 3354 localdcd.ds.detailscrtime = dsDirCnrDefault.detailscrtime; // Set default 3355 size = sizeof(BOOL); 3356 sprintf(szKey, "%sDirCnr.%lu.DetailsCRTime", szPrefix, x); 3357 if (PrfQueryProfileData(fmprof, 3358 FM3Str, 3359 szKey, 3360 (PVOID)&localdcd.ds.detailscrtime, 3361 &size) && 3362 size == sizeof(BOOL)) 3363 { 3364 if (fDeleteState) 3365 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3366 } 3367 localdcd.ds.detailslwdate = dsDirCnrDefault.detailslwdate; // Set default 3368 size = sizeof(BOOL); 3369 sprintf(szKey, "%sDirCnr.%lu.DetailsLWDate", szPrefix, x); 3370 if (PrfQueryProfileData(fmprof, 3371 FM3Str, 3372 szKey, 3373 (PVOID) & localdcd.ds.detailslwdate, 3374 &size) && 3375 size == sizeof(BOOL)) 3376 { 3377 if (fDeleteState) 3378 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3379 } 3380 localdcd.ds.detailslwtime = dsDirCnrDefault.detailslwtime; // Set default 3381 size = sizeof(BOOL); 3382 sprintf(szKey, "%sDirCnr.%lu.DetailsLWTime", szPrefix, x); 3383 if (PrfQueryProfileData(fmprof, 3384 FM3Str, 3385 szKey, 3386 (PVOID) & localdcd.ds.detailslwtime, 3387 &size) && 3388 size == sizeof(BOOL)) 3389 { 3390 if (fDeleteState) 3391 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3392 } 3393 localdcd.ds.detailsladate = dsDirCnrDefault.detailsladate; // Set default 3394 size = sizeof(BOOL); 3395 sprintf(szKey, "%sDirCnr.%lu.DetailsLADate", szPrefix, x); 3396 if (PrfQueryProfileData(fmprof, 3397 FM3Str, 3398 szKey, 3399 (PVOID) & localdcd.ds.detailsladate, 3400 &size) && 3401 size == sizeof(BOOL)) 3402 { 3403 if (fDeleteState) 3404 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3405 } 3406 localdcd.ds.detailslatime = dsDirCnrDefault.detailslatime; // Set default 3407 size = sizeof(BOOL); 3408 sprintf(szKey, "%sDirCnr.%lu.DetailsLATime", szPrefix, x); 3409 if (PrfQueryProfileData(fmprof, 3410 FM3Str, 3411 szKey, 3412 (PVOID) & localdcd.ds.detailslatime, 3413 &size) && 3414 size == sizeof(BOOL)) 3415 { 3416 if (fDeleteState) 3417 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3418 } 3419 hwndDir = (HWND) WinSendMsg(hwndClient, 3420 UM_SETDIR, 3421 MPFROMP(szDir), MPFROMLONG(1)); 3422 if (hwndDir) { 3423 hwndC = WinWindowFromID(hwndDir, FID_CLIENT); 3424 if (hwndC) { 3425 HWND hwndCnr = WinWindowFromID(hwndC, DIR_CNR); 3426 if (!hwndPPSave) { 3427 hwndPPSave = WinCreateWindow(hwndCnr, // Create a window (used to save default presparams) 3428 WC_CONTAINER, 3429 NULL, 3430 CCS_AUTOPOSITION | CCS_MINIICONS | 3431 CCS_MINIRECORDCORE | ulCnrType | 3432 WS_VISIBLE, 3433 0, 3434 0, 3435 0, 3436 0, 3437 hwndCnr, 3438 HWND_TOP, (ULONG) -1, NULL, NULL); 3439 CopyPresParams(hwndPPSave, hwndC); 3440 RestorePresParams(hwndPPSave, "DirCnr"); 3441 } 3442 sprintf(szKey, "%sDirCnr.%lu", szPrefix, x); 3443 RestorePresParams(hwndCnr, szKey); 3444 dcd = WinQueryWindowPtr(hwndCnr, QWL_USER); 3445 if (dcd) { 3446 dcd->ds.detailslongname = localdcd.ds.detailslongname; 3447 dcd->ds.detailssubject = localdcd.ds.detailssubject ; 3448 dcd->ds.detailsattr = localdcd.ds.detailsattr ; 3449 dcd->ds.detailsea = localdcd.ds.detailsea ; 3450 dcd->ds.detailssize = localdcd.ds.detailssize ; 3451 dcd->ds.detailsicon = localdcd.ds.detailsicon ; 3452 dcd->ds.detailscrdate = localdcd.ds.detailscrdate ; 3453 dcd->ds.detailscrtime = localdcd.ds.detailscrtime ; 3454 dcd->ds.detailsladate = localdcd.ds.detailsladate ; 3455 dcd->ds.detailslatime = localdcd.ds.detailslatime ; 3456 dcd->ds.detailslwdate = localdcd.ds.detailslwdate ; 3457 dcd->ds.detailslwtime = localdcd.ds.detailslwtime ; 3458 size = sizeof(INT); 3459 sprintf(szKey, "%sDirCnrSort.%lu", szPrefix, x); 3460 if (PrfQueryProfileData(fmprof, 3461 FM3Str, 3462 szKey, 3463 (PVOID) & dcd->sortFlags, 3464 &size) && size == sizeof(INT)) { 3465 if (!dcd->sortFlags) 3466 dcd->sortFlags = SORT_PATHNAME; 3467 } 3468 if (fDeleteState) 3469 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3470 size = sizeof(MASK); 3471 sprintf(szKey, "%sDirCnrFilter.%lu", szPrefix, x); 3472 if (PrfQueryProfileData(fmprof, 3473 FM3Str, 3474 szKey, 3475 (PVOID) & dcd->mask, &size) && size) { 3476 if (*dcd->mask.szMask) 3477 WinSendMsg(WinWindowFromID(hwndC, DIR_CNR), 3478 UM_FILTER, MPFROMP(dcd->mask.szMask), MPVOID); 3479 } 3480 *(dcd->mask.prompt) = 0; 3481 if (fDeleteState) 3482 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3483 size = sizeof(ULONG); 3484 sprintf(szKey, "%sDirCnrView.%lu", szPrefix, x); 3485 if (!noview) { 3486 if (PrfQueryProfileData(fmprof, 3487 FM3Str, 3488 szKey, 3489 (PVOID) & dcd->flWindowAttr, 3490 &size) && size == sizeof(ULONG)) { 3491 3492 CNRINFO cnri; 3493 3494 memset(&cnri, 0, sizeof(CNRINFO)); 3495 cnri.cb = sizeof(CNRINFO); 3496 if (WinSendMsg(WinWindowFromID(hwndC, DIR_CNR), 3497 CM_QUERYCNRINFO, 3498 MPFROMP(&cnri), 3499 MPFROMLONG(sizeof(CNRINFO)))) { 3500 cnri.flWindowAttr = dcd->flWindowAttr; 3501 WinSendMsg(WinWindowFromID(hwndC, DIR_CNR), 3502 CM_SETCNRINFO, 3503 MPFROMP(&cnri), 3504 MPFROMLONG(CMA_FLWINDOWATTR)); 3505 } 3506 } 3507 } 3508 if (fDeleteState) 3509 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3510 if (!PostMsg(hwndCnr, UM_SETUP2, NULL, NULL)) 3511 WinSendMsg(hwndCnr, UM_SETUP2, NULL, NULL); 3512 } 3513 } 3514 fRestored = TRUE; 3515 swp.hwnd = hwndDir; 3516 TransformSwp(&swp, xtrans, ytrans); 3517 if (swp.fl & (SWP_HIDE | SWP_MINIMIZE)) { 3518 WinSetWindowPos(hwndDir, 3519 HWND_TOP, 0, 0, 0, 0, SWP_MINIMIZE | SWP_SHOW); 3520 WinSetWindowUShort(hwndDir, QWS_XRESTORE, (USHORT) swp.x); 3521 WinSetWindowUShort(hwndDir, QWS_CXRESTORE, (USHORT) swp.cx); 3522 WinSetWindowUShort(hwndDir, QWS_YRESTORE, (USHORT) swp.y); 3523 WinSetWindowUShort(hwndDir, QWS_CYRESTORE, (USHORT) swp.cy); 3524 } else 3525 WinSetWindowPos(hwndDir, 3526 HWND_TOP, 3527 swp.x, 3528 swp.y, 3529 swp.cx, 3530 swp.cy, 3531 swp.fl | SWP_MOVE | 3532 SWP_SIZE | SWP_SHOW | SWP_ZORDER | 3533 SWP_ACTIVATE); 3534 } 3535 } 3486 3536 } 3487 3537 } // for … … 3512 3562 if (ulNumMinChildren) { 3513 3563 if (WinQueryWindowPos(hwndChild, &swp) && (swp.fl & SWP_MINIMIZE)) 3514 (*ulNumMinChildren)++;3564 (*ulNumMinChildren)++; 3515 3565 } 3516 3566 } … … 3520 3570 3521 3571 VOID GetNextWindowPos(HWND hwndClient, PSWP pswp, ULONG * ulCntR, 3522 ULONG * ulNumMinChildrenR)3572 ULONG * ulNumMinChildrenR) 3523 3573 { 3524 3574 register ULONG ulCnt; … … 3584 3634 if (!(swp.fl & (SWP_MAXIMIZE | SWP_HIDE | SWP_MINIMIZE))) { 3585 3635 if (swp.y + swp.cy < Rectl.yTop - Rectl.yBottom) 3586 swp.cy = (Rectl.yTop - Rectl.yBottom) - swp.y;3636 swp.cy = (Rectl.yTop - Rectl.yBottom) - swp.y; 3587 3637 if (swp.x != 0) 3588 swp.x = 0;3638 swp.x = 0; 3589 3639 if (swp.y < 0) 3590 swp.y = 0;3640 swp.y = 0; 3591 3641 if (swp.x + swp.cx > Rectl.xRight - Rectl.xLeft) 3592 swp.cx = Rectl.xRight - Rectl.xLeft;3642 swp.cx = Rectl.xRight - Rectl.xLeft; 3593 3643 WinSetWindowPos(hwndTree, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy, 3594 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE);3644 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE); 3595 3645 } 3596 3646 } … … 3604 3654 GetNextWindowPos(hwndClient, &swp, &ulCnt, &ulNumMinChildren); 3605 3655 WinSetWindowPos(hwndChild, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy, 3606 SWP_SIZE | SWP_MOVE | SWP_SHOW | SWP_RESTORE |3607 SWP_ZORDER | SWP_ACTIVATE);3656 SWP_SIZE | SWP_MOVE | SWP_SHOW | SWP_RESTORE | 3657 SWP_ZORDER | SWP_ACTIVATE); 3608 3658 ulCnt++; 3609 3659 } … … 3658 3708 if (!(swp.fl & (SWP_MAXIMIZE | SWP_HIDE | SWP_MINIMIZE))) { 3659 3709 if (swp.y < 0) 3660 swp.y = 0;3710 swp.y = 0; 3661 3711 if (swp.y + swp.cy < Rectl.yTop - Rectl.yBottom) 3662 swp.cy = (Rectl.yTop - Rectl.yBottom) - swp.y;3712 swp.cy = (Rectl.yTop - Rectl.yBottom) - swp.y; 3663 3713 if (swp.x != 0) 3664 swp.x = 0;3714 swp.x = 0; 3665 3715 if (swp.x + swp.cx > Rectl.xRight - Rectl.xLeft) 3666 swp.cx = Rectl.xRight - Rectl.xLeft;3716 swp.cx = Rectl.xRight - Rectl.xLeft; 3667 3717 WinSetWindowPos(hwndTree, 3668 HWND_TOP,3669 swp.x,3670 swp.y,3671 swp.cx,3672 swp.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE);3718 HWND_TOP, 3719 swp.x, 3720 swp.y, 3721 swp.cx, 3722 swp.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE); 3673 3723 WinQueryWindowPos(hwndTree, &swp); 3674 3724 } … … 3695 3745 3696 3746 for (ulCurRow = 0; ulCurRow < ulNumRows; ulCurRow++) { 3697 if ((ulNumRows - ulCurRow) <= ulExtraCols)3698 ulNumCols++;3699 for (ulCurCol = 0; ulCurCol < ulNumCols; ulCurCol++) {3700 ulWidth = Rectl.xRight / ulNumCols;3701 3702 while (hwndChild) {3703 id = WinQueryWindowUShort(hwndChild, QWS_ID);3704 if (id && (id != TREE_FRAME || fFreeTree)) {3705 WinQueryWindowPos(hwndChild, &swp);3706 if (!(swp.fl & (SWP_HIDE | SWP_MINIMIZE)))3707 break;3708 }3709 hwndChild = WinGetNextWindow(henum);3710 }3711 3712 if (hwndChild) {3713 if (!absolute && (swp.fl & SWP_MAXIMIZE)) {3714 WinGetMaxPosition(hwndChild, &swp);3715 WinSetWindowPos(hwndChild,3716 HWND_TOP,3717 swp.x,3718 swp.y,3719 swp.cx, swp.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW);3720 WinSetWindowUShort(hwndChild,3721 QWS_XRESTORE,3722 (USHORT) (ulWidth * ulCurCol) + Rectl.xLeft);3723 WinSetWindowUShort(hwndChild,3724 QWS_YRESTORE,3725 (USHORT) (Rectl.yTop -3726 (ulHeight * (ulCurRow + 1))));3727 WinSetWindowUShort(hwndChild, QWS_CXRESTORE, (USHORT) ulWidth);3728 WinSetWindowUShort(hwndChild, QWS_CYRESTORE, (USHORT) ulHeight);3729 }3730 else3731 WinSetWindowPos(hwndChild,3732 HWND_TOP,3733 (ulWidth * ulCurCol) + Rectl.xLeft,3734 Rectl.yTop - (ulHeight * (ulCurRow + 1)),3735 ulWidth,3736 ulHeight,3737 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE);3738 hwndChild = WinGetNextWindow(henum);3739 }3740 }3741 if ((ulNumRows - ulCurRow) <= ulExtraCols) {3742 ulNumCols--;3743 ulExtraCols--;3744 }3747 if ((ulNumRows - ulCurRow) <= ulExtraCols) 3748 ulNumCols++; 3749 for (ulCurCol = 0; ulCurCol < ulNumCols; ulCurCol++) { 3750 ulWidth = Rectl.xRight / ulNumCols; 3751 3752 while (hwndChild) { 3753 id = WinQueryWindowUShort(hwndChild, QWS_ID); 3754 if (id && (id != TREE_FRAME || fFreeTree)) { 3755 WinQueryWindowPos(hwndChild, &swp); 3756 if (!(swp.fl & (SWP_HIDE | SWP_MINIMIZE))) 3757 break; 3758 } 3759 hwndChild = WinGetNextWindow(henum); 3760 } 3761 3762 if (hwndChild) { 3763 if (!absolute && (swp.fl & SWP_MAXIMIZE)) { 3764 WinGetMaxPosition(hwndChild, &swp); 3765 WinSetWindowPos(hwndChild, 3766 HWND_TOP, 3767 swp.x, 3768 swp.y, 3769 swp.cx, swp.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW); 3770 WinSetWindowUShort(hwndChild, 3771 QWS_XRESTORE, 3772 (USHORT) (ulWidth * ulCurCol) + Rectl.xLeft); 3773 WinSetWindowUShort(hwndChild, 3774 QWS_YRESTORE, 3775 (USHORT) (Rectl.yTop - 3776 (ulHeight * (ulCurRow + 1)))); 3777 WinSetWindowUShort(hwndChild, QWS_CXRESTORE, (USHORT) ulWidth); 3778 WinSetWindowUShort(hwndChild, QWS_CYRESTORE, (USHORT) ulHeight); 3779 } 3780 else 3781 WinSetWindowPos(hwndChild, 3782 HWND_TOP, 3783 (ulWidth * ulCurCol) + Rectl.xLeft, 3784 Rectl.yTop - (ulHeight * (ulCurRow + 1)), 3785 ulWidth, 3786 ulHeight, 3787 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE); 3788 hwndChild = WinGetNextWindow(henum); 3789 } 3790 } 3791 if ((ulNumRows - ulCurRow) <= ulExtraCols) { 3792 ulNumCols--; 3793 ulExtraCols--; 3794 } 3745 3795 } 3746 3796 } … … 3752 3802 3753 3803 static VOID ResizeChildren(HWND hwndClient, SHORT oldcx, SHORT oldcy, 3754 SHORT newcx, SHORT newcy)3804 SHORT newcx, SHORT newcy) 3755 3805 { 3756 3806 /* … … 3770 3820 while ((hwndChild = WinGetNextWindow(henum)) != NULLHANDLE) { 3771 3821 if (!WinQueryWindowUShort(hwndChild, QWS_ID)) 3772 continue;3822 continue; 3773 3823 if (WinQueryWindowPos(hwndChild, &swp)) { 3774 if (swp.fl & (SWP_MINIMIZE | SWP_HIDE)) {3775 swp.x = WinQueryWindowUShort(hwndChild, QWS_XRESTORE);3776 swp.y = WinQueryWindowUShort(hwndChild, QWS_YRESTORE);3777 swp.cx = WinQueryWindowUShort(hwndChild, QWS_CXRESTORE);3778 swp.cy = WinQueryWindowUShort(hwndChild, QWS_CYRESTORE);3779 }3780 else if (swp.fl & SWP_MAXIMIZE) {3781 swp.x = WinQueryWindowUShort(hwndChild, QWS_XRESTORE);3782 swp.y = WinQueryWindowUShort(hwndChild, QWS_YRESTORE);3783 swp.cx = WinQueryWindowUShort(hwndChild, QWS_CXRESTORE);3784 swp.cy = WinQueryWindowUShort(hwndChild, QWS_CYRESTORE);3785 }3786 cx = (swp.cx) ? (LONG) (((double)oldcx * 100.0) / (double)swp.cx) : 0;3787 cy = (swp.cy) ? (LONG) (((double)oldcy * 100.0) / (double)swp.cy) : 0;3788 x = (swp.x) ? (LONG) (((double)oldcx * 100.0) / (double)swp.x) : 0;3789 y = (swp.y) ? (LONG) (((double)oldcy * 100.0) / (double)swp.y) : 0;3790 if (x < 0)3791 x = 0;3792 if (y < 0)3793 y = 0;3794 ux = (x) ? (LONG) (((double)newcx * 100.0) / (double)x) : 0;3795 uy = (y) ? (LONG) (((double)newcy * 100.0) / (double)y) : 0;3796 ucx = (cx) ? (LONG) (((double)newcx * 100.0) / (double)cx) : 0;3797 ucy = (cy) ? (LONG) (((double)newcy * 100.0) / (double)cy) : 0;3798 if (ux + ucx > newcx)3799 ucx = newcx - ux;3800 if (uy + ucy > newcy)3801 ucy = newcy - uy;3802 3803 if (!(swp.fl & (SWP_MINIMIZE | SWP_HIDE | SWP_MAXIMIZE)))3804 WinSetWindowPos(hwndChild, HWND_TOP, ux, uy, ucx, ucy,3805 SWP_MOVE | SWP_SIZE | SWP_SHOW);3806 else if (swp.fl & (SWP_HIDE | SWP_MINIMIZE)) {3807 WinSetWindowUShort(hwndChild, QWS_XMINIMIZE, (USHORT) - 1);3808 WinSetWindowUShort(hwndChild, QWS_YMINIMIZE, (USHORT) - 1);3809 WinSetWindowPos(hwndChild, HWND_TOP, 0, 0, 0, 0,3810 SWP_SIZE | SWP_MOVE | SWP_FOCUSDEACTIVATE);3811 WinSetWindowUShort(hwndChild, QWS_XRESTORE, ux);3812 WinSetWindowUShort(hwndChild, QWS_YRESTORE, uy);3813 WinSetWindowUShort(hwndChild, QWS_CXRESTORE, ucx);3814 WinSetWindowUShort(hwndChild, QWS_CYRESTORE, ucy);3815 }3816 else {3817 WinGetMaxPosition(hwndChild, &swp);3818 WinSetWindowPos(hwndChild, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy,3819 SWP_MOVE | SWP_SIZE | SWP_SHOW);3820 WinSetWindowUShort(hwndChild, QWS_XRESTORE, ux);3821 WinSetWindowUShort(hwndChild, QWS_YRESTORE, uy);3822 WinSetWindowUShort(hwndChild, QWS_CXRESTORE, ucx);3823 WinSetWindowUShort(hwndChild, QWS_CYRESTORE, ucy);3824 }3824 if (swp.fl & (SWP_MINIMIZE | SWP_HIDE)) { 3825 swp.x = WinQueryWindowUShort(hwndChild, QWS_XRESTORE); 3826 swp.y = WinQueryWindowUShort(hwndChild, QWS_YRESTORE); 3827 swp.cx = WinQueryWindowUShort(hwndChild, QWS_CXRESTORE); 3828 swp.cy = WinQueryWindowUShort(hwndChild, QWS_CYRESTORE); 3829 } 3830 else if (swp.fl & SWP_MAXIMIZE) { 3831 swp.x = WinQueryWindowUShort(hwndChild, QWS_XRESTORE); 3832 swp.y = WinQueryWindowUShort(hwndChild, QWS_YRESTORE); 3833 swp.cx = WinQueryWindowUShort(hwndChild, QWS_CXRESTORE); 3834 swp.cy = WinQueryWindowUShort(hwndChild, QWS_CYRESTORE); 3835 } 3836 cx = (swp.cx) ? (LONG) (((double)oldcx * 100.0) / (double)swp.cx) : 0; 3837 cy = (swp.cy) ? (LONG) (((double)oldcy * 100.0) / (double)swp.cy) : 0; 3838 x = (swp.x) ? (LONG) (((double)oldcx * 100.0) / (double)swp.x) : 0; 3839 y = (swp.y) ? (LONG) (((double)oldcy * 100.0) / (double)swp.y) : 0; 3840 if (x < 0) 3841 x = 0; 3842 if (y < 0) 3843 y = 0; 3844 ux = (x) ? (LONG) (((double)newcx * 100.0) / (double)x) : 0; 3845 uy = (y) ? (LONG) (((double)newcy * 100.0) / (double)y) : 0; 3846 ucx = (cx) ? (LONG) (((double)newcx * 100.0) / (double)cx) : 0; 3847 ucy = (cy) ? (LONG) (((double)newcy * 100.0) / (double)cy) : 0; 3848 if (ux + ucx > newcx) 3849 ucx = newcx - ux; 3850 if (uy + ucy > newcy) 3851 ucy = newcy - uy; 3852 3853 if (!(swp.fl & (SWP_MINIMIZE | SWP_HIDE | SWP_MAXIMIZE))) 3854 WinSetWindowPos(hwndChild, HWND_TOP, ux, uy, ucx, ucy, 3855 SWP_MOVE | SWP_SIZE | SWP_SHOW); 3856 else if (swp.fl & (SWP_HIDE | SWP_MINIMIZE)) { 3857 WinSetWindowUShort(hwndChild, QWS_XMINIMIZE, (USHORT) - 1); 3858 WinSetWindowUShort(hwndChild, QWS_YMINIMIZE, (USHORT) - 1); 3859 WinSetWindowPos(hwndChild, HWND_TOP, 0, 0, 0, 0, 3860 SWP_SIZE | SWP_MOVE | SWP_FOCUSDEACTIVATE); 3861 WinSetWindowUShort(hwndChild, QWS_XRESTORE, ux); 3862 WinSetWindowUShort(hwndChild, QWS_YRESTORE, uy); 3863 WinSetWindowUShort(hwndChild, QWS_CXRESTORE, ucx); 3864 WinSetWindowUShort(hwndChild, QWS_CYRESTORE, ucy); 3865 } 3866 else { 3867 WinGetMaxPosition(hwndChild, &swp); 3868 WinSetWindowPos(hwndChild, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy, 3869 SWP_MOVE | SWP_SIZE | SWP_SHOW); 3870 WinSetWindowUShort(hwndChild, QWS_XRESTORE, ux); 3871 WinSetWindowUShort(hwndChild, QWS_YRESTORE, uy); 3872 WinSetWindowUShort(hwndChild, QWS_CXRESTORE, ucx); 3873 WinSetWindowUShort(hwndChild, QWS_CYRESTORE, ucy); 3874 } 3825 3875 } 3826 3876 } … … 3838 3888 3839 3889 if (!fNoTreeGap) { 3840 INT height = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 2;3841 if (swp.y < height)3842 swp.y = height; // Force bottom to position3890 INT height = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 2; 3891 if (swp.y < height) 3892 swp.y = height; // Force bottom to position 3843 3893 } 3844 3894 else 3845 swp.y = 0; // Force bottom to position3895 swp.y = 0; // Force bottom to position 3846 3896 3847 3897 swp.cy = (Rectl.yTop - Rectl.yBottom) - swp.y; 3848 3898 if (swp.cy < 0) 3849 swp.cy = 0;3899 swp.cy = 0; 3850 3900 3851 3901 if (swp.x != 0) 3852 swp.x = 0; // Left align3902 swp.x = 0; // Left align 3853 3903 3854 3904 // AdjustSizeOfClient can return bogus xRight values - fixme someday 3855 3905 if (Rectl.xRight >= Rectl.xLeft) { 3856 if (swp.x + swp.cx > Rectl.xRight - Rectl.xLeft)3857 swp.cx = Rectl.xRight - Rectl.xLeft;3906 if (swp.x + swp.cx > Rectl.xRight - Rectl.xLeft) 3907 swp.cx = Rectl.xRight - Rectl.xLeft; 3858 3908 } 3859 3909 WinSetWindowPos(hwndTree, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy, 3860 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE);3910 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE); 3861 3911 } 3862 3912 } … … 3886 3936 3887 3937 static MRESULT EXPENTRY ChildFrameButtonProc(HWND hwnd, 3888 ULONG msg,3889 MPARAM mp1, MPARAM mp2)3938 ULONG msg, 3939 MPARAM mp1, MPARAM mp2) 3890 3940 { 3891 3941 USHORT id; … … 3901 3951 if (fOtherHelp) { 3902 3952 if ((!hwndBubble || WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) 3903 && !WinQueryCapture(HWND_DESKTOP)) {3904 id = WinQueryWindowUShort(hwnd, QWS_ID);3905 switch (id) {3906 case IDM_OPENWALK:3907 MakeBubble(hwnd, FALSE, GetPString(IDS_WALKBUTTONHELP));3908 break;3909 case IDM_USERLIST:3910 MakeBubble(hwnd, FALSE, GetPString(IDS_QUICKBUTTONHELP));3911 break;3912 }3953 && !WinQueryCapture(HWND_DESKTOP)) { 3954 id = WinQueryWindowUShort(hwnd, QWS_ID); 3955 switch (id) { 3956 case IDM_OPENWALK: 3957 MakeBubble(hwnd, FALSE, GetPString(IDS_WALKBUTTONHELP)); 3958 break; 3959 case IDM_USERLIST: 3960 MakeBubble(hwnd, FALSE, GetPString(IDS_QUICKBUTTONHELP)); 3961 break; 3962 } 3913 3963 } 3914 3964 } … … 3924 3974 switch (id) { 3925 3975 case IDM_OPENWALK: 3926 switch (msg) {3927 case WM_BUTTON2CLICK:3928 if ((shiftstate & (KC_ALT | KC_SHIFT | KC_CTRL)) ==3929 (KC_ALT | KC_SHIFT | KC_CTRL))3930 cmd = IDM_GREP;3931 else if ((shiftstate & (KC_ALT | KC_CTRL)) == (KC_ALT | KC_CTRL))3932 CascadeChildren(hwndMain);3976 switch (msg) { 3977 case WM_BUTTON2CLICK: 3978 if ((shiftstate & (KC_ALT | KC_SHIFT | KC_CTRL)) == 3979 (KC_ALT | KC_SHIFT | KC_CTRL)) 3980 cmd = IDM_GREP; 3981 else if ((shiftstate & (KC_ALT | KC_CTRL)) == (KC_ALT | KC_CTRL)) 3982 CascadeChildren(hwndMain); 3933 3983 3934 3984 #ifdef NEVER 3935 else if ((shiftstate & (KC_ALT | KC_SHIFT)) == (KC_ALT | KC_SHIFT))3936 cmd = IDM_SYSINFO;3985 else if ((shiftstate & (KC_ALT | KC_SHIFT)) == (KC_ALT | KC_SHIFT)) 3986 cmd = IDM_SYSINFO; 3937 3987 #endif 3938 3988 3939 else if (shiftstate & KC_SHIFT)3940 cmd = IDM_WINDOWDLG;3941 else if (shiftstate & KC_CTRL)3942 cmd = IDM_SEEALL;3943 else if (shiftstate & KC_ALT)3944 TileChildren(hwndMain, TRUE);3945 else3946 cmd = IDM_WALKDIR;3947 break;3948 case WM_BUTTON3CLICK:3949 TileChildren(hwndMain, TRUE);3950 break;3951 }3952 break;3989 else if (shiftstate & KC_SHIFT) 3990 cmd = IDM_WINDOWDLG; 3991 else if (shiftstate & KC_CTRL) 3992 cmd = IDM_SEEALL; 3993 else if (shiftstate & KC_ALT) 3994 TileChildren(hwndMain, TRUE); 3995 else 3996 cmd = IDM_WALKDIR; 3997 break; 3998 case WM_BUTTON3CLICK: 3999 TileChildren(hwndMain, TRUE); 4000 break; 4001 } 4002 break; 3953 4003 case IDM_USERLIST: 3954 switch (msg) {3955 case WM_BUTTON2CLICK:3956 if ((shiftstate & (KC_ALT | KC_SHIFT | KC_CTRL)) ==3957 (KC_ALT | KC_SHIFT | KC_CTRL))3958 cmd = IDM_COLORPALETTE;3959 else if ((shiftstate & (KC_ALT | KC_CTRL)) == (KC_ALT | KC_CTRL))3960 cmd = IDM_HIDEMENU;3961 else if ((shiftstate & (KC_ALT | KC_SHIFT)) == (KC_ALT | KC_SHIFT))3962 cmd = IDM_NOTEBOOK;3963 else if (shiftstate & KC_SHIFT)3964 cmd = IDM_TOOLTITLES;3965 else if (shiftstate & KC_CTRL)3966 cmd = IDM_TEXTTOOLS;3967 else if (shiftstate & KC_ALT)3968 cmd = IDM_FONTPALETTE;3969 else3970 cmd = IDM_TOOLBAR;3971 break;3972 case WM_BUTTON3CLICK:3973 cmd = IDM_DRIVEBAR;3974 break;3975 }3976 break;4004 switch (msg) { 4005 case WM_BUTTON2CLICK: 4006 if ((shiftstate & (KC_ALT | KC_SHIFT | KC_CTRL)) == 4007 (KC_ALT | KC_SHIFT | KC_CTRL)) 4008 cmd = IDM_COLORPALETTE; 4009 else if ((shiftstate & (KC_ALT | KC_CTRL)) == (KC_ALT | KC_CTRL)) 4010 cmd = IDM_HIDEMENU; 4011 else if ((shiftstate & (KC_ALT | KC_SHIFT)) == (KC_ALT | KC_SHIFT)) 4012 cmd = IDM_NOTEBOOK; 4013 else if (shiftstate & KC_SHIFT) 4014 cmd = IDM_TOOLTITLES; 4015 else if (shiftstate & KC_CTRL) 4016 cmd = IDM_TEXTTOOLS; 4017 else if (shiftstate & KC_ALT) 4018 cmd = IDM_FONTPALETTE; 4019 else 4020 cmd = IDM_TOOLBAR; 4021 break; 4022 case WM_BUTTON3CLICK: 4023 cmd = IDM_DRIVEBAR; 4024 break; 4025 } 4026 break; 3977 4027 } // switch id 3978 4028 3979 4029 if (cmd) { 3980 PostMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), FID_CLIENT),3981 WM_COMMAND, MPFROM2SHORT(cmd, 0), MPVOID);4030 PostMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), FID_CLIENT), 4031 WM_COMMAND, MPFROM2SHORT(cmd, 0), MPVOID); 3982 4032 } 3983 4033 } … … 3988 4038 if (id == IDM_OPENWALK) { 3989 4039 if (!emphasized) { 3990 emphasized = TRUE;3991 DrawTargetEmphasis(hwnd, emphasized);4040 emphasized = TRUE; 4041 DrawTargetEmphasis(hwnd, emphasized); 3992 4042 } 3993 4043 if (AcceptOneDrop(hwnd, mp1, mp2)) 3994 return MRFROM2SHORT(DOR_DROP, DO_MOVE);4044 return MRFROM2SHORT(DOR_DROP, DO_MOVE); 3995 4045 } 3996 4046 return MRFROM2SHORT(DOR_NEVERDROP, 0); … … 4012 4062 4013 4063 if (emphasized) { 4014 emphasized = FALSE;4015 DrawTargetEmphasis(hwnd, emphasized);4064 emphasized = FALSE; 4065 DrawTargetEmphasis(hwnd, emphasized); 4016 4066 } 4017 4067 if (GetOneDrop(hwnd, mp1, mp2, szFrom, sizeof(szFrom))) { 4018 if (MakeValidDir(szFrom) && !FindDirCnrByName(szFrom, TRUE)) {4019 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, szFrom);4020 }4068 if (MakeValidDir(szFrom) && !FindDirCnrByName(szFrom, TRUE)) { 4069 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, szFrom); 4070 } 4021 4071 } 4022 4072 } … … 4031 4081 4032 4082 static MRESULT EXPENTRY MainFrameWndProc(HWND hwnd, ULONG msg, MPARAM mp1, 4033 MPARAM mp2)4083 MPARAM mp2) 4034 4084 { 4035 4085 PFNWP oldproc = (PFNWP) WinQueryWindowPtr(hwnd, QWL_USER); … … 4043 4093 pswp = (SWP *) mp1; 4044 4094 if (fDataMin && !fAmClosing) { 4045 if (pswp->fl & (SWP_HIDE | SWP_MINIMIZE)) {4046 4047 SWP swp;4048 4049 WinQueryWindowPos(hwnd, &swp);4050 PostMsg(hwnd, UM_FOCUSME, MPFROMLONG(swp.fl), MPVOID);4051 HideNote();4052 }4053 else if (pswp->fl & (SWP_SHOW | SWP_RESTORE)) {4054 if (DataHwnd)4055 PostMsg(DataHwnd, WM_CLOSE, MPVOID, MPVOID);4056 }4095 if (pswp->fl & (SWP_HIDE | SWP_MINIMIZE)) { 4096 4097 SWP swp; 4098 4099 WinQueryWindowPos(hwnd, &swp); 4100 PostMsg(hwnd, UM_FOCUSME, MPFROMLONG(swp.fl), MPVOID); 4101 HideNote(); 4102 } 4103 else if (pswp->fl & (SWP_SHOW | SWP_RESTORE)) { 4104 if (DataHwnd) 4105 PostMsg(DataHwnd, WM_CLOSE, MPVOID, MPVOID); 4106 } 4057 4107 } 4058 4108 if (!fAmClosing) { 4059 if (pswp->fl & (SWP_HIDE | SWP_MINIMIZE))4060 HideNote();4109 if (pswp->fl & (SWP_HIDE | SWP_MINIMIZE)) 4110 HideNote(); 4061 4111 } 4062 4112 } … … 4081 4131 case WM_CONTROL: 4082 4132 return WinSendMsg(WinWindowFromID(hwnd, FID_CLIENT), UM_CONTROL, mp1, 4083 mp2);4133 mp2); 4084 4134 4085 4135 case WM_COMMAND: … … 4101 4151 4102 4152 if (mr && mp2) { 4103 prectl = (PRECTL) mp1;4104 if (prectl->yBottom != prectl->yTop) {4105 {4106 HPS hps;4107 POINTL aptl[TXTBOX_COUNT];4108 4109 hps = WinGetPS(hwndStatus);4110 if (hps) {4111 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl);4112 bheight = sheight = aptl[TXTBOX_TOPLEFT].y + 6;4113 WinReleasePS(hps);4114 }4115 }4116 prectl->yBottom += (sheight + 4);4117 prectl->yTop -= (sheight + 4);4118 if (fMoreButtons) {4119 4120 HPS hps;4121 POINTL aptl[TXTBOX_COUNT];4122 4123 hps = WinGetPS(hwndName);4124 if (hps) {4125 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl);4126 bheight = aptl[TXTBOX_TOPLEFT].y + 6;4127 WinReleasePS(hps);4128 }4129 prectl->yBottom += (bheight + 4);4130 prectl->yTop -= (bheight + 4);4131 }4132 if (fToolbar) {4133 if (!fTextTools)4134 prectl->yTop -= ((fToolTitles) ? 50 : 40);4135 else4136 prectl->yTop -= 32;4137 }4138 if (fDrivebar) {4139 ResizeDrives(WinWindowFromID(hwnd, MAIN_DRIVES),4140 ((prectl->xRight -4141 (WinQuerySysValue(HWND_DESKTOP,4142 SV_CYSIZEBORDER) * 2)) - 4));4143 prectl->yTop -= (16 * (DriveLines * 18));4144 }4145 if (fUserComboBox) {4146 if (!aheight) {4147 4148 SWP swpTemp;4149 4150 WinQueryWindowPos(WinWindowFromID(hwndDrivelist, CBID_EDIT),4151 &swpTemp);4152 aheight = swpTemp.cy;4153 }4154 prectl->yTop -= (aheight + 6L);4155 }4156 if (fAutoView) {4157 AutoviewHeight = min(AutoviewHeight,4158 (prectl->yTop - prectl->yBottom) - 116);4159 AutoviewHeight = max(AutoviewHeight, 36);4160 prectl->yBottom += (AutoviewHeight + 6);4161 }4162 }4153 prectl = (PRECTL) mp1; 4154 if (prectl->yBottom != prectl->yTop) { 4155 { 4156 HPS hps; 4157 POINTL aptl[TXTBOX_COUNT]; 4158 4159 hps = WinGetPS(hwndStatus); 4160 if (hps) { 4161 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl); 4162 bheight = sheight = aptl[TXTBOX_TOPLEFT].y + 6; 4163 WinReleasePS(hps); 4164 } 4165 } 4166 prectl->yBottom += (sheight + 4); 4167 prectl->yTop -= (sheight + 4); 4168 if (fMoreButtons) { 4169 4170 HPS hps; 4171 POINTL aptl[TXTBOX_COUNT]; 4172 4173 hps = WinGetPS(hwndName); 4174 if (hps) { 4175 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl); 4176 bheight = aptl[TXTBOX_TOPLEFT].y + 6; 4177 WinReleasePS(hps); 4178 } 4179 prectl->yBottom += (bheight + 4); 4180 prectl->yTop -= (bheight + 4); 4181 } 4182 if (fToolbar) { 4183 if (!fTextTools) 4184 prectl->yTop -= ((fToolTitles) ? 50 : 40); 4185 else 4186 prectl->yTop -= 32; 4187 } 4188 if (fDrivebar) { 4189 ResizeDrives(WinWindowFromID(hwnd, MAIN_DRIVES), 4190 ((prectl->xRight - 4191 (WinQuerySysValue(HWND_DESKTOP, 4192 SV_CYSIZEBORDER) * 2)) - 4)); 4193 prectl->yTop -= (16 * (DriveLines * 18)); 4194 } 4195 if (fUserComboBox) { 4196 if (!aheight) { 4197 4198 SWP swpTemp; 4199 4200 WinQueryWindowPos(WinWindowFromID(hwndDrivelist, CBID_EDIT), 4201 &swpTemp); 4202 aheight = swpTemp.cy; 4203 } 4204 prectl->yTop -= (aheight + 6L); 4205 } 4206 if (fAutoView) { 4207 AutoviewHeight = min(AutoviewHeight, 4208 (prectl->yTop - prectl->yBottom) - 116); 4209 AutoviewHeight = max(AutoviewHeight, 36); 4210 prectl->yBottom += (AutoviewHeight + 6); 4211 } 4212 } 4163 4213 } 4164 4214 return mr; … … 4184 4234 pswp = (PSWP) mp1; 4185 4235 { 4186 SHORT x;4187 4188 for (x = 0; x < soldCount; x++) {4189 if (WinQueryWindowUShort(pswp->hwnd, QWS_ID) == FID_CLIENT) {4190 pswpClient = pswp;4191 break;4192 }4193 pswp++;4194 }4236 SHORT x; 4237 4238 for (x = 0; x < soldCount; x++) { 4239 if (WinQueryWindowUShort(pswp->hwnd, QWS_ID) == FID_CLIENT) { 4240 pswpClient = pswp; 4241 break; 4242 } 4243 pswp++; 4244 } 4195 4245 } 4196 4246 4197 4247 { 4198 HPS hps;4199 POINTL aptl[TXTBOX_COUNT];4200 4201 hps = WinGetPS(hwndStatus);4202 if (hps) {4203 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl);4204 bheight = sheight = aptl[TXTBOX_TOPLEFT].y + 6;4205 WinReleasePS(hps);4206 }4207 if (fMoreButtons) {4208 hps = WinGetPS(hwndName);4209 if (hps) {4210 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl);4211 bheight = aptl[TXTBOX_TOPLEFT].y + 6;4212 WinReleasePS(hps);4213 }4214 }4248 HPS hps; 4249 POINTL aptl[TXTBOX_COUNT]; 4250 4251 hps = WinGetPS(hwndStatus); 4252 if (hps) { 4253 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl); 4254 bheight = sheight = aptl[TXTBOX_TOPLEFT].y + 6; 4255 WinReleasePS(hps); 4256 } 4257 if (fMoreButtons) { 4258 hps = WinGetPS(hwndName); 4259 if (hps) { 4260 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl); 4261 bheight = aptl[TXTBOX_TOPLEFT].y + 6; 4262 WinReleasePS(hps); 4263 } 4264 } 4215 4265 } 4216 4266 pswpNew = (PSWP) mp1 + soldCount; … … 4222 4272 pswpNew->y = swpClient.y + 2; 4223 4273 if (!fSplitStatus) 4224 width = swpClient.cx - (16 + (sheight * 2) + 4);4274 width = swpClient.cx - (16 + (sheight * 2) + 4); 4225 4275 else 4226 width = (swpClient.cx - (16 + (sheight * 2) + 4)) / 2;4276 width = (swpClient.cx - (16 + (sheight * 2) + 4)) / 2; 4227 4277 width = max(width, 10); 4228 4278 if (fSplitStatus) 4229 pswpNew->cx = width - 6;4279 pswpNew->cx = width - 6; 4230 4280 else 4231 pswpNew->cx = width - 8;4281 pswpNew->cx = width - 8; 4232 4282 pswpNew->cy = sheight; 4233 4283 pswpClient->y = pswpNew->y + pswpNew->cy + 3; … … 4236 4286 4237 4287 if (fSplitStatus) { 4238 pswpNew = (PSWP) mp1 + (soldCount + 1);4239 *pswpNew = *pswpClient;4240 pswpNew->hwnd = hwndStatus2;4241 pswpNew->hwndInsertBehind = HWND_BOTTOM;4242 pswpNew->x = width + 8;4243 pswpNew->y = swpClient.y + 2;4244 pswpNew->cx = width - 6;4245 pswpNew->cy = sheight;4246 sCount++;4288 pswpNew = (PSWP) mp1 + (soldCount + 1); 4289 *pswpNew = *pswpClient; 4290 pswpNew->hwnd = hwndStatus2; 4291 pswpNew->hwndInsertBehind = HWND_BOTTOM; 4292 pswpNew->x = width + 8; 4293 pswpNew->y = swpClient.y + 2; 4294 pswpNew->cx = width - 6; 4295 pswpNew->cy = sheight; 4296 sCount++; 4247 4297 } 4248 4298 else { 4249 WinShowWindow(hwndStatus2, FALSE);4250 WinSetWindowText(hwndStatus2, NullStr);4299 WinShowWindow(hwndStatus2, FALSE); 4300 WinSetWindowText(hwndStatus2, NullStr); 4251 4301 } 4252 4302 4253 4303 if (fToolbar) { 4254 if (fTextTools)4255 theight = 32L;4256 else if (!fToolTitles)4257 theight = 40L;4258 pswpNew = (PSWP) mp1 + (soldCount + 1 + (fSplitStatus != FALSE));4259 *pswpNew = *pswpClient;4260 pswpNew->hwnd = WinWindowFromID(hwnd, MAIN_TOOLS);4261 pswpNew->hwndInsertBehind = HWND_BOTTOM;4262 pswpNew->x = swpClient.x + 2;4263 pswpNew->y = (swpClient.y + swpClient.cy) - (theight - 2);4264 pswpNew->cx = swpClient.cx - 4;4265 pswpNew->cy = theight - 4;4266 pswpClient->cy -= theight;4267 sCount++;4304 if (fTextTools) 4305 theight = 32L; 4306 else if (!fToolTitles) 4307 theight = 40L; 4308 pswpNew = (PSWP) mp1 + (soldCount + 1 + (fSplitStatus != FALSE)); 4309 *pswpNew = *pswpClient; 4310 pswpNew->hwnd = WinWindowFromID(hwnd, MAIN_TOOLS); 4311 pswpNew->hwndInsertBehind = HWND_BOTTOM; 4312 pswpNew->x = swpClient.x + 2; 4313 pswpNew->y = (swpClient.y + swpClient.cy) - (theight - 2); 4314 pswpNew->cx = swpClient.cx - 4; 4315 pswpNew->cy = theight - 4; 4316 pswpClient->cy -= theight; 4317 sCount++; 4268 4318 } 4269 4319 else 4270 WinShowWindow(WinWindowFromID(hwnd, MAIN_TOOLS), FALSE);4320 WinShowWindow(WinWindowFromID(hwnd, MAIN_TOOLS), FALSE); 4271 4321 4272 4322 if (fDrivebar) { 4273 ResizeDrives(WinWindowFromID(hwnd, MAIN_DRIVES), pswpClient->cx - 4);4274 pswpNew = (PSWP) mp1 + (soldCount + 1 +4275 (fSplitStatus != FALSE) +4276 (fToolbar != FALSE));4277 *pswpNew = *pswpClient;4278 pswpNew->hwnd = WinWindowFromID(hwnd, MAIN_DRIVES);4279 pswpNew->hwndInsertBehind = HWND_BOTTOM;4280 pswpNew->x = swpClient.x + 2;4281 dheight += ((dheight - 2) * DriveLines);4282 pswpNew->y = (swpClient.y + swpClient.cy) - (dheight - 2);4283 if (fToolbar)4284 pswpNew->y -= theight;4285 pswpNew->cx = swpClient.cx - 4;4286 pswpNew->cy = dheight - 4;4287 pswpClient->cy -= dheight;4288 sCount++;4323 ResizeDrives(WinWindowFromID(hwnd, MAIN_DRIVES), pswpClient->cx - 4); 4324 pswpNew = (PSWP) mp1 + (soldCount + 1 + 4325 (fSplitStatus != FALSE) + 4326 (fToolbar != FALSE)); 4327 *pswpNew = *pswpClient; 4328 pswpNew->hwnd = WinWindowFromID(hwnd, MAIN_DRIVES); 4329 pswpNew->hwndInsertBehind = HWND_BOTTOM; 4330 pswpNew->x = swpClient.x + 2; 4331 dheight += ((dheight - 2) * DriveLines); 4332 pswpNew->y = (swpClient.y + swpClient.cy) - (dheight - 2); 4333 if (fToolbar) 4334 pswpNew->y -= theight; 4335 pswpNew->cx = swpClient.cx - 4; 4336 pswpNew->cy = dheight - 4; 4337 pswpClient->cy -= dheight; 4338 sCount++; 4289 4339 } 4290 4340 else 4291 WinShowWindow(WinWindowFromID(hwnd, MAIN_DRIVES), FALSE);4341 WinShowWindow(WinWindowFromID(hwnd, MAIN_DRIVES), FALSE); 4292 4342 4293 4343 if (fAutoView) { 4294 pswpNew = (PSWP) mp1 + (soldCount + 1 +4295 (fToolbar != FALSE) +4296 (fDrivebar != FALSE) +4297 (fSplitStatus != FALSE));4298 *pswpNew = *pswpClient;4299 pswpNew->hwnd = (fComments) ? hwndAutoMLE : hwndAutoview;4300 pswpNew->x = pswpClient->x + 3;4301 pswpNew->y = pswpClient->y + 3;4302 if (fMoreButtons)4303 pswpNew->y += (bheight + 4);4304 pswpNew->cx = pswpClient->cx - 6;4305 AutoviewHeight = min(AutoviewHeight, pswpClient->cy - 116);4306 AutoviewHeight = max(AutoviewHeight, 36);4307 pswpNew->cy = AutoviewHeight;4308 pswpClient->y += (AutoviewHeight + 6);4309 pswpClient->cy -= (AutoviewHeight + 6);4310 sCount++;4311 WinShowWindow((fComments) ? hwndAutoview : hwndAutoMLE, FALSE);4344 pswpNew = (PSWP) mp1 + (soldCount + 1 + 4345 (fToolbar != FALSE) + 4346 (fDrivebar != FALSE) + 4347 (fSplitStatus != FALSE)); 4348 *pswpNew = *pswpClient; 4349 pswpNew->hwnd = (fComments) ? hwndAutoMLE : hwndAutoview; 4350 pswpNew->x = pswpClient->x + 3; 4351 pswpNew->y = pswpClient->y + 3; 4352 if (fMoreButtons) 4353 pswpNew->y += (bheight + 4); 4354 pswpNew->cx = pswpClient->cx - 6; 4355 AutoviewHeight = min(AutoviewHeight, pswpClient->cy - 116); 4356 AutoviewHeight = max(AutoviewHeight, 36); 4357 pswpNew->cy = AutoviewHeight; 4358 pswpClient->y += (AutoviewHeight + 6); 4359 pswpClient->cy -= (AutoviewHeight + 6); 4360 sCount++; 4361 WinShowWindow((fComments) ? hwndAutoview : hwndAutoMLE, FALSE); 4312 4362 } 4313 4363 else { 4314 WinShowWindow(hwndAutoview, FALSE);4315 WinShowWindow(hwndAutoMLE, FALSE);4364 WinShowWindow(hwndAutoview, FALSE); 4365 WinShowWindow(hwndAutoMLE, FALSE); 4316 4366 } 4317 4367 4318 4368 pswpNew = (PSWP) mp1 + (soldCount + 1 + 4319 (fToolbar != FALSE) +4320 (fDrivebar != FALSE) +4321 (fSplitStatus != FALSE) + (fAutoView != FALSE));4369 (fToolbar != FALSE) + 4370 (fDrivebar != FALSE) + 4371 (fSplitStatus != FALSE) + (fAutoView != FALSE)); 4322 4372 *pswpNew = *pswpClient; 4323 4373 pswpNew->hwnd = WinWindowFromID(hwnd, IDM_OPENWALK); … … 4328 4378 sCount++; 4329 4379 pswpNew = (PSWP) mp1 + (soldCount + 2 + 4330 (fToolbar != FALSE) +4331 (fDrivebar != FALSE) +4332 (fSplitStatus != FALSE) + (fAutoView != FALSE));4380 (fToolbar != FALSE) + 4381 (fDrivebar != FALSE) + 4382 (fSplitStatus != FALSE) + (fAutoView != FALSE)); 4333 4383 *pswpNew = *pswpClient; 4334 4384 pswpNew->hwnd = WinWindowFromID(hwnd, IDM_USERLIST); … … 4339 4389 sCount++; 4340 4390 pswpNew = (PSWP) mp1 + (soldCount + 3 + 4341 (fToolbar != FALSE) +4342 (fDrivebar != FALSE) +4343 (fSplitStatus != FALSE) + (fAutoView != FALSE));4391 (fToolbar != FALSE) + 4392 (fDrivebar != FALSE) + 4393 (fSplitStatus != FALSE) + (fAutoView != FALSE)); 4344 4394 *pswpNew = *pswpClient; 4345 4395 pswpNew->hwnd = WinWindowFromID(hwnd, MAIN_LED); … … 4350 4400 sCount++; 4351 4401 pswpNew = (PSWP) mp1 + (soldCount + 4 + 4352 (fToolbar != FALSE) +4353 (fDrivebar != FALSE) +4354 (fSplitStatus != FALSE) + (fAutoView != FALSE));4402 (fToolbar != FALSE) + 4403 (fDrivebar != FALSE) + 4404 (fSplitStatus != FALSE) + (fAutoView != FALSE)); 4355 4405 *pswpNew = *pswpClient; 4356 4406 pswpNew->hwnd = WinWindowFromID(hwnd, MAIN_LEDHDR); … … 4361 4411 sCount++; 4362 4412 if (fUserComboBox) { 4363 if (!aheight) {4364 4365 SWP swpTemp;4366 4367 WinQueryWindowPos(WinWindowFromID(hwndDrivelist, CBID_EDIT),4368 &swpTemp);4369 aheight = swpTemp.cy;4370 }4371 pswpNew = (PSWP) mp1 + (soldCount + 5 +4372 (fToolbar != FALSE) +4373 (fSplitStatus != FALSE) +4374 (fDrivebar != FALSE) + (fAutoView != FALSE));4375 *pswpNew = *pswpClient;4376 pswpNew->hwnd = hwndDrivelist;4377 pswpNew->x = swpClient.x;4378 pswpNew->cx = 48;4379 pswpClient->cy -= (aheight + 6L);4380 pswpNew->y = pswpClient->y;4381 pswpNew->cy = pswpClient->cy + (aheight + 5L);4382 sCount++;4383 pswpNew = (PSWP) mp1 + (soldCount + 6 +4384 (fToolbar != FALSE) +4385 (fDrivebar != FALSE) +4386 (fSplitStatus != FALSE) +4387 (fAutoView != FALSE));4388 *pswpNew = *pswpClient;4389 pswpNew->hwnd = hwndStatelist;4390 pswpNew->x = swpClient.x + 48;4391 pswpNew->cx = (swpClient.cx - 48) / 7;4392 pswpNew->y = pswpClient->y;4393 pswpNew->cy = pswpClient->cy + (aheight + 5L);4394 sCount++;4395 pswpNew = (PSWP) mp1 + (soldCount + 7 +4396 (fToolbar != FALSE) +4397 (fDrivebar != FALSE) +4398 (fSplitStatus != FALSE) +4399 (fAutoView != FALSE));4400 *pswpNew = *pswpClient;4401 pswpNew->hwnd = hwndCmdlist;4402 pswpNew->x = swpClient.x + 48 + ((swpClient.cx - 48) / 7);4403 pswpNew->cx = (swpClient.cx - 48) / 5 +4404 ((swpClient.cx - 48) / 5) - ((swpClient.cx - 48) / 7);4405 pswpNew->y = pswpClient->y;4406 pswpNew->cy = pswpClient->cy + (aheight + 5L);4407 sCount++;4408 pswpNew = (PSWP) mp1 + (soldCount + 8 +4409 (fToolbar != FALSE) +4410 (fDrivebar != FALSE) +4411 (fSplitStatus != FALSE) +4412 (fAutoView != FALSE));4413 *pswpNew = *pswpClient;4414 pswpNew->hwnd = hwndUserlist;4415 pswpNew->x = swpClient.x + 48 + (((swpClient.cx - 48) / 5) * 2);4416 pswpNew->cx = ((swpClient.x + swpClient.cx) - pswpNew->x) -4417 ((fToolbar) ? ((swpClient.cx - 48) / 7) : 0);4418 pswpNew->y = pswpClient->y;4419 pswpNew->cy = pswpClient->cy + (aheight + 5L);4420 sCount++;4421 if (fToolbar) {4422 pswpNew = (PSWP) mp1 + (soldCount + 9 +4423 (fToolbar != FALSE) +4424 (fDrivebar != FALSE) +4425 (fSplitStatus != FALSE) +4426 (fAutoView != FALSE));4427 *pswpNew = *pswpClient;4428 pswpNew->hwnd = hwndButtonlist;4429 pswpNew->x = swpClient.cx - ((swpClient.cx - 48) / 7) + 4;4430 pswpNew->cx = (swpClient.x + swpClient.cx) - pswpNew->x;4431 pswpNew->y = pswpClient->y;4432 pswpNew->cy = pswpClient->cy + (aheight + 5L);4433 sCount++;4434 }4435 else4436 WinShowWindow(hwndButtonlist, FALSE);4413 if (!aheight) { 4414 4415 SWP swpTemp; 4416 4417 WinQueryWindowPos(WinWindowFromID(hwndDrivelist, CBID_EDIT), 4418 &swpTemp); 4419 aheight = swpTemp.cy; 4420 } 4421 pswpNew = (PSWP) mp1 + (soldCount + 5 + 4422 (fToolbar != FALSE) + 4423 (fSplitStatus != FALSE) + 4424 (fDrivebar != FALSE) + (fAutoView != FALSE)); 4425 *pswpNew = *pswpClient; 4426 pswpNew->hwnd = hwndDrivelist; 4427 pswpNew->x = swpClient.x; 4428 pswpNew->cx = 48; 4429 pswpClient->cy -= (aheight + 6L); 4430 pswpNew->y = pswpClient->y; 4431 pswpNew->cy = pswpClient->cy + (aheight + 5L); 4432 sCount++; 4433 pswpNew = (PSWP) mp1 + (soldCount + 6 + 4434 (fToolbar != FALSE) + 4435 (fDrivebar != FALSE) + 4436 (fSplitStatus != FALSE) + 4437 (fAutoView != FALSE)); 4438 *pswpNew = *pswpClient; 4439 pswpNew->hwnd = hwndStatelist; 4440 pswpNew->x = swpClient.x + 48; 4441 pswpNew->cx = (swpClient.cx - 48) / 7; 4442 pswpNew->y = pswpClient->y; 4443 pswpNew->cy = pswpClient->cy + (aheight + 5L); 4444 sCount++; 4445 pswpNew = (PSWP) mp1 + (soldCount + 7 + 4446 (fToolbar != FALSE) + 4447 (fDrivebar != FALSE) + 4448 (fSplitStatus != FALSE) + 4449 (fAutoView != FALSE)); 4450 *pswpNew = *pswpClient; 4451 pswpNew->hwnd = hwndCmdlist; 4452 pswpNew->x = swpClient.x + 48 + ((swpClient.cx - 48) / 7); 4453 pswpNew->cx = (swpClient.cx - 48) / 5 + 4454 ((swpClient.cx - 48) / 5) - ((swpClient.cx - 48) / 7); 4455 pswpNew->y = pswpClient->y; 4456 pswpNew->cy = pswpClient->cy + (aheight + 5L); 4457 sCount++; 4458 pswpNew = (PSWP) mp1 + (soldCount + 8 + 4459 (fToolbar != FALSE) + 4460 (fDrivebar != FALSE) + 4461 (fSplitStatus != FALSE) + 4462 (fAutoView != FALSE)); 4463 *pswpNew = *pswpClient; 4464 pswpNew->hwnd = hwndUserlist; 4465 pswpNew->x = swpClient.x + 48 + (((swpClient.cx - 48) / 5) * 2); 4466 pswpNew->cx = ((swpClient.x + swpClient.cx) - pswpNew->x) - 4467 ((fToolbar) ? ((swpClient.cx - 48) / 7) : 0); 4468 pswpNew->y = pswpClient->y; 4469 pswpNew->cy = pswpClient->cy + (aheight + 5L); 4470 sCount++; 4471 if (fToolbar) { 4472 pswpNew = (PSWP) mp1 + (soldCount + 9 + 4473 (fToolbar != FALSE) + 4474 (fDrivebar != FALSE) + 4475 (fSplitStatus != FALSE) + 4476 (fAutoView != FALSE)); 4477 *pswpNew = *pswpClient; 4478 pswpNew->hwnd = hwndButtonlist; 4479 pswpNew->x = swpClient.cx - ((swpClient.cx - 48) / 7) + 4; 4480 pswpNew->cx = (swpClient.x + swpClient.cx) - pswpNew->x; 4481 pswpNew->y = pswpClient->y; 4482 pswpNew->cy = pswpClient->cy + (aheight + 5L); 4483 sCount++; 4484 } 4485 else 4486 WinShowWindow(hwndButtonlist, FALSE); 4437 4487 } 4438 4488 else { 4439 WinShowWindow(hwndUserlist, FALSE);4440 WinShowWindow(hwndDrivelist, FALSE);4441 WinShowWindow(hwndStatelist, FALSE);4442 WinShowWindow(hwndButtonlist, FALSE);4443 WinShowWindow(hwndCmdlist, FALSE);4489 WinShowWindow(hwndUserlist, FALSE); 4490 WinShowWindow(hwndDrivelist, FALSE); 4491 WinShowWindow(hwndStatelist, FALSE); 4492 WinShowWindow(hwndButtonlist, FALSE); 4493 WinShowWindow(hwndCmdlist, FALSE); 4444 4494 } 4445 4495 { 4446 PSWP pswpTitlebar = (PSWP) 0, pswpMinbutton = (PSWP) 0;4447 SHORT x;4448 4449 pswpNew = (PSWP) mp1 + (soldCount + 5 +4450 (fToolbar != FALSE) +4451 (fDrivebar != FALSE) +4452 (fSplitStatus != FALSE) +4453 (fAutoView != FALSE) +4454 ((fUserComboBox != FALSE) * 4) +4455 (fUserComboBox != FALSE &&4456 fToolbar != FALSE));4457 pswp = (PSWP) mp1;4458 for (x = 0; x < soldCount; x++) {4459 if (!pswpTitlebar &&4460 WinQueryWindowUShort(pswp->hwnd, QWS_ID) == FID_TITLEBAR)4461 pswpTitlebar = pswp;4462 else if (!pswpMinbutton &&4463 WinQueryWindowUShort(pswp->hwnd, QWS_ID) == FID_MINMAX)4464 pswpMinbutton = pswp;4465 if (pswpTitlebar && pswpMinbutton)4466 break;4467 pswp++;4468 }4469 if (pswpMinbutton && pswpTitlebar) {4470 *pswpNew = *pswpMinbutton;4471 pswpNew->hwnd = WinWindowFromID(hwnd, IDM_IDEALSIZE);4472 pswpNew->cy = pswpMinbutton->cy + 3;4473 pswpNew->cx = min(pswpNew->cy, (pswpMinbutton->cx / 2) + 3);4474 pswpTitlebar->cx -= (pswpNew->cx - 1);4475 pswpNew->x = pswpTitlebar->x + (pswpTitlebar->cx);4476 pswpNew->y = pswpMinbutton->y - 1;4477 sCount++;4478 }4479 else4480 WinShowWindow(WinWindowFromID(hwnd, IDM_IDEALSIZE), FALSE);4496 PSWP pswpTitlebar = (PSWP) 0, pswpMinbutton = (PSWP) 0; 4497 SHORT x; 4498 4499 pswpNew = (PSWP) mp1 + (soldCount + 5 + 4500 (fToolbar != FALSE) + 4501 (fDrivebar != FALSE) + 4502 (fSplitStatus != FALSE) + 4503 (fAutoView != FALSE) + 4504 ((fUserComboBox != FALSE) * 4) + 4505 (fUserComboBox != FALSE && 4506 fToolbar != FALSE)); 4507 pswp = (PSWP) mp1; 4508 for (x = 0; x < soldCount; x++) { 4509 if (!pswpTitlebar && 4510 WinQueryWindowUShort(pswp->hwnd, QWS_ID) == FID_TITLEBAR) 4511 pswpTitlebar = pswp; 4512 else if (!pswpMinbutton && 4513 WinQueryWindowUShort(pswp->hwnd, QWS_ID) == FID_MINMAX) 4514 pswpMinbutton = pswp; 4515 if (pswpTitlebar && pswpMinbutton) 4516 break; 4517 pswp++; 4518 } 4519 if (pswpMinbutton && pswpTitlebar) { 4520 *pswpNew = *pswpMinbutton; 4521 pswpNew->hwnd = WinWindowFromID(hwnd, IDM_IDEALSIZE); 4522 pswpNew->cy = pswpMinbutton->cy + 3; 4523 pswpNew->cx = min(pswpNew->cy, (pswpMinbutton->cx / 2) + 3); 4524 pswpTitlebar->cx -= (pswpNew->cx - 1); 4525 pswpNew->x = pswpTitlebar->x + (pswpTitlebar->cx); 4526 pswpNew->y = pswpMinbutton->y - 1; 4527 sCount++; 4528 } 4529 else 4530 WinShowWindow(WinWindowFromID(hwnd, IDM_IDEALSIZE), FALSE); 4481 4531 } 4482 4532 4483 4533 if (fMoreButtons) { 4484 4534 4485 LONG lastx;4486 4487 pswpNew = (PSWP) mp1 + (soldCount + 6 +4488 (fToolbar != FALSE) +4489 (fDrivebar != FALSE) +4490 (fSplitStatus != FALSE) +4491 (fAutoView != FALSE) +4492 ((fUserComboBox != FALSE) * 4) +4493 (fUserComboBox != FALSE &&4494 fToolbar != FALSE));4495 *pswpNew = *pswpClient;4496 pswpNew->hwnd = hwndName;4497 pswpNew->x = swpClient.x + 3;4498 pswpNew->y = swpClient.y + (sheight + 6);4499 pswpNew->cx = ((swpClient.cx / 2) + (swpClient.cx / 5)) - 3;4500 lastx = pswpNew->x + pswpNew->cx;4501 pswpNew->cy = bheight;4502 pswpClient->y += (bheight + 4);4503 pswpClient->cy -= (bheight + 4);4504 sCount++;4505 pswpNew = (PSWP) mp1 + (soldCount + 7 +4506 (fToolbar != FALSE) +4507 (fDrivebar != FALSE) +4508 (fSplitStatus != FALSE) +4509 (fAutoView != FALSE) +4510 ((fUserComboBox != FALSE) * 4) +4511 (fUserComboBox != FALSE &&4512 fToolbar != FALSE));4513 *pswpNew = *pswpClient;4514 pswpNew->hwnd = hwndDate;4515 pswpNew->x = lastx + 3;4516 pswpNew->y = swpClient.y + (sheight + 6);4517 pswpNew->cx = (swpClient.cx / 6) + (swpClient.cx / 16) - 3;4518 lastx = pswpNew->x + pswpNew->cx;4519 pswpNew->cy = bheight;4520 sCount++;4521 pswpNew = (PSWP) mp1 + (soldCount + 8 +4522 (fToolbar != FALSE) +4523 (fDrivebar != FALSE) +4524 (fSplitStatus != FALSE) +4525 (fAutoView != FALSE) +4526 ((fUserComboBox != FALSE) * 4) +4527 (fUserComboBox != FALSE &&4528 fToolbar != FALSE));4529 *pswpNew = *pswpClient;4530 pswpNew->hwnd = hwndAttr;4531 pswpNew->x = lastx + 3;4532 pswpNew->y = swpClient.y + (sheight + 6);4533 pswpNew->cx = (swpClient.cx - pswpNew->x) - 1;4534 pswpNew->cy = bheight;4535 sCount++;4535 LONG lastx; 4536 4537 pswpNew = (PSWP) mp1 + (soldCount + 6 + 4538 (fToolbar != FALSE) + 4539 (fDrivebar != FALSE) + 4540 (fSplitStatus != FALSE) + 4541 (fAutoView != FALSE) + 4542 ((fUserComboBox != FALSE) * 4) + 4543 (fUserComboBox != FALSE && 4544 fToolbar != FALSE)); 4545 *pswpNew = *pswpClient; 4546 pswpNew->hwnd = hwndName; 4547 pswpNew->x = swpClient.x + 3; 4548 pswpNew->y = swpClient.y + (sheight + 6); 4549 pswpNew->cx = ((swpClient.cx / 2) + (swpClient.cx / 5)) - 3; 4550 lastx = pswpNew->x + pswpNew->cx; 4551 pswpNew->cy = bheight; 4552 pswpClient->y += (bheight + 4); 4553 pswpClient->cy -= (bheight + 4); 4554 sCount++; 4555 pswpNew = (PSWP) mp1 + (soldCount + 7 + 4556 (fToolbar != FALSE) + 4557 (fDrivebar != FALSE) + 4558 (fSplitStatus != FALSE) + 4559 (fAutoView != FALSE) + 4560 ((fUserComboBox != FALSE) * 4) + 4561 (fUserComboBox != FALSE && 4562 fToolbar != FALSE)); 4563 *pswpNew = *pswpClient; 4564 pswpNew->hwnd = hwndDate; 4565 pswpNew->x = lastx + 3; 4566 pswpNew->y = swpClient.y + (sheight + 6); 4567 pswpNew->cx = (swpClient.cx / 6) + (swpClient.cx / 16) - 3; 4568 lastx = pswpNew->x + pswpNew->cx; 4569 pswpNew->cy = bheight; 4570 sCount++; 4571 pswpNew = (PSWP) mp1 + (soldCount + 8 + 4572 (fToolbar != FALSE) + 4573 (fDrivebar != FALSE) + 4574 (fSplitStatus != FALSE) + 4575 (fAutoView != FALSE) + 4576 ((fUserComboBox != FALSE) * 4) + 4577 (fUserComboBox != FALSE && 4578 fToolbar != FALSE)); 4579 *pswpNew = *pswpClient; 4580 pswpNew->hwnd = hwndAttr; 4581 pswpNew->x = lastx + 3; 4582 pswpNew->y = swpClient.y + (sheight + 6); 4583 pswpNew->cx = (swpClient.cx - pswpNew->x) - 1; 4584 pswpNew->cy = bheight; 4585 sCount++; 4536 4586 } 4537 4587 else { 4538 WinShowWindow(hwndAttr, FALSE);4539 WinShowWindow(hwndName, FALSE);4540 WinShowWindow(hwndDate, FALSE);4588 WinShowWindow(hwndAttr, FALSE); 4589 WinShowWindow(hwndName, FALSE); 4590 WinShowWindow(hwndDate, FALSE); 4541 4591 } 4542 4592 return MRFROMSHORT(sCount); … … 4551 4601 sCount += 6; 4552 4602 if (fSplitStatus) 4553 sCount++;4603 sCount++; 4554 4604 if (fToolbar) 4555 sCount++;4605 sCount++; 4556 4606 if (fUserComboBox) { 4557 sCount += 4;4558 if (fToolbar)4559 sCount++;4607 sCount += 4; 4608 if (fToolbar) 4609 sCount++; 4560 4610 } 4561 4611 if (fDrivebar) 4562 sCount++;4612 sCount++; 4563 4613 if (fAutoView) 4564 sCount++;4614 sCount++; 4565 4615 if (fMoreButtons) 4566 sCount += 3;4616 sCount += 3; 4567 4617 return MRFROMSHORT(sCount); 4568 4618 } … … 4585 4635 // DbgMsg(pszSrcFile, __LINE__, "IDM_CONTEXTMENU %x", hwnd); 4586 4636 if (hwnd != NULLHANDLE) { 4587 HWND hwndParent = WinQueryWindow(hwnd, QW_PARENT);4588 USHORT id = WinQueryWindowUShort(hwndParent, QWS_ID);4589 switch (id) {4590 case MAIN_SETUPLIST:4591 case MAIN_USERLIST:4592 case MAIN_CMDLIST:4593 // DbgMsg(pszSrcFile, __LINE__, "WM_CONTEXTMENU");4594 WinPostMsg(hwnd, WM_CONTEXTMENU, 0, 0);4595 }4637 HWND hwndParent = WinQueryWindow(hwnd, QW_PARENT); 4638 USHORT id = WinQueryWindowUShort(hwndParent, QWS_ID); 4639 switch (id) { 4640 case MAIN_SETUPLIST: 4641 case MAIN_USERLIST: 4642 case MAIN_CMDLIST: 4643 // DbgMsg(pszSrcFile, __LINE__, "WM_CONTEXTMENU"); 4644 WinPostMsg(hwnd, WM_CONTEXTMENU, 0, 0); 4645 } 4596 4646 } 4597 4647 } … … 4622 4672 wa.size = sizeof(wa); 4623 4673 pci = 4624 (PCNRITEM)4625 WinSendMsg(WinWindowFromID4626 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),4627 CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),4628 MPFROMSHORT(CRA_CURSORED));4674 (PCNRITEM) 4675 WinSendMsg(WinWindowFromID 4676 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 4677 CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST), 4678 MPFROMSHORT(CRA_CURSORED)); 4629 4679 if (pci && (INT) pci != -1) { 4630 strcpy(wa.szCurrentPath1, pci->pszFileName);4631 MakeValidDir(wa.szCurrentPath1);4680 strcpy(wa.szCurrentPath1, pci->pszFileName); 4681 MakeValidDir(wa.szCurrentPath1); 4632 4682 } 4633 4683 else 4634 strcpy(wa.szCurrentPath1, pFM2SaveDirectory);4684 strcpy(wa.szCurrentPath1, pFM2SaveDirectory); 4635 4685 TopWindowName(hwndMain, (HWND) 0, wa.szCurrentPath2); 4636 4686 if (!*wa.szCurrentPath2) 4637 strcpy(wa.szCurrentPath2, wa.szCurrentPath1);4687 strcpy(wa.szCurrentPath2, wa.szCurrentPath1); 4638 4688 MakeValidDir(wa.szCurrentPath2); 4639 4689 if (WinDlgBox(HWND_DESKTOP, 4640 hwnd,4641 WalkTwoCmpDlgProc,4642 FM3ModHandle,4643 WALK2_FRAME,4644 MPFROMP(&wa)) &&4645 !IsFile(wa.szCurrentPath1) && !IsFile(wa.szCurrentPath2)) {4646 if (!*dircompare) {4647 4648 COMPARE *cmp;4649 4650 cmp = xmallocz(sizeof(COMPARE), pszSrcFile, __LINE__);4651 if (cmp) {4652 cmp->size = sizeof(COMPARE);4653 strcpy(cmp->leftdir, wa.szCurrentPath1);4654 strcpy(cmp->rightdir, wa.szCurrentPath2);4655 cmp->hwndParent = hwnd;4656 cmp->dcd.hwndParent = hwnd;4657 WinDlgBox(HWND_DESKTOP,4658 HWND_DESKTOP,4659 CompareDlgProc, FM3ModHandle, COMP_FRAME, MPFROMP(cmp));4660 }4661 }4662 else {4663 4664 CHAR szPath1[CCHMAXPATH];4665 CHAR szPath2[CCHMAXPATH];4666 runemf2(SEPARATE,4667 HWND_DESKTOP, pszSrcFile, __LINE__,4668 NULL, NULL,4669 "%s %s %s",4670 dircompare,4671 BldQuotedFileName(szPath1, wa.szCurrentPath1),4672 BldQuotedFileName(szPath2, wa.szCurrentPath2));4673 }4690 hwnd, 4691 WalkTwoCmpDlgProc, 4692 FM3ModHandle, 4693 WALK2_FRAME, 4694 MPFROMP(&wa)) && 4695 !IsFile(wa.szCurrentPath1) && !IsFile(wa.szCurrentPath2)) { 4696 if (!*dircompare) { 4697 4698 COMPARE *cmp; 4699 4700 cmp = xmallocz(sizeof(COMPARE), pszSrcFile, __LINE__); 4701 if (cmp) { 4702 cmp->size = sizeof(COMPARE); 4703 strcpy(cmp->leftdir, wa.szCurrentPath1); 4704 strcpy(cmp->rightdir, wa.szCurrentPath2); 4705 cmp->hwndParent = hwnd; 4706 cmp->dcd.hwndParent = hwnd; 4707 WinDlgBox(HWND_DESKTOP, 4708 HWND_DESKTOP, 4709 CompareDlgProc, FM3ModHandle, COMP_FRAME, MPFROMP(cmp)); 4710 } 4711 } 4712 else { 4713 4714 CHAR szPath1[CCHMAXPATH]; 4715 CHAR szPath2[CCHMAXPATH]; 4716 runemf2(SEPARATE, 4717 HWND_DESKTOP, pszSrcFile, __LINE__, 4718 NULL, NULL, 4719 "%s %s %s", 4720 dircompare, 4721 BldQuotedFileName(szPath1, wa.szCurrentPath1), 4722 BldQuotedFileName(szPath2, wa.szCurrentPath2)); 4723 } 4674 4724 } 4675 4725 } … … 4683 4733 case IDM_CLI: 4684 4734 if (fSplitStatus && 4685 hwndStatus2 &&4686 !WinIsWindow(WinQueryAnchorBlock(hwnd),4687 WinWindowFromID(hwndStatus2, COMMAND_LINE)))4735 hwndStatus2 && 4736 !WinIsWindow(WinQueryAnchorBlock(hwnd), 4737 WinWindowFromID(hwndStatus2, COMMAND_LINE))) 4688 4738 PostMsg(hwndStatus2, UM_CLICKED, MPVOID, MPVOID); 4689 4739 break; … … 4698 4748 bstrip(temp); 4699 4749 if (*temp && 4700 !DosQueryPathInfo(temp, FIL_QUERYFULLNAME, path, sizeof(path))) {4701 if (SHORT1FROMMP(mp1) == IDM_ADDTOUSERLIST) {4702 add_udir(TRUE, path);4703 if (fUdirsChanged)4704 save_udirs();4705 WinSendMsg(hwnd, UM_FILLUSERLIST, MPVOID, MPVOID);4706 }4707 else {4708 if (!remove_udir(path))4709 Runtime_Error(pszSrcFile, __LINE__, "remove_udir");4710 else {4711 if (fUdirsChanged)4712 save_udirs();4713 WinSendMsg(hwnd, UM_FILLUSERLIST, MPVOID, MPVOID);4714 }4715 }4750 !DosQueryPathInfo(temp, FIL_QUERYFULLNAME, path, sizeof(path))) { 4751 if (SHORT1FROMMP(mp1) == IDM_ADDTOUSERLIST) { 4752 add_udir(TRUE, path); 4753 if (fUdirsChanged) 4754 save_udirs(); 4755 WinSendMsg(hwnd, UM_FILLUSERLIST, MPVOID, MPVOID); 4756 } 4757 else { 4758 if (!remove_udir(path)) 4759 Runtime_Error(pszSrcFile, __LINE__, "remove_udir"); 4760 else { 4761 if (fUdirsChanged) 4762 save_udirs(); 4763 WinSendMsg(hwnd, UM_FILLUSERLIST, MPVOID, MPVOID); 4764 } 4765 } 4716 4766 } 4717 4767 } … … 4728 4778 // Complain if attempting to use reserved name 4729 4779 if (stricmp(szStateName, GetPString(IDS_STATETEXT)) == 0 || 4730 stricmp(szStateName, GetPString(IDS_FM2TEMPTEXT)) == 0)4780 stricmp(szStateName, GetPString(IDS_FM2TEMPTEXT)) == 0) 4731 4781 { 4732 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd,4733 GetPString(IDS_WARNINGTEXT),4734 "\"%s\" is a reserved state name", szStateName);4782 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd, 4783 GetPString(IDS_WARNINGTEXT), 4784 "\"%s\" is a reserved state name", szStateName); 4735 4785 } 4736 4786 // Ignore request if blank 4737 4787 else if (*szStateName) { 4738 BOOL fAbortOperation = FALSE;4739 if (!fNoSaveState && fSaveState && stricmp(szStateName, GetPString(IDS_SHUTDOWNSTATE)) == 0)4740 {4741 if (saymsg(MB_YESNO | MB_DEFBUTTON2 | MB_ICONASTERISK, hwnd,4742 GetPString(IDS_WARNINGTEXT),4743 GetPString(IDS_SHUTDOWNSTATE_WARNING), szStateName) == MBID_NO)4744 fAbortOperation = TRUE;4745 }4746 if (!fAbortOperation) {4747 if (SHORT1FROMMP(mp1) == IDM_SAVEDIRCNRSTATE) {4748 // Save4749 INT nSaved = SaveDirCnrState(hwnd, szStateName);4750 if (nSaved >= 0) {4751 INT ret = add_setup(szStateName);4752 if (ret == 0) {4753 WinSendMsg(hwndStatelist, LM_INSERTITEM,4754 MPFROM2SHORT(LIT_SORTASCENDING, 0), MPFROMP(szStateName));4755 save_setups();4756 }4757 else if (ret != 1) {4758 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd,4759 GetPString(IDS_WARNINGTEXT),4760 "\"%s\" state name add failed", szStateName); // 15 Apr 07 SHL failed4761 WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT));4762 }4763 }4764 else {4765 saymsg(MB_ENTER | MB_ICONASTERISK,4766 hwnd,4767 GetPString(IDS_WARNINGTEXT),4768 "State data save failed");4769 WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT));4770 }4771 }4772 else {4773 // Delete4774 ULONG numsaves = 0, size, x;4775 CHAR s[STATE_NAME_MAX_BYTES + 80];4776 4777 INT ret = remove_setup(szStateName);4778 if (ret == 1)4779 save_setups();4780 sprintf(s, "%s.NumDirsLastTime", szStateName);4781 size = sizeof(ULONG);4782 if (!PrfQueryProfileData(fmprof,4783 FM3Str,4784 s,4785 (PVOID)&numsaves,4786 &size)) {4787 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd,4788 GetPString(IDS_WARNINGTEXT),4789 GetPString(IDS_DOESNTEXISTTEXT), szStateName);4790 }4791 else if (!size)4792 Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT);4793 else {4794 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0L);4795 for (x = 0; x < numsaves; x++) {4796 sprintf(s, "%s.DirCnrPos.%lu", szStateName, x);4797 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4798 sprintf(s, "%s.DirCnrDir.%lu", szStateName, x);4799 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4800 sprintf(s, "%s.DirCnrSort.%lu", szStateName, x);4801 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4802 sprintf(s, "%s.DirCnrFilter.%lu", szStateName, x);4803 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4804 sprintf(s, "%s.DirCnrView.%lu", szStateName, x);4805 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4806 sprintf(s, "%s.DirCnr.%lu.DetailsLongname", szStateName, x);4807 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4808 sprintf(s, "%s.DirCnr.%lu.DetailsSubject", szStateName, x);4809 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4810 sprintf(s, "%s.DirCnr.%lu.DetailsSize", szStateName, x);4811 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4812 sprintf(s, "%s.DirCnr.%lu.DetailsEA", szStateName, x);4813 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4814 sprintf(s, "%s.DirCnr.%lu.DetailsAttr", szStateName, x);4815 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4816 sprintf(s, "%s.DirCnr.%lu.DetailsIcon", szStateName, x);4817 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4818 sprintf(s, "%s.DirCnr.%lu.DetailsLWDate", szStateName, x);4819 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4820 sprintf(s, "%s.DirCnr.%lu.DetailsLWTime", szStateName, x);4821 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4822 sprintf(s, "%s.DirCnr.%lu.DetailsLADate", szStateName, x);4823 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4824 sprintf(s, "%s.DirCnr.%lu.DetailsLATime", szStateName, x);4825 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4826 sprintf(s, "%s.DirCnr.%lu.DetailsCRDate", szStateName, x);4827 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4828 sprintf(s, "%s.DirCnr.%lu.DetailsCRTime", szStateName, x);4829 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4830 sprintf(s, "%s.DirCnr.%lu.Backgroundcolor", szStateName, x);4831 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4832 sprintf(s, "%s.DirCnr.%lu.Fontnamesize", szStateName, x);4833 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4834 }4835 sprintf(s, "%s.LastTreePos", szStateName);4836 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4837 sprintf(s, "%s.MySizeLastTime", szStateName);4838 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4839 }4840 PostMsg(hwnd, UM_FILLSETUPLIST, MPVOID, MPVOID);4841 }4842 }4788 BOOL fAbortOperation = FALSE; 4789 if (!fNoSaveState && fSaveState && stricmp(szStateName, GetPString(IDS_SHUTDOWNSTATE)) == 0) 4790 { 4791 if (saymsg(MB_YESNO | MB_DEFBUTTON2 | MB_ICONASTERISK, hwnd, 4792 GetPString(IDS_WARNINGTEXT), 4793 GetPString(IDS_SHUTDOWNSTATE_WARNING), szStateName) == MBID_NO) 4794 fAbortOperation = TRUE; 4795 } 4796 if (!fAbortOperation) { 4797 if (SHORT1FROMMP(mp1) == IDM_SAVEDIRCNRSTATE) { 4798 // Save 4799 INT nSaved = SaveDirCnrState(hwnd, szStateName); 4800 if (nSaved >= 0) { 4801 INT ret = add_setup(szStateName); 4802 if (ret == 0) { 4803 WinSendMsg(hwndStatelist, LM_INSERTITEM, 4804 MPFROM2SHORT(LIT_SORTASCENDING, 0), MPFROMP(szStateName)); 4805 save_setups(); 4806 } 4807 else if (ret != 1) { 4808 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd, 4809 GetPString(IDS_WARNINGTEXT), 4810 "\"%s\" state name add failed", szStateName); // 15 Apr 07 SHL failed 4811 WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT)); 4812 } 4813 } 4814 else { 4815 saymsg(MB_ENTER | MB_ICONASTERISK, 4816 hwnd, 4817 GetPString(IDS_WARNINGTEXT), 4818 "State data save failed"); 4819 WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT)); 4820 } 4821 } 4822 else { 4823 // Delete 4824 ULONG numsaves = 0, size, x; 4825 CHAR s[STATE_NAME_MAX_BYTES + 80]; 4826 4827 INT ret = remove_setup(szStateName); 4828 if (ret == 1) 4829 save_setups(); 4830 sprintf(s, "%s.NumDirsLastTime", szStateName); 4831 size = sizeof(ULONG); 4832 if (!PrfQueryProfileData(fmprof, 4833 FM3Str, 4834 s, 4835 (PVOID)&numsaves, 4836 &size)) { 4837 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd, 4838 GetPString(IDS_WARNINGTEXT), 4839 GetPString(IDS_DOESNTEXISTTEXT), szStateName); 4840 } 4841 else if (!size) 4842 Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT); 4843 else { 4844 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0L); 4845 for (x = 0; x < numsaves; x++) { 4846 sprintf(s, "%s.DirCnrPos.%lu", szStateName, x); 4847 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4848 sprintf(s, "%s.DirCnrDir.%lu", szStateName, x); 4849 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4850 sprintf(s, "%s.DirCnrSort.%lu", szStateName, x); 4851 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4852 sprintf(s, "%s.DirCnrFilter.%lu", szStateName, x); 4853 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4854 sprintf(s, "%s.DirCnrView.%lu", szStateName, x); 4855 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4856 sprintf(s, "%s.DirCnr.%lu.DetailsLongname", szStateName, x); 4857 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4858 sprintf(s, "%s.DirCnr.%lu.DetailsSubject", szStateName, x); 4859 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4860 sprintf(s, "%s.DirCnr.%lu.DetailsSize", szStateName, x); 4861 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4862 sprintf(s, "%s.DirCnr.%lu.DetailsEA", szStateName, x); 4863 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4864 sprintf(s, "%s.DirCnr.%lu.DetailsAttr", szStateName, x); 4865 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4866 sprintf(s, "%s.DirCnr.%lu.DetailsIcon", szStateName, x); 4867 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4868 sprintf(s, "%s.DirCnr.%lu.DetailsLWDate", szStateName, x); 4869 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4870 sprintf(s, "%s.DirCnr.%lu.DetailsLWTime", szStateName, x); 4871 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4872 sprintf(s, "%s.DirCnr.%lu.DetailsLADate", szStateName, x); 4873 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4874 sprintf(s, "%s.DirCnr.%lu.DetailsLATime", szStateName, x); 4875 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4876 sprintf(s, "%s.DirCnr.%lu.DetailsCRDate", szStateName, x); 4877 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4878 sprintf(s, "%s.DirCnr.%lu.DetailsCRTime", szStateName, x); 4879 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4880 sprintf(s, "%s.DirCnr.%lu.Backgroundcolor", szStateName, x); 4881 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4882 sprintf(s, "%s.DirCnr.%lu.Fontnamesize", szStateName, x); 4883 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4884 } 4885 sprintf(s, "%s.LastTreePos", szStateName); 4886 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4887 sprintf(s, "%s.MySizeLastTime", szStateName); 4888 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4889 } 4890 PostMsg(hwnd, UM_FILLSETUPLIST, MPVOID, MPVOID); 4891 } 4892 } 4843 4893 } 4844 4894 } … … 4853 4903 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swp); 4854 4904 if (swp.fl & SWP_MAXIMIZE) { 4855 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), WM_SYSCOMMAND,4856 MPFROM2SHORT(SC_RESTORE, 0), MPVOID);4857 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swp);4905 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), WM_SYSCOMMAND, 4906 MPFROM2SHORT(SC_RESTORE, 0), MPVOID); 4907 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swp); 4858 4908 } 4859 4909 WinGetMaxPosition(WinQueryWindow(hwnd, QW_PARENT), &swpD); … … 4863 4913 swpD.cy -= (icz + bsz); 4864 4914 if (swp.x == swpD.x && swp.y == swpD.y && 4865 swp.cx == swpD.cx && swp.cy == swpD.cy &&4866 // fixme to be #defined someday4867 WinQueryWindowUShort(hwnd, QWL_USER + 10) &&4868 WinQueryWindowUShort(hwnd, QWL_USER + 14)) {4869 swpD.x = WinQueryWindowUShort(hwnd, QWL_USER + 8);4870 swpD.cx = WinQueryWindowUShort(hwnd, QWL_USER + 10);4871 swpD.y = WinQueryWindowUShort(hwnd, QWL_USER + 12);4872 swpD.cy = WinQueryWindowUShort(hwnd, QWL_USER + 14);4915 swp.cx == swpD.cx && swp.cy == swpD.cy && 4916 // fixme to be #defined someday 4917 WinQueryWindowUShort(hwnd, QWL_USER + 10) && 4918 WinQueryWindowUShort(hwnd, QWL_USER + 14)) { 4919 swpD.x = WinQueryWindowUShort(hwnd, QWL_USER + 8); 4920 swpD.cx = WinQueryWindowUShort(hwnd, QWL_USER + 10); 4921 swpD.y = WinQueryWindowUShort(hwnd, QWL_USER + 12); 4922 swpD.cy = WinQueryWindowUShort(hwnd, QWL_USER + 14); 4873 4923 } 4874 4924 else { 4875 WinSetWindowUShort(hwnd, QWL_USER + 8, (USHORT) swp.x);4876 WinSetWindowUShort(hwnd, QWL_USER + 10, (USHORT) swp.cx);4877 WinSetWindowUShort(hwnd, QWL_USER + 12, (USHORT) swp.y);4878 WinSetWindowUShort(hwnd, QWL_USER + 14, (USHORT) swp.cy);4925 WinSetWindowUShort(hwnd, QWL_USER + 8, (USHORT) swp.x); 4926 WinSetWindowUShort(hwnd, QWL_USER + 10, (USHORT) swp.cx); 4927 WinSetWindowUShort(hwnd, QWL_USER + 12, (USHORT) swp.y); 4928 WinSetWindowUShort(hwnd, QWL_USER + 14, (USHORT) swp.cy); 4879 4929 } 4880 4930 WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT), HWND_TOP, 4881 swpD.x, swpD.y, swpD.cx, swpD.cy, SWP_MOVE | SWP_SIZE);4931 swpD.x, swpD.y, swpD.cx, swpD.cy, SWP_MOVE | SWP_SIZE); 4882 4932 } 4883 4933 break; … … 4885 4935 case IDM_BLINK: 4886 4936 WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT), HWND_TOP, 0, 0, 0, 0, 4887 SWP_MINIMIZE);4937 SWP_MINIMIZE); 4888 4938 WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT), HWND_TOP, 0, 0, 0, 0, 4889 SWP_RESTORE | SWP_ZORDER);4939 SWP_RESTORE | SWP_ZORDER); 4890 4940 break; 4891 4941 … … 4895 4945 4896 4946 if (hwndTop) 4897 WinSetFocus(HWND_DESKTOP, hwndTop);4947 WinSetFocus(HWND_DESKTOP, hwndTop); 4898 4948 } 4899 4949 break; … … 4917 4967 case IDM_QUICKSETTINGS: 4918 4968 WinDlgBox(HWND_DESKTOP, 4919 hwnd, CfgDlgProc, FM3ModHandle, CFG_FRAME, MPFROMLONG(mp1));4969 hwnd, CfgDlgProc, FM3ModHandle, CFG_FRAME, MPFROMLONG(mp1)); 4920 4970 break; 4921 4971 … … 4923 4973 case IDM_VIEWINFS: 4924 4974 WinDlgBox(HWND_DESKTOP, 4925 HWND_DESKTOP,4926 ViewInfProc,4927 FM3ModHandle,4928 VINF_FRAME,4929 ((SHORT1FROMMP(mp1) == IDM_VIEWHELPS) ?4930 MPFROMP(NullStr) : MPVOID));4975 HWND_DESKTOP, 4976 ViewInfProc, 4977 FM3ModHandle, 4978 VINF_FRAME, 4979 ((SHORT1FROMMP(mp1) == IDM_VIEWHELPS) ? 4980 MPFROMP(NullStr) : MPVOID)); 4931 4981 break; 4932 4982 … … 4938 4988 TopWindowName(hwnd, (HWND) 0, newpath); 4939 4989 if (WinDlgBox(HWND_DESKTOP, 4940 hwnd,4941 WalkAllDlgProc,4942 FM3ModHandle, WALK_FRAME, MPFROMP(newpath)) && *newpath)4943 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, newpath);4990 hwnd, 4991 WalkAllDlgProc, 4992 FM3ModHandle, WALK_FRAME, MPFROMP(newpath)) && *newpath) 4993 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, newpath); 4944 4994 } 4945 4995 break; … … 4962 5012 if (SHORT1FROMMP(mp2) == CMDSRC_MENU) { 4963 5013 4964 RECTL rcl;4965 ULONG icz = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 2L;4966 4967 WinQueryWindowRect(HWND_DESKTOP, &rcl);4968 rcl.yBottom += icz;4969 rcl.yTop -= icz;4970 rcl.xLeft += icz;4971 rcl.xRight -= icz;4972 WinSendMsg(hwndHelp, HM_SET_COVERPAGE_SIZE, MPFROMP(&rcl), MPVOID);5014 RECTL rcl; 5015 ULONG icz = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 2L; 5016 5017 WinQueryWindowRect(HWND_DESKTOP, &rcl); 5018 rcl.yBottom += icz; 5019 rcl.yTop -= icz; 5020 rcl.xLeft += icz; 5021 rcl.xRight -= icz; 5022 WinSendMsg(hwndHelp, HM_SET_COVERPAGE_SIZE, MPFROMP(&rcl), MPVOID); 4973 5023 } 4974 5024 else { 4975 5025 4976 RECTL rcl;4977 4978 WinQueryWindowRect(HWND_DESKTOP, &rcl);4979 rcl.yBottom += 8;4980 rcl.yTop = (rcl.yTop / 2) + (rcl.yTop / 7);4981 rcl.xLeft = (rcl.xRight / 2) - (rcl.xRight / 7);4982 rcl.xRight -= 8;4983 WinSendMsg(hwndHelp, HM_SET_COVERPAGE_SIZE, MPFROMP(&rcl), MPVOID);5026 RECTL rcl; 5027 5028 WinQueryWindowRect(HWND_DESKTOP, &rcl); 5029 rcl.yBottom += 8; 5030 rcl.yTop = (rcl.yTop / 2) + (rcl.yTop / 7); 5031 rcl.xLeft = (rcl.xRight / 2) - (rcl.xRight / 7); 5032 rcl.xRight -= 8; 5033 WinSendMsg(hwndHelp, HM_SET_COVERPAGE_SIZE, MPFROMP(&rcl), MPVOID); 4984 5034 } 4985 5035 switch (SHORT1FROMMP(mp1)) { 4986 5036 case IDM_HELPCONTEXT: 4987 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,4988 MPFROM2SHORT(HELP_CONTEXT, 0), MPFROMSHORT(HM_RESOURCEID));4989 break;5037 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 5038 MPFROM2SHORT(HELP_CONTEXT, 0), MPFROMSHORT(HM_RESOURCEID)); 5039 break; 4990 5040 4991 5041 case IDM_HELPMOUSE: 4992 if (hwndHelp)4993 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,4994 MPFROM2SHORT(HELP_MOUSE, 0), MPFROMSHORT(HM_RESOURCEID));4995 break;5042 if (hwndHelp) 5043 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 5044 MPFROM2SHORT(HELP_MOUSE, 0), MPFROMSHORT(HM_RESOURCEID)); 5045 break; 4996 5046 4997 5047 case IDM_HELPPIX: 4998 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,4999 MPFROM2SHORT(HELP_BITMAP1, 0), MPFROMSHORT(HM_RESOURCEID));5000 break;5048 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 5049 MPFROM2SHORT(HELP_BITMAP1, 0), MPFROMSHORT(HM_RESOURCEID)); 5050 break; 5001 5051 5002 5052 case IDM_HELPTUTOR: 5003 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,5004 MPFROM2SHORT(HELP_TUTORIAL, 0),5005 MPFROMSHORT(HM_RESOURCEID));5006 break;5053 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 5054 MPFROM2SHORT(HELP_TUTORIAL, 0), 5055 MPFROMSHORT(HM_RESOURCEID)); 5056 break; 5007 5057 5008 5058 case IDM_HELPHINTS: 5009 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,5010 MPFROM2SHORT(HELP_HINTS, 0), MPFROMSHORT(HM_RESOURCEID));5011 break;5059 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 5060 MPFROM2SHORT(HELP_HINTS, 0), MPFROMSHORT(HM_RESOURCEID)); 5061 break; 5012 5062 5013 5063 case IDM_HELPGENERAL: 5014 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,5015 MPFROM2SHORT(HELP_MAIN, 0), MPFROMSHORT(HM_RESOURCEID));5016 break;5064 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 5065 MPFROM2SHORT(HELP_MAIN, 0), MPFROMSHORT(HM_RESOURCEID)); 5066 break; 5017 5067 case IDM_HELPKEYS: 5018 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,5019 MPFROM2SHORT(HELP_KEYS, 0), MPFROMSHORT(HM_RESOURCEID));5020 break;5068 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 5069 MPFROM2SHORT(HELP_KEYS, 0), MPFROMSHORT(HM_RESOURCEID)); 5070 break; 5021 5071 5022 5072 case IDM_HELP: 5023 5073 case IDM_HELPCONTENTS: 5024 WinSendMsg(hwndHelp, HM_HELP_CONTENTS, MPVOID, MPVOID);5025 break;5074 WinSendMsg(hwndHelp, HM_HELP_CONTENTS, MPVOID, MPVOID); 5075 break; 5026 5076 5027 5077 case IDM_HELPUSERLIST: 5028 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,5029 MPFROM2SHORT(HELP_USERLISTS, 0),5030 MPFROMSHORT(HM_RESOURCEID));5031 break;5078 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 5079 MPFROM2SHORT(HELP_USERLISTS, 0), 5080 MPFROMSHORT(HM_RESOURCEID)); 5081 break; 5032 5082 } 5033 5083 } … … 5040 5090 case IDM_ABOUT: 5041 5091 WinDlgBox(HWND_DESKTOP, hwnd, AboutDlgProc, FM3ModHandle, 5042 ABT_FRAME, MPVOID);5092 ABT_FRAME, MPVOID); 5043 5093 break; 5044 5094 … … 5054 5104 5055 5105 if (!DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_VERSION_MINOR, 5056 (PVOID) & version, (ULONG) sizeof(version))) {5057 if (version[0] > 20L || (version[0] == 20L && version[1] > 29L)) {5058 if (SHORT1FROMMP(mp1) == IDM_HICOLORPALETTE)5059 palette = "<WP_HIRESCLRPAL>";5060 else5061 palette = "<WP_LORESCLRPAL>";5062 }5106 (PVOID) & version, (ULONG) sizeof(version))) { 5107 if (version[0] > 20L || (version[0] == 20L && version[1] > 29L)) { 5108 if (SHORT1FROMMP(mp1) == IDM_HICOLORPALETTE) 5109 palette = "<WP_HIRESCLRPAL>"; 5110 else 5111 palette = "<WP_LORESCLRPAL>"; 5112 } 5063 5113 } 5064 5114 OpenObject(palette, Default, hwnd); … … 5076 5126 hWPSObject = WinQueryObject("<WP_SCHPAL>"); 5077 5127 if (hWPSObject != NULLHANDLE) 5078 WinSetObjectData(hWPSObject, "SCHEMES=Winter:PM_Winter,"5079 "Spring:PM_Spring,Summer:PM_Summer,"5080 "System:PM_System,Windows:PM_Windows;"5081 "OPEN=DEFAULT");5128 WinSetObjectData(hWPSObject, "SCHEMES=Winter:PM_Winter," 5129 "Spring:PM_Spring,Summer:PM_Summer," 5130 "System:PM_System,Windows:PM_Windows;" 5131 "OPEN=DEFAULT"); 5082 5132 } 5083 5133 break; … … 5090 5140 case IDM_SYSINFO: 5091 5141 WinDlgBox(HWND_DESKTOP, HWND_DESKTOP, SysInfoDlgProc, FM3ModHandle, 5092 SYS_FRAME, NULL);5142 SYS_FRAME, NULL); 5093 5143 break; 5094 5144 #endif … … 5100 5150 5101 5151 if (hwndTree) 5102 pci = (PCNRITEM) WinSendMsg(hwndTree, CM_QUERYRECORDEMPHASIS,5103 MPFROMLONG(CMA_FIRST),5104 MPFROMSHORT(CRA_CURSORED));5152 pci = (PCNRITEM) WinSendMsg(hwndTree, CM_QUERYRECORDEMPHASIS, 5153 MPFROMLONG(CMA_FIRST), 5154 MPFROMSHORT(CRA_CURSORED)); 5105 5155 if (pci && (INT) pci != -1) { 5106 strcpy(path, pci->pszFileName);5107 MakeValidDir(path);5156 strcpy(path, pci->pszFileName); 5157 MakeValidDir(path); 5108 5158 } 5109 5159 else 5110 strcpy(path, pFM2SaveDirectory);5160 strcpy(path, pFM2SaveDirectory); 5111 5161 WinDlgBox(HWND_DESKTOP, hwnd, InstantDlgProc, FM3ModHandle, 5112 BAT_FRAME, MPFROMP(path));5162 BAT_FRAME, MPFROMP(path)); 5113 5163 } 5114 5164 break; … … 5124 5174 TopWindowName(hwnd, (HWND) 0, path); 5125 5175 if (SHORT1FROMMP(mp1) == IDM_DOSCOMMANDLINE) 5126 env = GetCmdSpec(TRUE);5176 env = GetCmdSpec(TRUE); 5127 5177 else if (SHORT1FROMMP(mp1) != IDM_COMMANDLINE) { 5128 env = "WINOS2.COM";5129 type = SEPARATE | FULLSCREEN;5178 env = "WINOS2.COM"; 5179 type = SEPARATE | FULLSCREEN; 5130 5180 } 5131 5181 runemf2(type, hwnd, pszSrcFile, __LINE__, 5132 path, NULL, "%s", env);5182 path, NULL, "%s", env); 5133 5183 } 5134 5184 break; … … 5136 5186 case IDM_KILLPROC: 5137 5187 WinDlgBox(HWND_DESKTOP, hwnd, KillDlgProc, FM3ModHandle, 5138 KILL_FRAME, NULL);5188 KILL_FRAME, NULL); 5139 5189 break; 5140 5190 … … 5151 5201 case IDM_AUTOVIEW: 5152 5202 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), SHORT1FROMMP(mp1), 5153 &fAutoView, TRUE, "AutoView");5203 &fAutoView, TRUE, "AutoView"); 5154 5204 AutoChange: 5155 5205 PostMsg(WinQueryWindow(hwnd, QW_PARENT), WM_UPDATEFRAME, 5156 MPFROMLONG(FCF_SIZEBORDER), MPVOID);5206 MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5157 5207 if (fAutoView) { 5158 5208 … … 5163 5213 hwndDir = TopWindowName(hwnd, (HWND) 0, s); 5164 5214 if (hwndDir) { 5165 hwndDir = WinWindowFromID(hwndDir, FID_CLIENT);5166 if (hwndDir) {5167 hwndDir = WinWindowFromID(hwndDir, DIR_CNR);5168 if (hwndDir) {5169 pci = (PCNRITEM) WinSendMsg(hwndDir, CM_QUERYRECORDEMPHASIS,5170 MPFROMLONG(CMA_FIRST),5171 MPFROMSHORT(CRA_CURSORED));5172 if (pci && (INT) pci != -1 &&5173 (!(driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_SLOW)))5174 WinSendMsg(hwnd,5175 UM_LOADFILE,5176 MPFROMP(pci->pszFileName),5177 (SHORT1FROMMP(mp1) == IDM_AUTOVIEW) ?5178 MPVOID : MPFROMLONG(1));5179 }5180 }5215 hwndDir = WinWindowFromID(hwndDir, FID_CLIENT); 5216 if (hwndDir) { 5217 hwndDir = WinWindowFromID(hwndDir, DIR_CNR); 5218 if (hwndDir) { 5219 pci = (PCNRITEM) WinSendMsg(hwndDir, CM_QUERYRECORDEMPHASIS, 5220 MPFROMLONG(CMA_FIRST), 5221 MPFROMSHORT(CRA_CURSORED)); 5222 if (pci && (INT) pci != -1 && 5223 (!(driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_SLOW))) 5224 WinSendMsg(hwnd, 5225 UM_LOADFILE, 5226 MPFROMP(pci->pszFileName), 5227 (SHORT1FROMMP(mp1) == IDM_AUTOVIEW) ? 5228 MPVOID : MPFROMLONG(1)); 5229 } 5230 } 5181 5231 } 5182 5232 } … … 5185 5235 case IDM_TEXTTOOLS: 5186 5236 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), SHORT1FROMMP(mp1), 5187 &fTextTools, TRUE, "TextTools");5237 &fTextTools, TRUE, "TextTools"); 5188 5238 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID); 5189 5239 PostMsg(WinQueryWindow(hwnd, QW_PARENT), WM_UPDATEFRAME, 5190 MPFROMLONG(FCF_SIZEBORDER), MPVOID);5240 MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5191 5241 break; 5192 5242 5193 5243 case IDM_TOOLTITLES: 5194 5244 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), SHORT1FROMMP(mp1), 5195 &fToolTitles, TRUE, "ToolTitles");5245 &fToolTitles, TRUE, "ToolTitles"); 5196 5246 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID); 5197 5247 PostMsg(WinQueryWindow(hwnd, QW_PARENT), WM_UPDATEFRAME, 5198 MPFROMLONG(FCF_SIZEBORDER), MPVOID);5248 MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5199 5249 break; 5200 5250 … … 5204 5254 MenuInvisible = MenuInvisible ? FALSE : TRUE; 5205 5255 if (MenuInvisible) { 5206 WinSetParent(hwndMenu, HWND_OBJECT, FALSE);5207 WinSetMenuItemText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),5208 FID_SYSMENU), IDM_HIDEMENU,5209 GetPString(IDS_UNHIDEMENUTEXT));5256 WinSetParent(hwndMenu, HWND_OBJECT, FALSE); 5257 WinSetMenuItemText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5258 FID_SYSMENU), IDM_HIDEMENU, 5259 GetPString(IDS_UNHIDEMENUTEXT)); 5210 5260 } 5211 5261 else { 5212 WinSetParent(hwndMenu, WinQueryWindow(hwnd, QW_PARENT), FALSE);5213 WinSetMenuItemText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),5214 FID_SYSMENU), IDM_HIDEMENU,5215 GetPString(IDS_HIDEMENUTEXT));5262 WinSetParent(hwndMenu, WinQueryWindow(hwnd, QW_PARENT), FALSE); 5263 WinSetMenuItemText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5264 FID_SYSMENU), IDM_HIDEMENU, 5265 GetPString(IDS_HIDEMENUTEXT)); 5216 5266 } 5217 5267 PostMsg(WinQueryWindow(hwnd, QW_PARENT), WM_UPDATEFRAME, 5218 MPFROMLONG(FCF_MENU), MPVOID);5268 MPFROMLONG(FCF_MENU), MPVOID); 5219 5269 PrfWriteProfileData(fmprof, FM3Str, "MenuInvisible", 5220 &MenuInvisible, sizeof(BOOL));5270 &MenuInvisible, sizeof(BOOL)); 5221 5271 } 5222 5272 break; … … 5231 5281 5232 5282 if (Collector) 5233 already = TRUE;5283 already = TRUE; 5234 5284 if (!already && !fAutoTile && !fExternalCollector) 5235 GetNextWindowPos(hwnd, &swp, NULL, NULL);5285 GetNextWindowPos(hwnd, &swp, NULL, NULL); 5236 5286 hwndC = StartCollector(fExternalCollector ? HWND_DESKTOP : hwnd, 4); 5237 5287 if (hwndC) { 5238 if (!already && !fAutoTile && !fExternalCollector)5239 WinSetWindowPos(hwndC, HWND_TOP,5240 swp.x, swp.y, swp.cx, swp.cy,5241 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_ZORDER);5242 else if (fAutoTile && !already)5243 TileChildren(hwnd, TRUE);5244 WinSetWindowPos(hwndC, HWND_TOP, 0, 0, 0, 0, SWP_SHOW | SWP_RESTORE |5245 SWP_ACTIVATE);5246 if (SHORT1FROMMP(mp1) == IDM_GREP)5247 PostMsg(WinWindowFromID(hwndC, FID_CLIENT), WM_COMMAND,5248 MPFROM2SHORT(IDM_GREP, 0), MPVOID);5249 if (SHORT1FROMMP(mp1) == IDM_SEEALL)5250 PostMsg(WinWindowFromID(hwndC, FID_CLIENT), WM_COMMAND,5251 MPFROM2SHORT(IDM_SEEALL, 0), MPVOID);5288 if (!already && !fAutoTile && !fExternalCollector) 5289 WinSetWindowPos(hwndC, HWND_TOP, 5290 swp.x, swp.y, swp.cx, swp.cy, 5291 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_ZORDER); 5292 else if (fAutoTile && !already) 5293 TileChildren(hwnd, TRUE); 5294 WinSetWindowPos(hwndC, HWND_TOP, 0, 0, 0, 0, SWP_SHOW | SWP_RESTORE | 5295 SWP_ACTIVATE); 5296 if (SHORT1FROMMP(mp1) == IDM_GREP) 5297 PostMsg(WinWindowFromID(hwndC, FID_CLIENT), WM_COMMAND, 5298 MPFROM2SHORT(IDM_GREP, 0), MPVOID); 5299 if (SHORT1FROMMP(mp1) == IDM_SEEALL) 5300 PostMsg(WinWindowFromID(hwndC, FID_CLIENT), WM_COMMAND, 5301 MPFROM2SHORT(IDM_SEEALL, 0), MPVOID); 5252 5302 } 5253 5303 } … … 5260 5310 5261 5311 if (!toolhead || !toolhead->next) { 5262 firsttool = (toolhead) ? toolhead->id : 0;5263 break;5312 firsttool = (toolhead) ? toolhead->id : 0; 5313 break; 5264 5314 } 5265 5315 tool = find_tool(firsttool); 5266 5316 if (!tool) 5267 tool = toolhead;5317 tool = toolhead; 5268 5318 if (SHORT1FROMMP(mp1) == IDM_TOOLRIGHT) { 5269 tool = prev_tool(tool, TRUE);5270 firsttool = tool->id;5319 tool = prev_tool(tool, TRUE); 5320 firsttool = tool->id; 5271 5321 } 5272 5322 else { 5273 tool = next_tool(tool, TRUE);5274 firsttool = tool->id;5323 tool = next_tool(tool, TRUE); 5324 firsttool = tool->id; 5275 5325 } 5276 5326 ResizeTools(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5277 MAIN_TOOLS));5327 MAIN_TOOLS)); 5278 5328 } 5279 5329 break; … … 5285 5335 case IDM_TOOLBAR: 5286 5336 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5287 IDM_TOOLSUBMENU, &fToolbar, TRUE, "Toolbar");5337 IDM_TOOLSUBMENU, &fToolbar, TRUE, "Toolbar"); 5288 5338 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID); 5289 5339 WinShowWindow(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5290 MAIN_TOOLS), fToolbar);5340 MAIN_TOOLS), fToolbar); 5291 5341 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), 5292 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID);5342 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5293 5343 if (fDrivebar) 5294 5344 WinInvalidateRect(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5295 MAIN_DRIVES), NULL, TRUE);5345 MAIN_DRIVES), NULL, TRUE); 5296 5346 break; 5297 5347 5298 5348 case IDM_DRIVEBAR: 5299 5349 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5300 IDM_DRIVEBAR, &fDrivebar, TRUE, "Drivebar");5350 IDM_DRIVEBAR, &fDrivebar, TRUE, "Drivebar"); 5301 5351 WinShowWindow(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5302 MAIN_DRIVES), fDrivebar);5352 MAIN_DRIVES), fDrivebar); 5303 5353 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 5304 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID);5354 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5305 5355 PostMsg(hwnd, UM_BUILDDRIVEBAR, MPVOID, MPVOID); 5306 5356 break; … … 5308 5358 case IDM_USERLIST: 5309 5359 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5310 SHORT1FROMMP(mp1), &fUserComboBox, TRUE, "UserComboBox");5360 SHORT1FROMMP(mp1), &fUserComboBox, TRUE, "UserComboBox"); 5311 5361 WinShowWindow(hwndUserlist, fUserComboBox); 5312 5362 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 5313 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID);5363 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5314 5364 PostMsg(hwnd, UM_FILLUSERLIST, MPVOID, MPVOID); 5315 5365 PostMsg(hwnd, UM_FILLSETUPLIST, MPVOID, MPVOID); … … 5323 5373 WinSetWindowText(hwndAttr, NullStr); 5324 5374 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5325 SHORT1FROMMP(mp1), &fMoreButtons, TRUE, "MoreButtons");5375 SHORT1FROMMP(mp1), &fMoreButtons, TRUE, "MoreButtons"); 5326 5376 if (fMoreButtons) { 5327 5377 … … 5331 5381 5332 5382 if (hwndTemp) { 5333 WinSetFocus(HWND_DESKTOP, hwnd);5334 WinSetFocus(HWND_DESKTOP, hwndTemp);5383 WinSetFocus(HWND_DESKTOP, hwnd); 5384 WinSetFocus(HWND_DESKTOP, hwndTemp); 5335 5385 } 5336 5386 } 5337 5387 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 5338 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID);5388 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5339 5389 break; 5340 5390 5341 5391 case IDM_TOGGLEDRAGDIALOG: 5342 5392 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5343 IDM_TOGGLEDRAGDIALOG,5344 &fDragndropDlg,5345 TRUE,5346 "Drag&DropDlg");5393 IDM_TOGGLEDRAGDIALOG, 5394 &fDragndropDlg, 5395 TRUE, 5396 "Drag&DropDlg"); 5347 5397 break; 5348 5398 5349 5399 case IDM_SYNCUPDATES: 5350 5400 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5351 IDM_SYNCUPDATES,5352 &fSyncUpdates,5353 TRUE,5354 "SyncUpdates");5401 IDM_SYNCUPDATES, 5402 &fSyncUpdates, 5403 TRUE, 5404 "SyncUpdates"); 5355 5405 break; 5356 5406 … … 5362 5412 WinQueryWindowPos(hwnd, &swp); 5363 5413 WinSetWindowPos(hwndTree, HWND_TOP, 0, swp.cy - swpT.cy, 0, 0, 5364 SWP_MOVE);5414 SWP_MOVE); 5365 5415 } 5366 5416 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), SHORT1FROMMP(mp1), 5367 &fFreeTree, TRUE, "FreeTree");5417 &fFreeTree, TRUE, "FreeTree"); 5368 5418 if (fAutoTile) 5369 5419 TileChildren(hwnd, TRUE); … … 5372 5422 case IDM_AUTOTILE: 5373 5423 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5374 SHORT1FROMMP(mp1), &fAutoTile, TRUE, "AutoTile");5424 SHORT1FROMMP(mp1), &fAutoTile, TRUE, "AutoTile"); 5375 5425 if (fAutoTile) 5376 5426 TileChildren(hwnd, TRUE); … … 5379 5429 case IDM_TILEBACKWARDS: 5380 5430 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5381 SHORT1FROMMP(mp1), &fTileBackwards, TRUE, "TileBackwards");5431 SHORT1FROMMP(mp1), &fTileBackwards, TRUE, "TileBackwards"); 5382 5432 if (fAutoTile) 5383 5433 TileChildren(hwnd, TRUE); … … 5424 5474 default: 5425 5475 if (!SwitchCommand((HWND) WinQueryWindowULong(hwnd, QWL_USER), 5426 SHORT1FROMMP(mp1))) {5476 SHORT1FROMMP(mp1))) { 5427 5477 if (SHORT1FROMMP(mp1) >= IDM_COMMANDSTART && 5428 SHORT1FROMMP(mp1) < IDM_QUICKTOOLSTART) {5429 5430 INT x;5431 HWND hwndCnr;5432 5433 if (!cmdloaded)5434 load_commands();5435 hwndCnr = TopWindow(hwnd, (HWND) 0);5436 hwndCnr = (HWND) WinSendMsg(WinWindowFromID(hwndCnr, FID_CLIENT),5437 UM_CONTAINERHWND, MPVOID, MPVOID);5438 if (!hwndCnr) {5439 Runtime_Error2(pszSrcFile, __LINE__, IDS_NOWINDOWTEXT);5440 break;5441 }5442 x = SHORT1FROMMP(mp1) - IDM_COMMANDSTART;5443 if (x >= 0) {5444 x++;5445 RunCommand(hwndCnr, x);5446 if (fUnHilite) {5447 5448 PCNRITEM pci;5449 DIRCNRDATA *dcd = NULL;5450 5451 // 12 May 07 SHL fixme to understand? backwards maybe? looking for DIR_CNR?5452 if (WinQueryWindowUShort(hwndCnr, QWS_ID) != TREE_CNR)5453 dcd = INSTDATA(hwndCnr);5454 pci = (PCNRITEM) WinSendMsg(hwndCnr,5455 CM_QUERYRECORDEMPHASIS,5456 MPFROMLONG(CMA_FIRST),5457 MPFROMSHORT(CRA_CURSORED));5458 if (pci && (INT) pci != -1 &&5459 (pci->rc.flRecordAttr & CRA_SELECTED))5460 {5461 UnHilite(hwnd,5462 TRUE,5463 dcd ? &dcd->lastselection : NULL,5464 dcd ? dcd ->ulItemsToUnHilite : 0);5465 }5466 }5467 }5478 SHORT1FROMMP(mp1) < IDM_QUICKTOOLSTART) { 5479 5480 INT x; 5481 HWND hwndCnr; 5482 5483 if (!cmdloaded) 5484 load_commands(); 5485 hwndCnr = TopWindow(hwnd, (HWND) 0); 5486 hwndCnr = (HWND) WinSendMsg(WinWindowFromID(hwndCnr, FID_CLIENT), 5487 UM_CONTAINERHWND, MPVOID, MPVOID); 5488 if (!hwndCnr) { 5489 Runtime_Error2(pszSrcFile, __LINE__, IDS_NOWINDOWTEXT); 5490 break; 5491 } 5492 x = SHORT1FROMMP(mp1) - IDM_COMMANDSTART; 5493 if (x >= 0) { 5494 x++; 5495 RunCommand(hwndCnr, x); 5496 if (fUnHilite) { 5497 5498 PCNRITEM pci; 5499 DIRCNRDATA *dcd = NULL; 5500 5501 // 12 May 07 SHL fixme to understand? backwards maybe? looking for DIR_CNR? 5502 if (WinQueryWindowUShort(hwndCnr, QWS_ID) != TREE_CNR) 5503 dcd = INSTDATA(hwndCnr); 5504 pci = (PCNRITEM) WinSendMsg(hwndCnr, 5505 CM_QUERYRECORDEMPHASIS, 5506 MPFROMLONG(CMA_FIRST), 5507 MPFROMSHORT(CRA_CURSORED)); 5508 if (pci && (INT) pci != -1 && 5509 (pci->rc.flRecordAttr & CRA_SELECTED)) 5510 { 5511 UnHilite(hwnd, 5512 TRUE, 5513 dcd ? &dcd->lastselection : NULL, 5514 dcd ? dcd ->ulItemsToUnHilite : 0); 5515 } 5516 } 5517 } 5468 5518 } 5469 5519 else if (SHORT1FROMMP(mp1) >= IDM_QUICKTOOLSTART && 5470 SHORT1FROMMP(mp1) < IDM_QUICKTOOLSTART + 51) {5471 if (!qtloaded)5472 load_quicktools();5473 if (quicktool[SHORT1FROMMP(mp1) - IDM_QUICKTOOLSTART - 1]) {5474 if (fToolsChanged)5475 save_tools(NULL);5476 if (!load_tools(quicktool[SHORT1FROMMP(mp1) - IDM_QUICKTOOLSTART - 1]))5477 load_tools(NULL);5478 else {5479 strcpy(lasttoolbar,5480 quicktool[SHORT1FROMMP(mp1) - IDM_QUICKTOOLSTART - 1]);5481 PrfWriteProfileString(fmprof, FM3Str, "LastToolbar", lasttoolbar);5482 }5483 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID);5484 }5520 SHORT1FROMMP(mp1) < IDM_QUICKTOOLSTART + 51) { 5521 if (!qtloaded) 5522 load_quicktools(); 5523 if (quicktool[SHORT1FROMMP(mp1) - IDM_QUICKTOOLSTART - 1]) { 5524 if (fToolsChanged) 5525 save_tools(NULL); 5526 if (!load_tools(quicktool[SHORT1FROMMP(mp1) - IDM_QUICKTOOLSTART - 1])) 5527 load_tools(NULL); 5528 else { 5529 strcpy(lasttoolbar, 5530 quicktool[SHORT1FROMMP(mp1) - IDM_QUICKTOOLSTART - 1]); 5531 PrfWriteProfileString(fmprof, FM3Str, "LastToolbar", lasttoolbar); 5532 } 5533 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID); 5534 } 5485 5535 } 5486 5536 else { 5487 5537 5488 HWND hwndActive;5489 5490 hwndActive = TopWindow(hwnd, (HWND) 0);5491 if (hwndActive)5492 PostMsg(WinWindowFromID(hwndActive, FID_CLIENT),5493 WM_COMMAND, mp1, mp2);5538 HWND hwndActive; 5539 5540 hwndActive = TopWindow(hwnd, (HWND) 0); 5541 if (hwndActive) 5542 PostMsg(WinWindowFromID(hwndActive, FID_CLIENT), 5543 WM_COMMAND, mp1, mp2); 5494 5544 } 5495 5545 } … … 5500 5550 5501 5551 static MRESULT EXPENTRY MainWMOnce(HWND hwnd, ULONG msg, MPARAM mp1, 5502 MPARAM mp2)5552 MPARAM mp2) 5503 5553 { 5504 5554 TID tid; … … 5523 5573 if (_beginthread(MakeMainObjWin, NULL, 245760, MPVOID) == -1) { 5524 5574 Runtime_Error(pszSrcFile, __LINE__, 5525 GetPString(IDS_COULDNTSTARTTHREADTEXT));5575 GetPString(IDS_COULDNTSTARTTHREADTEXT)); 5526 5576 PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID); 5527 5577 return 0; … … 5542 5592 5543 5593 if (!WinCreateWindow(hwndFrame, 5544 WC_BUTTON,5545 "I",5546 WS_VISIBLE | BS_PUSHBUTTON | BS_NOPOINTERFOCUS,5547 ((swp.cx -5548 WinQuerySysValue(HWND_DESKTOP,5549 SV_CXMINMAXBUTTON)) -5550 WinQuerySysValue(HWND_DESKTOP,5551 SV_CXMINMAXBUTTON) / 2) -5552 WinQuerySysValue(HWND_DESKTOP,5553 SV_CXSIZEBORDER),5554 (swp.cy - WinQuerySysValue(HWND_DESKTOP,5555 SV_CYMINMAXBUTTON)) -5556 WinQuerySysValue(HWND_DESKTOP,5557 SV_CYSIZEBORDER),5558 WinQuerySysValue(HWND_DESKTOP,5559 SV_CXMINMAXBUTTON) / 2,5560 WinQuerySysValue(HWND_DESKTOP,5561 SV_CYMINMAXBUTTON),5562 hwnd, HWND_TOP, IDM_IDEALSIZE, NULL, NULL)) {5594 WC_BUTTON, 5595 "I", 5596 WS_VISIBLE | BS_PUSHBUTTON | BS_NOPOINTERFOCUS, 5597 ((swp.cx - 5598 WinQuerySysValue(HWND_DESKTOP, 5599 SV_CXMINMAXBUTTON)) - 5600 WinQuerySysValue(HWND_DESKTOP, 5601 SV_CXMINMAXBUTTON) / 2) - 5602 WinQuerySysValue(HWND_DESKTOP, 5603 SV_CXSIZEBORDER), 5604 (swp.cy - WinQuerySysValue(HWND_DESKTOP, 5605 SV_CYMINMAXBUTTON)) - 5606 WinQuerySysValue(HWND_DESKTOP, 5607 SV_CYSIZEBORDER), 5608 WinQuerySysValue(HWND_DESKTOP, 5609 SV_CXMINMAXBUTTON) / 2, 5610 WinQuerySysValue(HWND_DESKTOP, 5611 SV_CYMINMAXBUTTON), 5612 hwnd, HWND_TOP, IDM_IDEALSIZE, NULL, NULL)) { 5563 5613 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5564 5614 } 5565 5615 else { 5566 5616 WinSubclassWindow(WinWindowFromID(hwndFrame, IDM_IDEALSIZE), 5567 IdealButtonProc);5617 IdealButtonProc); 5568 5618 SetPresParams(WinWindowFromID(hwndFrame, 5569 IDM_IDEALSIZE),5570 NULL, NULL, NULL, GetPString(IDS_10SYSTEMVIOTEXT));5619 IDM_IDEALSIZE), 5620 NULL, NULL, NULL, GetPString(IDS_10SYSTEMVIOTEXT)); 5571 5621 } 5572 5622 5573 5623 hwndTmp = WinCreateWindow(hwndFrame, 5574 WC_BUTTON,5575 "#1019",5576 WS_VISIBLE | BS_PUSHBUTTON | BS_NOPOINTERFOCUS |5577 BS_BITMAP,5578 swp.cx - 46,5579 swp.y + 2,5580 24,5581 22, hwnd, HWND_TOP, IDM_OPENWALK, NULL, NULL);5624 WC_BUTTON, 5625 "#1019", 5626 WS_VISIBLE | BS_PUSHBUTTON | BS_NOPOINTERFOCUS | 5627 BS_BITMAP, 5628 swp.cx - 46, 5629 swp.y + 2, 5630 24, 5631 22, hwnd, HWND_TOP, IDM_OPENWALK, NULL, NULL); 5582 5632 if (!hwndTmp) 5583 5633 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5584 5634 5585 5635 hwndTmp = WinCreateWindow(hwndFrame, 5586 WC_BUTTON,5587 "#3062",5588 WS_VISIBLE | BS_PUSHBUTTON | BS_NOPOINTERFOCUS |5589 BS_BITMAP,5590 swp.cx - 22,5591 swp.y + 2,5592 24,5593 22, hwnd, HWND_TOP, IDM_USERLIST, NULL, NULL);5636 WC_BUTTON, 5637 "#3062", 5638 WS_VISIBLE | BS_PUSHBUTTON | BS_NOPOINTERFOCUS | 5639 BS_BITMAP, 5640 swp.cx - 22, 5641 swp.y + 2, 5642 24, 5643 22, hwnd, HWND_TOP, IDM_USERLIST, NULL, NULL); 5594 5644 if (!hwndTmp) 5595 5645 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5596 5646 5597 5647 hwndUserlist = WinCreateWindow(hwndFrame, 5598 WC_COMBOBOX,5599 (PSZ) NULL,5600 WS_VISIBLE | CBS_DROPDOWN |5601 LS_HORZSCROLL,5602 (swp.x +5603 WinQuerySysValue(HWND_DESKTOP,5604 SV_CXSIZEBORDER) + 48L),5605 (swp.cy -5606 WinQuerySysValue(HWND_DESKTOP,5607 SV_CYSIZEBORDER)) - 60,5608 ((swp.cx -5609 (WinQuerySysValue(HWND_DESKTOP,5610 SV_CXSIZEBORDER) *5611 2)) - 64L), 60L, hwndFrame, HWND_TOP,5612 MAIN_USERLIST, NULL, NULL);5648 WC_COMBOBOX, 5649 (PSZ) NULL, 5650 WS_VISIBLE | CBS_DROPDOWN | 5651 LS_HORZSCROLL, 5652 (swp.x + 5653 WinQuerySysValue(HWND_DESKTOP, 5654 SV_CXSIZEBORDER) + 48L), 5655 (swp.cy - 5656 WinQuerySysValue(HWND_DESKTOP, 5657 SV_CYSIZEBORDER)) - 60, 5658 ((swp.cx - 5659 (WinQuerySysValue(HWND_DESKTOP, 5660 SV_CXSIZEBORDER) * 5661 2)) - 64L), 60L, hwndFrame, HWND_TOP, 5662 MAIN_USERLIST, NULL, NULL); 5613 5663 if (!hwndUserlist) 5614 5664 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5615 5665 hwndCmdlist = WinCreateWindow(hwndFrame, 5616 WC_COMBOBOX,5617 (PSZ) NULL,5618 WS_VISIBLE | CBS_DROPDOWN |5619 LS_HORZSCROLL,5620 (swp.x +5621 WinQuerySysValue(HWND_DESKTOP,5622 SV_CXSIZEBORDER) + 48L),5623 (swp.cy -5624 WinQuerySysValue(HWND_DESKTOP,5625 SV_CYSIZEBORDER)) - 60,5626 ((swp.cx -5627 (WinQuerySysValue(HWND_DESKTOP,5628 SV_CXSIZEBORDER) * 2)) -5629 64L), 60L, hwndFrame, HWND_TOP,5630 MAIN_CMDLIST, NULL, NULL);5666 WC_COMBOBOX, 5667 (PSZ) NULL, 5668 WS_VISIBLE | CBS_DROPDOWN | 5669 LS_HORZSCROLL, 5670 (swp.x + 5671 WinQuerySysValue(HWND_DESKTOP, 5672 SV_CXSIZEBORDER) + 48L), 5673 (swp.cy - 5674 WinQuerySysValue(HWND_DESKTOP, 5675 SV_CYSIZEBORDER)) - 60, 5676 ((swp.cx - 5677 (WinQuerySysValue(HWND_DESKTOP, 5678 SV_CXSIZEBORDER) * 2)) - 5679 64L), 60L, hwndFrame, HWND_TOP, 5680 MAIN_CMDLIST, NULL, NULL); 5631 5681 if (!hwndCmdlist) 5632 5682 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5633 5683 WinSetWindowText(hwndCmdlist, GetPString(IDS_COMMANDSTEXT)); 5634 5684 hwndStatelist = WinCreateWindow(hwndFrame, 5635 WC_COMBOBOX,5636 (PSZ) NULL,5637 WS_VISIBLE | CBS_DROPDOWN |5638 LS_HORZSCROLL,5639 (swp.x +5640 WinQuerySysValue(HWND_DESKTOP,5641 SV_CXSIZEBORDER) + 48L),5642 (swp.cy -5643 WinQuerySysValue(HWND_DESKTOP,5644 SV_CYSIZEBORDER)) - 60,5645 ((swp.cx -5646 (WinQuerySysValue(HWND_DESKTOP,5647 SV_CXSIZEBORDER) *5648 2)) - 64L), 60L, hwndFrame, HWND_TOP,5649 MAIN_SETUPLIST, NULL, NULL);5685 WC_COMBOBOX, 5686 (PSZ) NULL, 5687 WS_VISIBLE | CBS_DROPDOWN | 5688 LS_HORZSCROLL, 5689 (swp.x + 5690 WinQuerySysValue(HWND_DESKTOP, 5691 SV_CXSIZEBORDER) + 48L), 5692 (swp.cy - 5693 WinQuerySysValue(HWND_DESKTOP, 5694 SV_CYSIZEBORDER)) - 60, 5695 ((swp.cx - 5696 (WinQuerySysValue(HWND_DESKTOP, 5697 SV_CXSIZEBORDER) * 5698 2)) - 64L), 60L, hwndFrame, HWND_TOP, 5699 MAIN_SETUPLIST, NULL, NULL); 5650 5700 if (!hwndStatelist) 5651 5701 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5652 5702 5653 5703 hwndDrivelist = WinCreateWindow(hwndFrame, 5654 WC_COMBOBOX,5655 (PSZ) NULL,5656 WS_VISIBLE | CBS_DROPDOWN,5657 (swp.x +5658 WinQuerySysValue(HWND_DESKTOP,5659 SV_CXSIZEBORDER)),5660 (swp.cy -5661 WinQuerySysValue(HWND_DESKTOP,5662 SV_CYSIZEBORDER)) - 60,5663 48L,5664 60L,5665 hwndFrame,5666 HWND_TOP, MAIN_DRIVELIST, NULL, NULL);5704 WC_COMBOBOX, 5705 (PSZ) NULL, 5706 WS_VISIBLE | CBS_DROPDOWN, 5707 (swp.x + 5708 WinQuerySysValue(HWND_DESKTOP, 5709 SV_CXSIZEBORDER)), 5710 (swp.cy - 5711 WinQuerySysValue(HWND_DESKTOP, 5712 SV_CYSIZEBORDER)) - 60, 5713 48L, 5714 60L, 5715 hwndFrame, 5716 HWND_TOP, MAIN_DRIVELIST, NULL, NULL); 5667 5717 if (!hwndDrivelist) 5668 5718 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5669 5719 SetPresParams(hwndDrivelist, 5670 NULL, NULL, NULL, GetPString(IDS_10SYSTEMMONOTEXT));5720 NULL, NULL, NULL, GetPString(IDS_10SYSTEMMONOTEXT)); 5671 5721 hwndButtonlist = WinCreateWindow(hwndFrame, 5672 WC_COMBOBOX,5673 (PSZ) NULL,5674 WS_VISIBLE | CBS_DROPDOWN |5675 LS_HORZSCROLL,5676 (swp.cx -5677 WinQuerySysValue(HWND_DESKTOP,5678 SV_CXSIZEBORDER)) -5679 164L,5680 (swp.cy -5681 WinQuerySysValue(HWND_DESKTOP,5682 SV_CYSIZEBORDER)) - 60,5683 164L, 60L, hwndFrame, HWND_TOP,5684 MAIN_BUTTONLIST, NULL, NULL);5722 WC_COMBOBOX, 5723 (PSZ) NULL, 5724 WS_VISIBLE | CBS_DROPDOWN | 5725 LS_HORZSCROLL, 5726 (swp.cx - 5727 WinQuerySysValue(HWND_DESKTOP, 5728 SV_CXSIZEBORDER)) - 5729 164L, 5730 (swp.cy - 5731 WinQuerySysValue(HWND_DESKTOP, 5732 SV_CYSIZEBORDER)) - 60, 5733 164L, 60L, hwndFrame, HWND_TOP, 5734 MAIN_BUTTONLIST, NULL, NULL); 5685 5735 if (!hwndButtonlist) 5686 5736 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5687 5737 WinSendMsg(WinWindowFromID(hwndUserlist, CBID_EDIT), 5688 EM_SETTEXTLIMIT, MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);5738 EM_SETTEXTLIMIT, MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 5689 5739 WinSendMsg(WinWindowFromID(hwndStatelist, CBID_EDIT), 5690 EM_SETTEXTLIMIT, MPFROM2SHORT(STATE_NAME_MAX_BYTES, 0), MPVOID);5740 EM_SETTEXTLIMIT, MPFROM2SHORT(STATE_NAME_MAX_BYTES, 0), MPVOID); 5691 5741 WinSendMsg(WinWindowFromID(hwndDrivelist, CBID_EDIT), 5692 EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID);5742 EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID); 5693 5743 WinSendMsg(WinWindowFromID(hwndButtonlist, CBID_EDIT), 5694 EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID);5744 EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID); 5695 5745 WinSendMsg(WinWindowFromID(hwndCmdlist, CBID_EDIT), 5696 EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID);5746 EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID); 5697 5747 5698 5748 oldproc = WinSubclassWindow(WinWindowFromID(hwndUserlist, CBID_EDIT), 5699 DropDownListProc);5749 DropDownListProc); 5700 5750 WinSetWindowPtr(WinWindowFromID(hwndUserlist, CBID_EDIT), 5701 QWL_USER, (PVOID) oldproc);5751 QWL_USER, (PVOID) oldproc); 5702 5752 oldproc = WinSubclassWindow(WinWindowFromID(hwndCmdlist, CBID_EDIT), 5703 DropDownListProc);5753 DropDownListProc); 5704 5754 WinSetWindowPtr(WinWindowFromID(hwndCmdlist, CBID_EDIT), 5705 QWL_USER, (PVOID) oldproc);5755 QWL_USER, (PVOID) oldproc); 5706 5756 oldproc = WinSubclassWindow(WinWindowFromID(hwndButtonlist, CBID_EDIT), 5707 DropDownListProc);5757 DropDownListProc); 5708 5758 WinSetWindowPtr(WinWindowFromID(hwndButtonlist, CBID_EDIT), 5709 QWL_USER, (PVOID) oldproc);5759 QWL_USER, (PVOID) oldproc); 5710 5760 oldproc = WinSubclassWindow(WinWindowFromID(hwndStatelist, CBID_EDIT), 5711 DropDownListProc);5761 DropDownListProc); 5712 5762 WinSetWindowPtr(WinWindowFromID(hwndStatelist, CBID_EDIT), 5713 QWL_USER, (PVOID) oldproc);5763 QWL_USER, (PVOID) oldproc); 5714 5764 oldproc = WinSubclassWindow(WinWindowFromID(hwndDrivelist, CBID_EDIT), 5715 DropDownListProc);5765 DropDownListProc); 5716 5766 WinSetWindowPtr(WinWindowFromID(hwndDrivelist, CBID_EDIT), 5717 QWL_USER, (PVOID) oldproc);5767 QWL_USER, (PVOID) oldproc); 5718 5768 oldproc = WinSubclassWindow(hwndUserlist, DropDownListProc); 5719 5769 WinSetWindowPtr(hwndUserlist, QWL_USER, (PVOID) oldproc); … … 5727 5777 WinSetWindowPtr(hwndButtonlist, QWL_USER, (PVOID) oldproc); 5728 5778 oldproc = WinSubclassWindow(WinWindowFromID(hwndFrame, IDM_USERLIST), 5729 ChildFrameButtonProc);5779 ChildFrameButtonProc); 5730 5780 WinSetWindowPtr(WinWindowFromID(hwndFrame, IDM_USERLIST), 5731 QWL_USER, (PVOID) oldproc);5781 QWL_USER, (PVOID) oldproc); 5732 5782 oldproc = WinSubclassWindow(WinWindowFromID(hwndFrame, IDM_OPENWALK), 5733 ChildFrameButtonProc);5783 ChildFrameButtonProc); 5734 5784 WinSetWindowPtr(WinWindowFromID(hwndFrame, IDM_OPENWALK), 5735 QWL_USER, (PVOID) oldproc);5785 QWL_USER, (PVOID) oldproc); 5736 5786 hwndMenu = WinWindowFromID(hwndFrame, FID_MENU); 5737 5787 WinSendMsg(hwnd, UM_ADDTOMENU, MPVOID, MPVOID); … … 5747 5797 hwndSysMenu = WinWindowFromID(hwndFrame, FID_SYSMENU); 5748 5798 idSysMenu = SHORT1FROMMR(WinSendMsg(hwndSysMenu, 5749 MM_ITEMIDFROMPOSITION,5750 MPVOID, MPVOID));5799 MM_ITEMIDFROMPOSITION, 5800 MPVOID, MPVOID)); 5751 5801 WinSendMsg(hwndSysMenu, 5752 MM_QUERYITEM, MPFROM2SHORT(idSysMenu, 0), MPFROMP(&mit));5802 MM_QUERYITEM, MPFROM2SHORT(idSysMenu, 0), MPFROMP(&mit)); 5753 5803 hwndSysSubMenu = mit.hwndSubMenu; 5754 5804 mi.iPosition = MIT_END; … … 5759 5809 mi.id = IDM_IDEALSIZE; 5760 5810 WinSendMsg(hwndSysSubMenu, 5761 MM_INSERTITEM,5762 MPFROMP(&mi), MPFROMP(GetPString(IDS_IDEALMENUTEXT)));5811 MM_INSERTITEM, 5812 MPFROMP(&mi), MPFROMP(GetPString(IDS_IDEALMENUTEXT))); 5763 5813 mi.afStyle = MIS_TEXT; 5764 5814 mi.id = IDM_HIDEMENU; 5765 5815 WinSendMsg(hwndSysSubMenu, 5766 MM_INSERTITEM,5767 MPFROMP(&mi), MPFROMP(GetPString(IDS_HIDEMENUTEXT)));5816 MM_INSERTITEM, 5817 MPFROMP(&mi), MPFROMP(GetPString(IDS_HIDEMENUTEXT))); 5768 5818 SetSysMenu(hwndSysMenu); 5769 5819 5770 5820 size = sizeof(BOOL); 5771 5821 if (PrfQueryProfileData(fmprof, 5772 FM3Str,5773 "MenuInvisible", &temp, &size) && size && temp)5822 FM3Str, 5823 "MenuInvisible", &temp, &size) && size && temp) 5774 5824 WinSendMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_HIDEMENU, 0), MPVOID); 5775 5825 size = sizeof(BOOL); 5776 5826 if (PrfQueryProfileData(fmprof, 5777 FM3Str, "FreeTree", &temp, &size) && size && temp)5827 FM3Str, "FreeTree", &temp, &size) && size && temp) 5778 5828 WinSendMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_FREETREE, 0), MPVOID); 5779 5829 size = sizeof(BOOL); 5780 5830 if (PrfQueryProfileData(fmprof, 5781 FM3Str,5782 "AutoTile", &temp, &size) && size && !temp)5831 FM3Str, 5832 "AutoTile", &temp, &size) && size && !temp) 5783 5833 WinSendMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_AUTOTILE, 0), MPVOID); 5784 5834 size = sizeof(BOOL); 5785 5835 if (PrfQueryProfileData(fmprof, 5786 FM3Str, "Toolbar", &temp, &size) && size && !temp)5836 FM3Str, "Toolbar", &temp, &size) && size && !temp) 5787 5837 WinSendMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_TOOLBAR, 0), MPVOID); 5788 5838 … … 5807 5857 hwndTree = StartTreeCnr(hwnd, 4); 5808 5858 if (!hwndTree) 5809 WinDestroyWindow(WinQueryWindow(hwnd, QW_PARENT));5859 WinDestroyWindow(WinQueryWindow(hwnd, QW_PARENT)); 5810 5860 else { 5811 if (!fSaveState ||5812 !PrfQueryProfileData(fmprof,5813 FM3Str,5814 "LastTreePos",5815 &swp, &size) || size != sizeof(SWP)) {5816 5817 INT ratio, height = 0;5818 5819 if (!fNoTreeGap)5820 height = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 2;5821 size = sizeof(ratio);5822 if (!PrfQueryProfileData(fmprof,5823 FM3Str,5824 "TreeWindowRatio",5825 (PVOID) & ratio,5826 &size) || size < sizeof(ratio))5827 ratio = 400;5828 WinSetWindowPos(hwndTree,5829 HWND_TOP,5830 0,5831 height,5832 (swp.cx * 100) / ratio,5833 swp.cy - height,5834 SWP_SHOW | SWP_SIZE | SWP_MOVE |5835 SWP_ACTIVATE | SWP_ZORDER);5836 }5837 else5838 WinSetWindowPos(hwndTree,5839 HWND_TOP,5840 swp.x,5841 swp.y,5842 swp.cx,5843 swp.cy,5844 swp.fl | SWP_MOVE | SWP_SIZE | SWP_SHOW |5845 SWP_ZORDER | SWP_ACTIVATE);5861 if (!fSaveState || 5862 !PrfQueryProfileData(fmprof, 5863 FM3Str, 5864 "LastTreePos", 5865 &swp, &size) || size != sizeof(SWP)) { 5866 5867 INT ratio, height = 0; 5868 5869 if (!fNoTreeGap) 5870 height = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 2; 5871 size = sizeof(ratio); 5872 if (!PrfQueryProfileData(fmprof, 5873 FM3Str, 5874 "TreeWindowRatio", 5875 (PVOID) & ratio, 5876 &size) || size < sizeof(ratio)) 5877 ratio = 400; 5878 WinSetWindowPos(hwndTree, 5879 HWND_TOP, 5880 0, 5881 height, 5882 (swp.cx * 100) / ratio, 5883 swp.cy - height, 5884 SWP_SHOW | SWP_SIZE | SWP_MOVE | 5885 SWP_ACTIVATE | SWP_ZORDER); 5886 } 5887 else 5888 WinSetWindowPos(hwndTree, 5889 HWND_TOP, 5890 swp.x, 5891 swp.y, 5892 swp.cx, 5893 swp.cy, 5894 swp.fl | SWP_MOVE | SWP_SIZE | SWP_SHOW | 5895 SWP_ZORDER | SWP_ACTIVATE); 5846 5896 } 5847 5897 // ResizeTools(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5848 // MAIN_TOOLS));5898 // MAIN_TOOLS)); 5849 5899 } 5850 5900 PostMsg(MainObjectHwnd, UM_SETUP3, mp1, mp2); … … 5871 5921 5872 5922 for (x = 1; x < argc; x++) { 5873 if (*argv[x] == '/' || *argv[x] == ';')5874 continue;5875 if (!IsFile(argv[x]) && !FindDirCnrByName(argv[x], FALSE))5876 OpenDirCnr((HWND) 0, hwndMain, hwndTree, TRUE, argv[x]);5923 if (*argv[x] == '/' || *argv[x] == ';') 5924 continue; 5925 if (!IsFile(argv[x]) && !FindDirCnrByName(argv[x], FALSE)) 5926 OpenDirCnr((HWND) 0, hwndMain, hwndTree, TRUE, argv[x]); 5877 5927 } 5878 5928 } … … 5892 5942 hwndActive = TopWindow(hwnd, hwndTree); 5893 5943 if (hwndActive) 5894 WinSetWindowPos(hwndActive, HWND_TOP, 0, 0, 0, 0, SWP_ACTIVATE);5944 WinSetWindowPos(hwndActive, HWND_TOP, 0, 0, 0, 0, SWP_ACTIVATE); 5895 5945 } 5896 5946 if (fStartMinimized || fReminimize) … … 5925 5975 case WM_CONTROLPOINTER: 5926 5976 if (!fNoFinger && 5927 (SHORT1FROMMP(mp1) == IDM_OPENWALK ||5928 SHORT1FROMMP(mp1) == IDM_USERLIST))5977 (SHORT1FROMMP(mp1) == IDM_OPENWALK || 5978 SHORT1FROMMP(mp1) == IDM_USERLIST)) 5929 5979 return MRFROMLONG(hptrFinger); 5930 5980 break; … … 5966 6016 if (mp1) { 5967 6017 if (fUserComboBox) 5968 WinSetWindowText(WinWindowFromID(hwndUserlist, CBID_EDIT),5969 (CHAR *)mp1);6018 WinSetWindowText(WinWindowFromID(hwndUserlist, CBID_EDIT), 6019 (CHAR *)mp1); 5970 6020 if (add_udir(FALSE, (CHAR *)mp1)) { 5971 if (fUserComboBox && fAutoAddDirs) {5972 WinSendMsg(hwndUserlist, LM_INSERTITEM,5973 MPFROM2SHORT(LIT_SORTASCENDING, 0),5974 MPFROMP((CHAR *)mp1));5975 }6021 if (fUserComboBox && fAutoAddDirs) { 6022 WinSendMsg(hwndUserlist, LM_INSERTITEM, 6023 MPFROM2SHORT(LIT_SORTASCENDING, 0), 6024 MPFROMP((CHAR *)mp1)); 6025 } 5976 6026 } 5977 6027 } … … 6005 6055 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swp); 6006 6056 if (!(swp.fl & (SWP_HIDE | SWP_MINIMIZE))) { 6007 WinStoreWindowPos(FM2Str,6008 "MainWindowPos", WinQueryWindow(hwnd, QW_PARENT));6009 if (!fNoSaveState && fSaveState)6010 SaveDirCnrState(hwnd, GetPString(IDS_SHUTDOWNSTATE));6057 WinStoreWindowPos(FM2Str, 6058 "MainWindowPos", WinQueryWindow(hwnd, QW_PARENT)); 6059 if (!fNoSaveState && fSaveState) 6060 SaveDirCnrState(hwnd, GetPString(IDS_SHUTDOWNSTATE)); 6011 6061 } 6012 6062 } … … 6018 6068 case 1: 6019 6069 { 6020 HWND hwndCurrent;6021 ULONG wmsg;6022 6023 wmsg = (SHORT1FROMMP(mp1) == 0) ? UM_FILESMENU : UM_VIEWSMENU;6024 hwndCurrent = TopWindow(hwnd, (HWND) 0);6025 PortholeInit((HWND) WinSendMsg(WinWindowFromID(hwndCurrent,6026 FID_CLIENT), wmsg,6027 MPVOID, MPVOID), mp1, mp2);6070 HWND hwndCurrent; 6071 ULONG wmsg; 6072 6073 wmsg = (SHORT1FROMMP(mp1) == 0) ? UM_FILESMENU : UM_VIEWSMENU; 6074 hwndCurrent = TopWindow(hwnd, (HWND) 0); 6075 PortholeInit((HWND) WinSendMsg(WinWindowFromID(hwndCurrent, 6076 FID_CLIENT), wmsg, 6077 MPVOID, MPVOID), mp1, mp2); 6028 6078 } 6029 6079 break; … … 6043 6093 */ 6044 6094 { 6045 HWND hwndMenu, hwndSubMenu;6046 MENUITEM mi;6047 6048 hwndMenu = WinQueryWindowULong(hwnd, QWL_USER);6049 memset(&mi, 0, sizeof(mi));6050 mi.iPosition = MIT_END;6051 mi.afStyle = MIS_TEXT;6052 if (!WinSendMsg(hwndMenu, MM_QUERYITEM,6053 MPFROM2SHORT(IDM_WINDOWSMENU, TRUE), MPFROMP(&mi)))6054 break;6055 hwndSubMenu = mi.hwndSubMenu;6056 SetupWinList(hwndSubMenu, hwnd, WinQueryWindow(hwnd, QW_PARENT));6095 HWND hwndMenu, hwndSubMenu; 6096 MENUITEM mi; 6097 6098 hwndMenu = WinQueryWindowULong(hwnd, QWL_USER); 6099 memset(&mi, 0, sizeof(mi)); 6100 mi.iPosition = MIT_END; 6101 mi.afStyle = MIS_TEXT; 6102 if (!WinSendMsg(hwndMenu, MM_QUERYITEM, 6103 MPFROM2SHORT(IDM_WINDOWSMENU, TRUE), MPFROMP(&mi))) 6104 break; 6105 hwndSubMenu = mi.hwndSubMenu; 6106 SetupWinList(hwndSubMenu, hwnd, WinQueryWindow(hwnd, QW_PARENT)); 6057 6107 } 6058 6108 break; … … 6060 6110 default: 6061 6111 { 6062 HWND hwndCurrent;6063 6064 hwndCurrent = TopWindow(hwnd, (HWND) 0);6065 if (hwndCurrent)6066 WinSendMsg(hwndCurrent, UM_INITMENU, mp1, mp2);6112 HWND hwndCurrent; 6113 6114 hwndCurrent = TopWindow(hwnd, (HWND) 0); 6115 if (hwndCurrent) 6116 WinSendMsg(hwndCurrent, UM_INITMENU, mp1, mp2); 6067 6117 } 6068 6118 break; … … 6072 6122 case UM_ADDTOMENU: 6073 6123 AddToMenu((CHAR *)mp1, WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 6074 FID_MENU));6124 FID_MENU)); 6075 6125 return 0; 6076 6126 … … 6085 6135 info = cmdhead; 6086 6136 while (info) { 6087 WinSendMsg(hwndCmdlist, LM_INSERTITEM,6088 MPFROM2SHORT(LIT_END, 0), MPFROMP(info->title));6089 info = info->next;6137 WinSendMsg(hwndCmdlist, LM_INSERTITEM, 6138 MPFROM2SHORT(LIT_END, 0), MPFROMP(info->title)); 6139 info = info->next; 6090 6140 } 6091 6141 } … … 6111 6161 ulSearchCount = 1; 6112 6162 if (!DosFindFirst("*.TLS", &hDir, FILE_READONLY | FILE_ARCHIVED, 6113 &findbuf, sizeof(FILEFINDBUF3),6114 &ulSearchCount, FIL_STANDARD)) {6115 do {6116 priority_bumped();6117 if (!foundit) {6118 thisone = FALSE;6119 p = strrchr(lasttoolbar, '\\');6120 if (!p)6121 p = lasttoolbar;6122 else6123 p++;6124 if (!stricmp(findbuf.achName, p))6125 thisone = TRUE;6126 }6127 p = strrchr(findbuf.achName, '.');6128 if (p)6129 *p = 0;6130 sSelect = (SHORT) WinSendMsg(hwndButtonlist, LM_INSERTITEM,6131 MPFROM2SHORT(LIT_SORTASCENDING, 0),6132 MPFROMP(findbuf.achName));6133 if (!foundit && thisone && sSelect >= 0) {6134 WinSendMsg(hwndButtonlist, LM_SELECTITEM,6135 MPFROM2SHORT(sSelect, 0), MPFROMLONG(TRUE));6136 foundit = TRUE;6137 }6138 }6139 while (!DosFindNext(hDir, &findbuf, sizeof(FILEFINDBUF3),6140 &ulSearchCount));6141 DosFindClose(hDir);6142 priority_bumped();6163 &findbuf, sizeof(FILEFINDBUF3), 6164 &ulSearchCount, FIL_STANDARD)) { 6165 do { 6166 priority_bumped(); 6167 if (!foundit) { 6168 thisone = FALSE; 6169 p = strrchr(lasttoolbar, '\\'); 6170 if (!p) 6171 p = lasttoolbar; 6172 else 6173 p++; 6174 if (!stricmp(findbuf.achName, p)) 6175 thisone = TRUE; 6176 } 6177 p = strrchr(findbuf.achName, '.'); 6178 if (p) 6179 *p = 0; 6180 sSelect = (SHORT) WinSendMsg(hwndButtonlist, LM_INSERTITEM, 6181 MPFROM2SHORT(LIT_SORTASCENDING, 0), 6182 MPFROMP(findbuf.achName)); 6183 if (!foundit && thisone && sSelect >= 0) { 6184 WinSendMsg(hwndButtonlist, LM_SELECTITEM, 6185 MPFROM2SHORT(sSelect, 0), MPFROMLONG(TRUE)); 6186 foundit = TRUE; 6187 } 6188 } 6189 while (!DosFindNext(hDir, &findbuf, sizeof(FILEFINDBUF3), 6190 &ulSearchCount)); 6191 DosFindClose(hDir); 6192 priority_bumped(); 6143 6193 } 6144 6194 WinSetWindowText(hwndButtonlist, GetPString(IDS_TOOLBARTEXT)); … … 6159 6209 6160 6210 if (!loadedudirs) 6161 load_udirs();6211 load_udirs(); 6162 6212 DosError(FERR_DISABLEHARDERR); 6163 6213 DosQCurDisk(&ulDriveNum, &ulDriveMap); 6164 6214 info = udirhead; 6165 6215 while (info) { 6166 if (IsFullName(info->path) &&6167 !(driveflags[toupper(*info->path) - 'A'] &6168 (DRIVE_IGNORE | DRIVE_INVALID))) {6169 DosError(FERR_DISABLEHARDERR);6170 hDir = HDIR_CREATE;6171 ulSearchCount = 1;6172 if (!IsRoot(info->path))6173 rc = DosFindFirst(info->path, &hDir, FILE_DIRECTORY |6174 MUST_HAVE_DIRECTORY | FILE_READONLY |6175 FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN,6176 &findbuf, sizeof(FILEFINDBUF3),6177 &ulSearchCount, FIL_STANDARD);6178 else {6179 rc = 0;6180 findbuf.attrFile = FILE_DIRECTORY;6181 }6182 priority_bumped();6183 if (!rc) {6184 if (!IsRoot(info->path))6185 DosFindClose(hDir);6186 if (findbuf.attrFile & FILE_DIRECTORY)6187 WinSendMsg(hwndUserlist, LM_INSERTITEM,6188 MPFROM2SHORT(LIT_SORTASCENDING, 0),6189 MPFROMP(info->path));6190 else {6191 temp = info->next;6192 remove_udir(info->path);6193 info = temp;6194 continue;6195 }6196 }6197 else if (!(ulDriveMap & (1 << (toupper(*info->path) - 'A')))) {6198 temp = info->next;6199 remove_udir(info->path);6200 info = temp;6201 continue;6202 }6203 }6204 info = info->next;6216 if (IsFullName(info->path) && 6217 !(driveflags[toupper(*info->path) - 'A'] & 6218 (DRIVE_IGNORE | DRIVE_INVALID))) { 6219 DosError(FERR_DISABLEHARDERR); 6220 hDir = HDIR_CREATE; 6221 ulSearchCount = 1; 6222 if (!IsRoot(info->path)) 6223 rc = DosFindFirst(info->path, &hDir, FILE_DIRECTORY | 6224 MUST_HAVE_DIRECTORY | FILE_READONLY | 6225 FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN, 6226 &findbuf, sizeof(FILEFINDBUF3), 6227 &ulSearchCount, FIL_STANDARD); 6228 else { 6229 rc = 0; 6230 findbuf.attrFile = FILE_DIRECTORY; 6231 } 6232 priority_bumped(); 6233 if (!rc) { 6234 if (!IsRoot(info->path)) 6235 DosFindClose(hDir); 6236 if (findbuf.attrFile & FILE_DIRECTORY) 6237 WinSendMsg(hwndUserlist, LM_INSERTITEM, 6238 MPFROM2SHORT(LIT_SORTASCENDING, 0), 6239 MPFROMP(info->path)); 6240 else { 6241 temp = info->next; 6242 remove_udir(info->path); 6243 info = temp; 6244 continue; 6245 } 6246 } 6247 else if (!(ulDriveMap & (1 << (toupper(*info->path) - 'A')))) { 6248 temp = info->next; 6249 remove_udir(info->path); 6250 info = temp; 6251 continue; 6252 } 6253 } 6254 info = info->next; 6205 6255 } 6206 6256 info = ldirhead; 6207 6257 while (info) { 6208 if (IsFullName(info->path) &&6209 !(driveflags[toupper(*info->path) - 'A'] &6210 (DRIVE_IGNORE | DRIVE_INVALID))) {6211 DosError(FERR_DISABLEHARDERR);6212 hDir = HDIR_CREATE;6213 ulSearchCount = 1;6214 if (!IsRoot(info->path))6215 rc = DosFindFirst(info->path, &hDir, FILE_DIRECTORY |6216 MUST_HAVE_DIRECTORY | FILE_READONLY |6217 FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN,6218 &findbuf, sizeof(FILEFINDBUF3),6219 &ulSearchCount, FIL_STANDARD);6220 else {6221 rc = 0;6222 findbuf.attrFile = FILE_DIRECTORY;6223 }6224 priority_bumped();6225 if (!rc) {6226 if (!IsRoot(info->path))6227 DosFindClose(hDir);6228 if (findbuf.attrFile & FILE_DIRECTORY)6229 WinSendMsg(hwndUserlist, LM_INSERTITEM,6230 MPFROM2SHORT(LIT_SORTASCENDING, 0),6231 MPFROMP(info->path));6232 else {6233 temp = info->next;6234 remove_udir(info->path);6235 info = temp;6236 continue;6237 }6238 }6239 else if (!(ulDriveMap & (1 << (toupper(*info->path) - 'A')))) {6240 temp = info->next;6241 remove_udir(info->path);6242 info = temp;6243 continue;6244 }6245 }6246 info = info->next;6258 if (IsFullName(info->path) && 6259 !(driveflags[toupper(*info->path) - 'A'] & 6260 (DRIVE_IGNORE | DRIVE_INVALID))) { 6261 DosError(FERR_DISABLEHARDERR); 6262 hDir = HDIR_CREATE; 6263 ulSearchCount = 1; 6264 if (!IsRoot(info->path)) 6265 rc = DosFindFirst(info->path, &hDir, FILE_DIRECTORY | 6266 MUST_HAVE_DIRECTORY | FILE_READONLY | 6267 FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN, 6268 &findbuf, sizeof(FILEFINDBUF3), 6269 &ulSearchCount, FIL_STANDARD); 6270 else { 6271 rc = 0; 6272 findbuf.attrFile = FILE_DIRECTORY; 6273 } 6274 priority_bumped(); 6275 if (!rc) { 6276 if (!IsRoot(info->path)) 6277 DosFindClose(hDir); 6278 if (findbuf.attrFile & FILE_DIRECTORY) 6279 WinSendMsg(hwndUserlist, LM_INSERTITEM, 6280 MPFROM2SHORT(LIT_SORTASCENDING, 0), 6281 MPFROMP(info->path)); 6282 else { 6283 temp = info->next; 6284 remove_udir(info->path); 6285 info = temp; 6286 continue; 6287 } 6288 } 6289 else if (!(ulDriveMap & (1 << (toupper(*info->path) - 'A')))) { 6290 temp = info->next; 6291 remove_udir(info->path); 6292 info = temp; 6293 continue; 6294 } 6295 } 6296 info = info->next; 6247 6297 } 6248 6298 WinSendMsg(hwndUserlist, LM_INSERTITEM, 6249 MPFROM2SHORT(0, 0),6250 MPFROMP(GetPString(IDS_NEWDIRECTORYTEXT)));6299 MPFROM2SHORT(0, 0), 6300 MPFROMP(GetPString(IDS_NEWDIRECTORYTEXT))); 6251 6301 WinSetWindowText(hwndUserlist, GetPString(IDS_COMMONDIRTEXT)); 6252 6302 } … … 6262 6312 case WM_SIZE: 6263 6313 ResizeChildren(hwnd, SHORT1FROMMP(mp1), SHORT2FROMMP(mp1), 6264 SHORT1FROMMP(mp2), SHORT2FROMMP(mp2));6314 SHORT1FROMMP(mp2), SHORT2FROMMP(mp2)); 6265 6315 break; 6266 6316 … … 6276 6326 hps = WinBeginPaint(hwnd, (HPS) 0, NULL); 6277 6327 if (hps) { 6278 WinQueryWindowRect(hwnd, &rcl);6279 WinFillRect(hps, &rcl, CLR_PALEGRAY);6280 WinEndPaint(hps);6328 WinQueryWindowRect(hwnd, &rcl); 6329 WinFillRect(hps, &rcl, CLR_PALEGRAY); 6330 WinEndPaint(hps); 6281 6331 } 6282 6332 } … … 6292 6342 switch (SHORT2FROMMP(mp1)) { 6293 6343 case CBN_ENTER: 6294 {6295 HWND hwndUL = WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),6296 SHORT1FROMMP(mp1));6297 CHAR path[CCHMAXPATH];6298 ULONG ul;6299 6300 switch (SHORT1FROMMP(mp1)) {6301 case MAIN_USERLIST:6302 ul = CCHMAXPATH;6303 break;6304 case MAIN_SETUPLIST:6305 ul = STATE_NAME_MAX_BYTES;6306 break;6307 default:6308 ul = 13; // fixme to not be hardcoded6309 }6310 6311 SetShiftState();6312 WinQueryWindowText(WinWindowFromID(hwndUL, CBID_EDIT), ul, path);6313 bstrip(path);6314 if (*path) {6315 if (SHORT1FROMMP(mp1) == MAIN_USERLIST) {6316 if (!strcmp(path, GetPString(IDS_NEWDIRECTORYTEXT))) {6317 if (!LastDir ||6318 !WinSendMsg(WinQueryWindow(LastDir, QW_PARENT),6319 UM_CONTAINERDIR, MPFROMP(path), MPVOID))6320 strcpy(path, pFM2SaveDirectory);6321 if (!PMMkDir(hwnd, path, TRUE)) {6322 WinSetWindowText(hwndUL, GetPString(IDS_COMMONDIRTEXT));6323 break;6324 }6325 }6326 if (!IsFile(path) && !FindDirCnrByName(path, TRUE)) {6327 6328 HWND hwndDir;6329 6330 if ((fUserListSwitches &&6331 !(shiftstate & KC_SHIFT)) ||6332 (!fUserListSwitches && (shiftstate & KC_SHIFT))) {6333 hwndDir = FindDirCnr(hwnd);6334 if (hwndDir) {6335 WinSendMsg(LastDir, UM_SETDIR, MPFROMP(path), MPVOID);6336 break;6337 }6338 }6339 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, path);6340 }6341 }6342 else if (SHORT1FROMMP(mp1) == MAIN_DRIVELIST) {6343 ShowTreeRec(WinWindowFromID(WinWindowFromID(hwndTree,6344 FID_CLIENT),6345 TREE_CNR), path, FALSE, TRUE);6346 WinSetFocus(HWND_DESKTOP, hwndTree);6347 }6348 else if (SHORT1FROMMP(mp1) == MAIN_BUTTONLIST) {6349 strcat(path, ".TLS");6350 load_tools(path);6351 PrfWriteProfileString(fmprof,6352 FM3Str, "LastToolbar", lasttoolbar);6353 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID);6354 WinSetWindowText(hwndButtonlist, GetPString(IDS_TOOLBARTEXT));6355 }6356 else if (SHORT1FROMMP(mp1) == MAIN_SETUPLIST) {6357 CHAR szKey[80];6358 ULONG size, numsaves = 0;6359 6360 SetShiftState();6361 size = sizeof(ULONG);6362 sprintf(szKey, "%s.NumDirsLastTime", path); // path is state name6363 if (!PrfQueryProfileData(fmprof,6364 FM3Str,6365 szKey,6366 (PVOID)&numsaves,6367 &size))6368 {6369 if ((WinGetLastError(WinQueryAnchorBlock(hwnd)) & 0xffff) == PMERR_NOT_IN_IDX) {6370 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd,6371 GetPString(IDS_WARNINGTEXT),6372 GetPString(IDS_DOESNTEXISTTEXT), path);6373 }6374 else {6375 Win_Error2(hwnd, hwnd, __FILE__, __LINE__,6376 IDS_PRFQUERYPROFILEDATA);6377 }6378 }6379 else {6380 char *pszStateName;6381 if ((shiftstate & KC_SHIFT) == 0)6382 PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2));6383 pszStateName = xstrdup(path, pszSrcFile, __LINE__);6384 if (!pszStateName) {6385 // Fall back if out of memory - already complained6386 if ((shiftstate & KC_SHIFT) != 0 || fAutoTile) {6387 // Autotile requested or forced6388 PostMsg(MainObjectHwnd,6389 UM_RESTORE,6390 MPVOID,6391 MPFROMLONG(1)); // Autotile6392 }6393 }6394 else if (!PostMsg(MainObjectHwnd,6395 UM_RESTORE,6396 MPFROMP(pszStateName),6397 MPVOID)) {6398 free(pszStateName);6399 }6400 }6401 }6402 else if (SHORT1FROMMP(mp1) == MAIN_CMDLIST) {6403 6404 SHORT sSelect;6405 6406 sSelect = (SHORT) WinSendMsg(hwndCmdlist,6407 LM_QUERYSELECTION,6408 MPFROMSHORT(LIT_FIRST), MPVOID);6409 if (sSelect >= 0)6410 WinPostMsg(hwnd,6411 WM_COMMAND,6412 MPFROM2SHORT(IDM_COMMANDSTART + sSelect, 0),6413 MPVOID);6414 WinSetWindowText(hwndCmdlist, GetPString(IDS_COMMANDSTEXT));6415 }6416 }6417 }6418 break;6344 { 6345 HWND hwndUL = WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 6346 SHORT1FROMMP(mp1)); 6347 CHAR path[CCHMAXPATH]; 6348 ULONG ul; 6349 6350 switch (SHORT1FROMMP(mp1)) { 6351 case MAIN_USERLIST: 6352 ul = CCHMAXPATH; 6353 break; 6354 case MAIN_SETUPLIST: 6355 ul = STATE_NAME_MAX_BYTES; 6356 break; 6357 default: 6358 ul = 13; // fixme to not be hardcoded 6359 } 6360 6361 SetShiftState(); 6362 WinQueryWindowText(WinWindowFromID(hwndUL, CBID_EDIT), ul, path); 6363 bstrip(path); 6364 if (*path) { 6365 if (SHORT1FROMMP(mp1) == MAIN_USERLIST) { 6366 if (!strcmp(path, GetPString(IDS_NEWDIRECTORYTEXT))) { 6367 if (!LastDir || 6368 !WinSendMsg(WinQueryWindow(LastDir, QW_PARENT), 6369 UM_CONTAINERDIR, MPFROMP(path), MPVOID)) 6370 strcpy(path, pFM2SaveDirectory); 6371 if (!PMMkDir(hwnd, path, TRUE)) { 6372 WinSetWindowText(hwndUL, GetPString(IDS_COMMONDIRTEXT)); 6373 break; 6374 } 6375 } 6376 if (!IsFile(path) && !FindDirCnrByName(path, TRUE)) { 6377 6378 HWND hwndDir; 6379 6380 if ((fUserListSwitches && 6381 !(shiftstate & KC_SHIFT)) || 6382 (!fUserListSwitches && (shiftstate & KC_SHIFT))) { 6383 hwndDir = FindDirCnr(hwnd); 6384 if (hwndDir) { 6385 WinSendMsg(LastDir, UM_SETDIR, MPFROMP(path), MPVOID); 6386 break; 6387 } 6388 } 6389 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, path); 6390 } 6391 } 6392 else if (SHORT1FROMMP(mp1) == MAIN_DRIVELIST) { 6393 ShowTreeRec(WinWindowFromID(WinWindowFromID(hwndTree, 6394 FID_CLIENT), 6395 TREE_CNR), path, FALSE, TRUE); 6396 WinSetFocus(HWND_DESKTOP, hwndTree); 6397 } 6398 else if (SHORT1FROMMP(mp1) == MAIN_BUTTONLIST) { 6399 strcat(path, ".TLS"); 6400 load_tools(path); 6401 PrfWriteProfileString(fmprof, 6402 FM3Str, "LastToolbar", lasttoolbar); 6403 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID); 6404 WinSetWindowText(hwndButtonlist, GetPString(IDS_TOOLBARTEXT)); 6405 } 6406 else if (SHORT1FROMMP(mp1) == MAIN_SETUPLIST) { 6407 CHAR szKey[80]; 6408 ULONG size, numsaves = 0; 6409 6410 SetShiftState(); 6411 size = sizeof(ULONG); 6412 sprintf(szKey, "%s.NumDirsLastTime", path); // path is state name 6413 if (!PrfQueryProfileData(fmprof, 6414 FM3Str, 6415 szKey, 6416 (PVOID)&numsaves, 6417 &size)) 6418 { 6419 if ((WinGetLastError(WinQueryAnchorBlock(hwnd)) & 0xffff) == PMERR_NOT_IN_IDX) { 6420 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd, 6421 GetPString(IDS_WARNINGTEXT), 6422 GetPString(IDS_DOESNTEXISTTEXT), path); 6423 } 6424 else { 6425 Win_Error2(hwnd, hwnd, __FILE__, __LINE__, 6426 IDS_PRFQUERYPROFILEDATA); 6427 } 6428 } 6429 else { 6430 char *pszStateName; 6431 if ((shiftstate & KC_SHIFT) == 0) 6432 PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2)); 6433 pszStateName = xstrdup(path, pszSrcFile, __LINE__); 6434 if (!pszStateName) { 6435 // Fall back if out of memory - already complained 6436 if ((shiftstate & KC_SHIFT) != 0 || fAutoTile) { 6437 // Autotile requested or forced 6438 PostMsg(MainObjectHwnd, 6439 UM_RESTORE, 6440 MPVOID, 6441 MPFROMLONG(1)); // Autotile 6442 } 6443 } 6444 else if (!PostMsg(MainObjectHwnd, 6445 UM_RESTORE, 6446 MPFROMP(pszStateName), 6447 MPVOID)) { 6448 free(pszStateName); 6449 } 6450 } 6451 } 6452 else if (SHORT1FROMMP(mp1) == MAIN_CMDLIST) { 6453 6454 SHORT sSelect; 6455 6456 sSelect = (SHORT) WinSendMsg(hwndCmdlist, 6457 LM_QUERYSELECTION, 6458 MPFROMSHORT(LIT_FIRST), MPVOID); 6459 if (sSelect >= 0) 6460 WinPostMsg(hwnd, 6461 WM_COMMAND, 6462 MPFROM2SHORT(IDM_COMMANDSTART + sSelect, 0), 6463 MPVOID); 6464 WinSetWindowText(hwndCmdlist, GetPString(IDS_COMMANDSTEXT)); 6465 } 6466 } 6467 } 6468 break; 6419 6469 6420 6470 default: 6421 break;6471 break; 6422 6472 } 6423 6473 break; … … 6439 6489 case WM_CLOSE: 6440 6490 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), 6441 WM_SYSCOMMAND, MPFROM2SHORT(SC_RESTORE, 0), MPVOID);6491 WM_SYSCOMMAND, MPFROM2SHORT(SC_RESTORE, 0), MPVOID); 6442 6492 WinSendMsg(hwnd, WM_SAVEAPPLICATION, MPVOID, MPVOID); 6443 6493 fAmClosing = TRUE; 6444 6494 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), 6445 WM_SYSCOMMAND, MPFROM2SHORT(SC_MINIMIZE, 0), MPVOID);6495 WM_SYSCOMMAND, MPFROM2SHORT(SC_MINIMIZE, 0), MPVOID); 6446 6496 if (CloseChildren(hwnd)) { 6447 6497 fAmClosing = FALSE; 6448 6498 if (fAutoTile) 6449 PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_TILE, 0), MPVOID);6499 PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_TILE, 0), MPVOID); 6450 6500 return 0; 6451 6501 } 6452 6502 if (hwndTree) { 6453 6503 if (!PostMsg(hwndTree, WM_CLOSE, MPVOID, MPVOID)) 6454 WinSendMsg(hwndTree, WM_CLOSE, MPVOID, MPVOID);6504 WinSendMsg(hwndTree, WM_CLOSE, MPVOID, MPVOID); 6455 6505 } 6456 6506 DosSleep(1); … … 6466 6516 // Try to restore saved shutdown state 6467 6517 char *pszDefaultStateName = xstrdup(GetPString(IDS_SHUTDOWNSTATE), 6468 pszSrcFile, __LINE__);6518 pszSrcFile, __LINE__); 6469 6519 if (pszDefaultStateName) { 6470 if (!PostMsg(MainObjectHwnd, UM_RESTORE, MPFROMP(pszDefaultStateName), MPVOID))6471 // 05 Feb 08 SHL fixme to complain?6472 free(pszDefaultStateName);6520 if (!PostMsg(MainObjectHwnd, UM_RESTORE, MPFROMP(pszDefaultStateName), MPVOID)) 6521 // 05 Feb 08 SHL fixme to complain? 6522 free(pszDefaultStateName); 6473 6523 } 6474 6524 } … … 6479 6529 if (mp1) 6480 6530 return MRFROMLONG(OpenDirCnr((HWND) 0, 6481 hwndMain,6482 hwndTree, (BOOL) mp2, (char *)mp1));6531 hwndMain, 6532 hwndTree, (BOOL) mp2, (char *)mp1)); 6483 6533 return 0; 6484 6534 -
trunk/dll/mainwnd.h
r1198 r1209 43 43 HWND TopWindowName(HWND hwndParent, HWND exclude, CHAR * ret); 44 44 45 // Data declarations 46 extern ULONG AutoviewHeight; 47 extern ULONG DriveLines; 48 extern HMODULE FM3ModHandle; 49 extern CHAR *FM3Str; 50 extern HWND MainPopupMenu; 51 extern HWND MainObjectHwnd; 52 extern BOOL MenuInvisible; 53 extern PFNWP PFNWPStatic; 54 extern PFNWP PFNWPButton; 55 extern RGB2 RGBGREY; 56 extern BOOL fAmClosing; 57 extern BOOL fAutoTile; 58 extern BOOL fAutoView; 59 extern BOOL fComments; 60 extern BOOL fDrivebar; 61 extern BOOL fFreeTree; 62 extern BOOL fMoreButtons; 63 extern BOOL fNoFinger; 64 extern BOOL fNoSaveState; 65 extern BOOL fNoTileUpdate; 66 extern BOOL fRunning; 67 extern BOOL fSplitStatus; 68 extern BOOL fTextTools; 69 extern BOOL fToolTitles; 70 extern BOOL fToolbar; 71 extern BOOL fUserComboBox; 72 extern HBITMAP hbmLEDoff; 73 extern HBITMAP hbmLEDon; 74 extern HPOINTER hptrFinger; 75 extern HWND hwndAutoview; 76 extern HWND hwndBubble; 77 extern HWND hwndName; 78 extern HWND hwndStatelist; 79 extern HWND hwndToolback; 80 extern HWND hwndTree; 81 extern USHORT shiftstate; 82 45 83 #endif // MAINWND_H
Note:
See TracChangeset
for help on using the changeset viewer.
