ReactOS  0.4.12-dev-714-gfaac916
MainFrameBase Struct Reference

Explorer frame window base class. More...

#include <mainframe.h>

Inheritance diagram for MainFrameBase:
Collaboration diagram for MainFrameBase:

Public Types

typedef PreTranslateWindow super
 
- Public Types inherited from PreTranslateWindow
typedef Window super
 
- Public Types inherited from Window
typedef map< HWND, Window * > WindowMap
 
typedef Window *(* CREATORFUNC) (HWND)
 
typedef Window *(* CREATORFUNC_INFO) (HWND, const void *)
 

Public Member Functions

 MainFrameBase (HWND hwnd)
 
 ~MainFrameBase ()
 
- Public Member Functions inherited from PreTranslateWindow
 PreTranslateWindow (HWND)
 
 ~PreTranslateWindow ()
 
- Public Member Functions inherited from Window
 Window (HWND hwnd)
 
virtual ~Window ()
 
LRESULT SendParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
LRESULT PostParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 

Static Public Member Functions

static HWND Create (const ExplorerCmd &cmd)
 
static int OpenShellFolders (LPIDA pida, HWND hFrameWnd)
 
- Static Public Member Functions inherited from Window
static HWND Create (CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static HWND Create (CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static Windowcreate_mdi_child (const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator)
 
static LRESULT CALLBACK WindowWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static INT_PTR CALLBACK DialogProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static Windowget_window (HWND hwnd)
 get window controller from window handle More...
 
template<typename CLASS >
static CLASS * get_window (HWND hwnd)
 
static void register_pretranslate (HWND hwnd)
 
static void unregister_pretranslate (HWND hwnd)
 
static BOOL pretranslate_msg (LPMSG pmsg)
 
static void register_dialog (HWND hwnd)
 
static void unregister_dialog (HWND hwnd)
 
static BOOL dispatch_dialog_msg (LPMSG pmsg)
 
static int MessageLoop ()
 
static void CancelModes ()
 

Public Attributes

WindowHandle _hwndrebar
 
WindowHandle _htoolbar
 
WindowHandle _haddrcombo
 
WindowHandle _hstatusbar
 
WindowHandle _hsidebar
 
HIMAGELIST _himl
 
HMENU _hMenuFrame
 
HMENU _hMenuWindow
 
MenuInfo _menu_info
 
- Public Attributes inherited from Window
IAccessible IAccessible_iface
 
IOleWindow IOleWindow_iface
 
IEnumVARIANT IEnumVARIANT_iface
 
LONG ref
 

Protected Member Functions

LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
bool ProcessMessage (UINT nmsg, WPARAM wparam, LPARAM lparam, LRESULT *pres)
 
int Command (int id, int code)
 
int Notify (int id, NMHDR *pnmh)
 
virtual BOOL TranslateMsg (MSG *pmsg)
 
void toggle_child (HWND hwnd, UINT cmd, HWND hchild, int band_idx=-1)
 
void resize_frame_client ()
 
virtual void resize_frame (int cx, int cy)
 
virtual void frame_get_clientspace (PRECT prect)
 
BOOL toggle_fullscreen ()
 
void fullscreen_move ()
 
void FillBookmarks ()
 
virtual bool go_to (LPCTSTR url, bool new_window)
 
- Protected Member Functions inherited from Window
virtual LRESULT Init (LPCREATESTRUCT pcs)
 

Protected Attributes

FullScreenParameters _fullscreen
 
HACCEL _hAccel
 
HIMAGELIST _himl_old
 

Additional Inherited Members

- Static Protected Member Functions inherited from Window
static Windowcreate_controller (HWND hwnd)
 create controller for a new window More...
 
static StaticWindowDataGetStaticWindowData ()
 
static LRESULT CALLBACK MDICBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
static LRESULT CALLBACK PropSheetCBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
- Static Protected Attributes inherited from Window
static WindowMap s_wnd_map
 
static const voids_new_info = NULL
 
static CREATORFUNC s_window_creator = NULL
 
static HHOOK s_hcbtHook = 0
 
static WindowSet s_pretranslate_windows
 
static WindowSet s_dialogs
 

Detailed Description

Explorer frame window base class.

Definition at line 41 of file mainframe.h.

Member Typedef Documentation

◆ super

Definition at line 43 of file mainframe.h.

Constructor & Destructor Documentation

◆ MainFrameBase()

MainFrameBase::MainFrameBase ( HWND  hwnd)

Definition at line 150 of file mainframe.cpp.

151  : super(hwnd)
152 {
153  HDC hDC = GetDC(NULL);
154 #ifndef _NO_REBAR
155  //static TCHAR Title1[] = TEXT("Toolbar");
156  static TCHAR Title2[] = TEXT("Address :");
157 #endif
158 
159  if (hDC)
160  {
161  DWORD ilMask;
163  ReleaseDC(NULL, hDC);
164 
165  if (bpp <= 4)
166  ilMask = ILC_COLOR4;
167  else if (bpp <= 8)
168  ilMask = ILC_COLOR8;
169  else if (bpp <= 16)
170  ilMask = ILC_COLOR16;
171  else if (bpp <= 24)
172  ilMask = ILC_COLOR24;
173  else if (bpp <= 32)
174  ilMask = ILC_COLOR32;
175  else
176  ilMask = ILC_COLOR;
177 
178  ilMask |= ILC_MASK;
179 
181  }
182 
185 
187 
189 
190 
191  TBBUTTON toolbarBtns[] = {
192 #ifdef _NO_REBAR
193  {0, 0, 0, BTNS_SEP, {0, 0}, 0, 0},
194 #endif
195  {7, ID_GO_BACK, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
196  {8, ID_GO_FORWARD, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
197  {9, ID_GO_UP, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
198  {10, ID_GO_HOME, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
199  {11, ID_GO_SEARCH, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
200  {12, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
201  {13, ID_STOP, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}
202  };
203 
205 #ifndef _NO_REBAR
207 #endif
209  toolbarBtns, sizeof(toolbarBtns)/sizeof(TBBUTTON),
210  16, 16, 16, 16, sizeof(TBBUTTON));
211 
213 
214 
215  // address bar
217  WC_COMBOBOX,
218  TEXT("Address"),
221  0, 0, 0, 0,
222  hwnd,
225  0);
226 
229 
230 
233 
236  -1, -1, 200, 0, _hwnd, (HMENU)IDW_SIDEBAR, g_Globals._hInstance, 0);
237 
239 
241 
242 
243  // create rebar window to manage toolbar and drivebar
244 #ifndef _NO_REBAR
247  NULL,
250  0, 0, 0, 0,
251  _hwnd,
252  NULL,
254  0);
255 
256  int btn_hgt = HIWORD(SendMessage(_htoolbar, TB_GETBUTTONSIZE, 0, 0));
257 
258  REBARBANDINFO rbBand;
259 
260  rbBand.cbSize = sizeof(REBARBANDINFO);
263 
264  rbBand.cxMinChild = 0;
265  rbBand.cyMinChild = 0;
266  rbBand.cyChild = 0;
267  rbBand.cyMaxChild = 0;
268  rbBand.cyIntegral = btn_hgt;
269 
270  rbBand.lpText = NULL;//Title1
271  rbBand.hwndChild = _htoolbar;
272  rbBand.cxMinChild = 0;
273  rbBand.cyMinChild = btn_hgt;
274  rbBand.cx = 284;
276 
277  rbBand.fStyle &= ~RBBS_HIDETITLE;
278  rbBand.fStyle |= RBBS_BREAK;
279  rbBand.lpText = Title2;
280  rbBand.hwndChild = _haddrcombo;
281  rbBand.cxMinChild = 0;
282  rbBand.cyMinChild = btn_hgt;
283  rbBand.cx = 400;
285 #endif
286 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define ID_VIEW_TOOL_BAR
Definition: resource.h:138
#define HDC
Definition: msvc.h:22
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ILC_COLOR16
Definition: commctrl.h:341
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define BITSPIXEL
Definition: wingdi.h:719
#define ID_REFRESH
Definition: resource.h:18
#define RBBIM_CHILD
Definition: commctrl.h:1478
#define RBS_VARHEIGHT
Definition: commctrl.h:1443
#define MF_BYCOMMAND
Definition: winuser.h:202
WindowHandle _hwndrebar
Definition: mainframe.h:51
#define IDW_TOOLBAR
Definition: explorer.h:53
HDC WINAPI GetDC(_In_opt_ HWND)
WindowHandle _haddrcombo
Definition: mainframe.h:54
#define RBBS_BREAK
Definition: commctrl.h:1461
#define RBBS_CHILDEDGE
Definition: commctrl.h:1463
#define SM_CYSMICON
Definition: winuser.h:1003
#define WS_CHILD
Definition: pedump.c:617
#define WS_CLIPCHILDREN
Definition: pedump.c:619
HWND WINAPI CreateToolbarEx(HWND hwnd, DWORD style, UINT wID, INT nBitmaps, HINSTANCE hBMInst, UINT_PTR wBMID, LPCTBBUTTON lpButtons, INT iNumButtons, INT dxButton, INT dyButton, INT dxBitmap, INT dyBitmap, UINT uStructSize)
Definition: commctrl.c:929
#define ID_VIEW_SIDE_BAR
Definition: resource.h:140
#define ID_GO_UP
Definition: resource.h:210
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
int32_t INT
Definition: typedefs.h:56
HFONT hFont
Definition: main.c:53
#define ILC_COLOR4
Definition: commctrl.h:339
#define RBS_BANDBORDERS
Definition: commctrl.h:1444
UINT_PTR WPARAM
Definition: windef.h:207
#define ILC_COLOR32
Definition: commctrl.h:343
HMENU _hMenuFrame
Definition: mainframe.h:60
HIMAGELIST _himl
Definition: mainframe.h:58
#define RBBIM_STYLE
Definition: commctrl.h:1474
#define RBBIM_SIZE
Definition: commctrl.h:1480
#define CCS_NODIVIDER
Definition: commctrl.h:2220
#define LoadAccelerators
Definition: winuser.h:5676
#define BTNS_BUTTON
Definition: commctrl.h:970
#define ID_VIEW_STATUSBAR
Definition: resource.h:56
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:769
PreTranslateWindow super
Definition: mainframe.h:43
#define TVS_INFOTIP
Definition: commctrl.h:3230
LONG_PTR LPARAM
Definition: windef.h:208
#define CreateStatusWindow
Definition: commctrl.h:1905
#define TVS_HASBUTTONS
Definition: commctrl.h:3219
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define ILC_COLOR
Definition: commctrl.h:337
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
#define CreateWindowEx
Definition: winuser.h:5621
#define IDW_ADDRESSBAR
Definition: explorer.h:56
#define RB_INSERTBAND
Definition: commctrl.h:1574
smooth NULL
Definition: ftsmooth.c:416
#define CCS_NOPARENTALIGN
Definition: commctrl.h:2218
#define RBBS_HIDETITLE
#define TreeView_SetImageList(hwnd, himl, iImage)
Definition: commctrl.h:3419
#define WC_COMBOBOX
Definition: commctrl.h:4689
#define MF_CHECKED
Definition: winuser.h:132
#define RBS_AUTOSIZE
Definition: commctrl.h:1447
#define TB_GETBUTTONSIZE
Definition: commctrl.h:1132
char TCHAR
Definition: xmlstorage.h:189
#define IDA_EXPLORER
Definition: resource.h:59
#define REBARBANDINFO
Definition: commctrl.h:1541
#define RBBIM_TEXT
Definition: commctrl.h:1476
#define BTNS_SEP
Definition: commctrl.h:971
#define WC_TREEVIEW
Definition: commctrl.h:3217
#define ILC_COLOR24
Definition: commctrl.h:342
#define IDW_SIDEBAR
Definition: explorer.h:57
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HACCEL _hAccel
Definition: mainframe.h:68
#define RBBIM_CHILDSIZE
Definition: commctrl.h:1479
WindowHandle _hsidebar
Definition: mainframe.h:57
#define SM_CXSMICON
Definition: winuser.h:1002
#define CCS_NORESIZE
Definition: commctrl.h:2217
HINSTANCE _hInstance
Definition: globals.h:270
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define ILC_MASK
Definition: commctrl.h:336
HIMAGELIST _himl_old
Definition: mainframe.h:69
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
#define WS_TABSTOP
Definition: pedump.c:634
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define MF_UNCHECKED
Definition: winuser.h:204
#define ID_GO_SEARCH
Definition: resource.h:209
#define REBARCLASSNAME
Definition: commctrl.h:1438
WindowHandle _htoolbar
Definition: mainframe.h:53
static HDC hDC
Definition: 3dtext.c:33
#define TEXT(s)
Definition: k32.h:26
#define WS_BORDER
Definition: pedump.c:625
#define ANSI_VAR_FONT
Definition: wingdi.h:906
#define ID_GO_HOME
Definition: resource.h:208
#define CBS_DROPDOWN
Definition: winuser.h:283
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HMENU _hMenuWindow
Definition: mainframe.h:61
#define WM_SETFONT
Definition: winuser.h:1632
#define RBBS_GRIPPERALWAYS
Definition: commctrl.h:1468
#define TVS_SHOWSELALWAYS
Definition: commctrl.h:3224
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
HMENU _hMenuView
Definition: window.h:277
#define TVS_HASLINES
Definition: commctrl.h:3220
#define TVSIL_NORMAL
Definition: commctrl.h:3415
#define SendMessage
Definition: winuser.h:5709
#define TBSTATE_ENABLED
Definition: commctrl.h:946
#define CCS_NOMOVEY
Definition: commctrl.h:2215
#define IDW_STATUSBAR
Definition: explorer.h:52
#define ID_GO_FORWARD
Definition: resource.h:207
#define HIWORD(l)
Definition: typedefs.h:246
#define ILC_COLOR8
Definition: commctrl.h:340
#define RBS_DBLCLKTOGGLE
Definition: commctrl.h:1449
#define IDB_TOOLBAR
Definition: wordpad.h:183
DWORD bpp
Definition: surface.c:181
WindowHandle _hstatusbar
Definition: mainframe.h:55
#define WS_VISIBLE
Definition: pedump.c:620
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define WS_EX_STATICEDGE
Definition: winuser.h:403
MenuInfo _menu_info
Definition: mainframe.h:63
#define ID_STOP
Definition: resource.h:21
#define TBSTYLE_FLAT
Definition: commctrl.h:964
#define ID_GO_BACK
Definition: resource.h:206

◆ ~MainFrameBase()

MainFrameBase::~MainFrameBase ( )

Definition at line 289 of file mainframe.cpp.

290 {
293 
294  // don't exit desktop when closing file manager window
296  if (g_Globals._hMainWnd == _hwnd) // don't quit when switching between MDI and SDI mode
297  PostQuitMessage(0);
298 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
bool _desktop_mode
Definition: globals.h:276
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:893
HIMAGELIST _himl
Definition: mainframe.h:58
#define TreeView_SetImageList(hwnd, himl, iImage)
Definition: commctrl.h:3419
WindowHandle _hsidebar
Definition: mainframe.h:57
HIMAGELIST _himl_old
Definition: mainframe.h:69
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
HWND _hMainWnd
Definition: globals.h:275
#define TVSIL_NORMAL
Definition: commctrl.h:3415
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)

Member Function Documentation

◆ Command()

int MainFrameBase::Command ( int  id,
int  code 
)
protectedvirtual

Reimplemented from Window.

Reimplemented in SDIMainFrame, and MDIMainFrame.

Definition at line 388 of file mainframe.cpp.

389 {
390  CONTEXT("MainFrameBase::Command()");
391 
392  switch(id) {
393  case ID_FILE_EXIT:
394  SendMessage(_hwnd, WM_CLOSE, 0, 0);
395  break;
396 
397  case ID_VIEW_TOOL_BAR:
398  toggle_child(_hwnd, id, _htoolbar, 0);
399  break;
400 
401  case ID_VIEW_STATUSBAR:
402  toggle_child(_hwnd, id, _hstatusbar);
403  break;
404 
405  case ID_VIEW_SIDE_BAR:
406  // lazy initialization
408  FillBookmarks();
409 
410  toggle_child(_hwnd, id, _hsidebar);
411  break;
412 
413  case ID_EXECUTE: {
414  ExecuteDialog dlg = {{0}, 0};
415 
417  CONTEXT("ID_EXECUTE - ShellExecute()");
418 
419  HINSTANCE hinst = ShellExecute(_hwnd, NULL/*operation*/, dlg.cmd/*file*/, NULL/*parameters*/, NULL/*dir*/, dlg.cmdshow);
420 
421  if ((INT_PTR)hinst <= 32)
422  display_error(_hwnd, GetLastError());
423  }
424  break;}
425 
426  case ID_HELP:
427  WinHelp(_hwnd, TEXT("explorer")/*file explorer.hlp*/, HELP_INDEX, 0);
428  break;
429 
430  case ID_VIEW_FULLSCREEN:
432  break;
433 
434  case ID_TOOLS_OPTIONS:
436  break;
437 
438  case ID_ABOUT_WINDOWS:
439  ShellAbout(_hwnd, ResString(IDS_TITLE), NULL, 0);
440  break;
441 
442  case ID_ABOUT_EXPLORER:
443  explorer_about(_hwnd);
444  break;
445 
446  case ID_EXPLORER_FAQ:
447  launch_file(_hwnd, TEXT("http://www.sky.franken.de/explorer/"), SW_SHOW);
448  break;
449 
450  default:
451  return 1; // no command handlers in Window::Command()
452  }
453 
454  return 0;
455 }
#define WINDOW_CREATOR(WND_CLASS)
Definition: window.h:202
#define ID_VIEW_TOOL_BAR
Definition: resource.h:138
#define MAKEINTRESOURCE
Definition: winuser.h:591
struct _CONTEXT CONTEXT
#define IDOK
Definition: winuser.h:824
BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow, LPCTSTR parameters)
Definition: utility.cpp:189
#define ID_ABOUT_WINDOWS
Definition: resource.h:203
static INT_PTR CALLBACK WndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: filechild.cpp:95
#define TreeView_GetCount(hwnd)
Definition: commctrl.h:3404
BOOL toggle_fullscreen()
Definition: mainframe.cpp:586
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ID_TOOLS_OPTIONS
Definition: resource.h:222
int32_t INT_PTR
Definition: typedefs.h:62
#define ID_VIEW_SIDE_BAR
Definition: resource.h:140
#define ID_VIEW_FULLSCREEN
Definition: resource.h:193
void explorer_about(HWND hwndParent)
Definition: explorer.cpp:934
#define ID_VIEW_STATUSBAR
Definition: resource.h:56
LONG_PTR LPARAM
Definition: windef.h:208
#define ID_FILE_EXIT
Definition: resource.h:47
void toggle_child(HWND hwnd, UINT cmd, HWND hchild, int band_idx=-1)
Definition: mainframe.cpp:634
#define ShellExecute
Definition: shellapi.h:681
#define IDD_EXECUTE
Definition: resource.h:112
smooth NULL
Definition: ftsmooth.c:416
void FillBookmarks()
Definition: mainframe.cpp:651
#define SW_SHOW
Definition: winuser.h:769
#define MF_CHECKED
Definition: winuser.h:132
#define IDS_TITLE
Definition: resource.h:30
#define WM_CLOSE
Definition: winuser.h:1603
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define ShellAbout
Definition: shellapi.h:680
WindowHandle _hsidebar
Definition: mainframe.h:57
void display_error(HWND hwnd, DWORD error)
Definition: utility.cpp:98
#define DialogBoxParam
Definition: winuser.h:5630
#define ID_EXPLORER_FAQ
Definition: resource.h:189
HINSTANCE _hInstance
Definition: globals.h:270
#define ID_EXECUTE
Definition: resource.h:68
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
#define HELP_INDEX
Definition: winuser.h:2364
WindowHandle _htoolbar
Definition: mainframe.h:53
#define TEXT(s)
Definition: k32.h:26
#define ID_ABOUT_EXPLORER
Definition: resource.h:204
The "Execute..."-dialog lets the user enter a command line to launch.
Definition: filechild.h:133
HMENU _hMenuView
Definition: window.h:277
configuration dialog to choose between MDI and SDI mode
Definition: settings.h:91
#define SendMessage
Definition: winuser.h:5709
static int DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0)
Definition: window.cpp:701
static HINSTANCE hinst
Definition: edit.c:551
WindowHandle _hstatusbar
Definition: mainframe.h:55
convenient loading of string resources
Definition: globals.h:303
#define ID_HELP
Definition: resource.h:28
#define IDD_MDI_SDI
Definition: resource.h:105
MenuInfo _menu_info
Definition: mainframe.h:63
#define WinHelp
Definition: winuser.h:5730

Referenced by MDIMainFrame::Command(), and SDIMainFrame::Command().

◆ Create()

HWND MainFrameBase::Create ( const ExplorerCmd cmd)
static

Definition at line 40 of file mainframe.cpp.

41 {
42  HWND hFrame;
43 
44 #ifndef _NO_MDI
45  if (cmd._mdi)
46  hFrame = MDIMainFrame::Create();
47  else
48 #endif
49  hFrame = SDIMainFrame::Create();
50 
51  if (hFrame) {
52  HWND hwndOld = g_Globals._hMainWnd;
53 
54  g_Globals._hMainWnd = hFrame;
55 
56  if (hwndOld)
57  DestroyWindow(hwndOld);
58 
59  ShowWindow(hFrame, cmd._cmdShow);
60  UpdateWindow(hFrame);
61 
62  // Open the first child window after initializing the application
63  if (cmd.IsValidPath()) {
64  // We use the static s_path variable to store the path string in order
65  // to avoid accessing prematurely freed memory in the PostMessage handlers.
66  static String s_path = cmd._path;
67 
68  PostMessage(hFrame, PM_OPEN_WINDOW, cmd._flags, (LPARAM)(LPCTSTR)s_path);
69  } else
71  }
72 
73  return hFrame;
74 }
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
Definition: ftp_var.h:139
BOOL WINAPI UpdateWindow(_In_ HWND)
static WCHAR String[]
Definition: stringtable.c:55
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static HWND Create()
Definition: mainframe.cpp:1342
BOOL WINAPI DestroyWindow(_In_ HWND)
LONG_PTR LPARAM
Definition: windef.h:208
#define PostMessage
Definition: winuser.h:5698
static HWND Create()
Definition: mainframe.cpp:866
"rooted" window with special shell namespace root
Definition: mainframe.h:34
#define PM_OPEN_WINDOW
Definition: mainframe.h:29
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
HWND _hMainWnd
Definition: globals.h:275

Referenced by MDIMainFrame::Command(), SDIMainFrame::Command(), explorer_show_frame(), and MDIShellBrowserChild::WndProc().

◆ FillBookmarks()

void MainFrameBase::FillBookmarks ( )
protected

Definition at line 651 of file mainframe.cpp.

652 {
653  HiddenWindow hide(_hsidebar);
654  WindowCanvas canvas(_hwnd);
655 
657 
663 
664  TV_INSERTSTRUCT tvi;
665 
666  tvi.hParent = TVI_ROOT;
667  tvi.hInsertAfter = TVI_LAST;
668  tvi.item.mask = TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
669  ResString sFavorites(IDS_FAVORITES);
670  tvi.item.pszText = sFavorites.str();
671  tvi.item.iSelectedImage = tvi.item.iImage = 0;
672 
673  HTREEITEM hitem_bookmarks = TreeView_InsertItem(_hsidebar, &tvi);
674 
675  g_Globals._favorites.fill_tree(_hsidebar, hitem_bookmarks, _himl, canvas);
676 
677  TreeView_Expand(_hsidebar, hitem_bookmarks, TVE_EXPAND);
678 }
int ImageList_AddAlphaIcon(HIMAGELIST himl, HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
add icon with alpha channel to imagelist using the specified background color
Definition: explorer.cpp:366
#define TreeView_DeleteAllItems(hwnd)
Definition: commctrl.h:3389
#define IDS_FAVORITES
Definition: resource.h:31
#define WHITE_BRUSH
Definition: wingdi.h:901
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3243
#define TreeView_InsertItem(hwnd, lpis)
Definition: commctrl.h:3384
HIMAGELIST _himl
Definition: mainframe.h:58
#define TVI_LAST
Definition: commctrl.h:3342
convenient loading of small (16x16) icon resources
Definition: globals.h:320
#define GetStockBrush(i)
Definition: windowsx.h:282
int add_to_imagelist(HIMAGELIST himl, HDC hdc_wnd, COLORREF bk_color=GetSysColor(COLOR_WINDOW), HBRUSH bk_brush=GetSysColorBrush(COLOR_WINDOW)) const
Definition: explorer.cpp:306
Favorites _favorites
Definition: globals.h:297
WindowHandle _hsidebar
Definition: mainframe.h:57
#define TVE_EXPAND
Definition: commctrl.h:3395
#define TVI_ROOT
Definition: commctrl.h:3340
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
const Icon & get_icon(int icon_id)
Definition: explorer.cpp:625
void fill_tree(HWND hwnd, HTREEITEM parent, HIMAGELIST, HDC hdc_wnd) const
fill treeview control with bookmark tree content
Definition: favorites.cpp:327
#define TVIF_TEXT
Definition: commctrl.h:3238
#define TVIF_IMAGE
Definition: commctrl.h:3239
convenient loading of string resources
Definition: globals.h:303
#define TV_INSERTSTRUCT
Definition: commctrl.h:3349
#define TreeView_Expand(hwnd, hitem, code)
Definition: commctrl.h:3392
#define IDI_DOT
Definition: resource.h:114
IconCache _icon_cache
Definition: globals.h:285

Referenced by Command().

◆ frame_get_clientspace()

void MainFrameBase::frame_get_clientspace ( PRECT  prect)
protectedvirtual

Reimplemented in MDIMainFrame.

Definition at line 558 of file mainframe.cpp.

559 {
560  if (!IsIconic(_hwnd))
561  GetClientRect(_hwnd, prect);
562  else {
563  WINDOWPLACEMENT wp;
564 
565  GetWindowPlacement(_hwnd, &wp);
566 
567  prect->left = prect->top = 0;
573  }
574 
575  if (IsWindowVisible(_htoolbar)) {
576  ClientRect rt(_htoolbar);
577  prect->top += rt.bottom+2;
578  }
579 
581  ClientRect rt(_hstatusbar);
582  prect->bottom -= rt.bottom;
583  }
584 }
#define SM_CYMENUSIZE
Definition: winuser.h:1008
LONG top
Definition: windef.h:292
#define SM_CXEDGE
Definition: winuser.h:998
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
BOOL WINAPI IsIconic(_In_ HWND)
#define SM_CYSIZEFRAME
Definition: winuser.h:985
#define SM_CYEDGE
Definition: winuser.h:999
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
#define SM_CXSIZEFRAME
Definition: winuser.h:983
#define SM_CYCAPTION
Definition: winuser.h:953
int WINAPI GetSystemMetrics(_In_ int)
WindowHandle _htoolbar
Definition: mainframe.h:53
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
RECT rcNormalPosition
Definition: winuser.h:3237
BOOL WINAPI IsWindowVisible(_In_ HWND)
LONG bottom
Definition: windef.h:294
WindowHandle _hstatusbar
Definition: mainframe.h:55

Referenced by MDIMainFrame::frame_get_clientspace(), and ProcessMessage().

◆ fullscreen_move()

void MainFrameBase::fullscreen_move ( )
protected

Definition at line 616 of file mainframe.cpp.

617 {
618  RECT rt, pos;
619  GetWindowRect(_hwnd, &pos);
620 
621  Frame_CalcFrameClient(_hwnd, &rt);
622  ClientToScreen(_hwnd, (LPPOINT)&rt.left);
623  ClientToScreen(_hwnd, (LPPOINT)&rt.right);
624 
625  rt.left = pos.left-rt.left;
626  rt.top = pos.top-rt.top;
627  rt.right = GetSystemMetrics(SM_CXSCREEN)+pos.right-rt.right;
628  rt.bottom = GetSystemMetrics(SM_CYSCREEN)+pos.bottom-rt.bottom;
629 
630  MoveWindow(_hwnd, rt.left, rt.top, rt.right-rt.left, rt.bottom-rt.top, TRUE);
631 }
#define TRUE
Definition: types.h:120
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
LONG top
Definition: windef.h:292
#define Frame_CalcFrameClient(hwnd, prt)
Definition: window.h:388
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
#define SM_CXSCREEN
Definition: winuser.h:949
#define SM_CYSCREEN
Definition: winuser.h:950
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
LONG bottom
Definition: windef.h:294
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

Referenced by toggle_child().

◆ go_to()

bool MainFrameBase::go_to ( LPCTSTR  url,
bool  new_window 
)
protectedvirtual
Todo:
SDI implementation

Reimplemented in MDIMainFrame.

Definition at line 681 of file mainframe.cpp.

682 {
684 
685  return false;
686 }

Referenced by MDIMainFrame::go_to(), and Notify().

◆ Notify()

int MainFrameBase::Notify ( int  id,
NMHDR pnmh 
)
protectedvirtual

Reimplemented from Window.

Reimplemented in ShellBrowserChildT< MainFrameBase >.

Definition at line 457 of file mainframe.cpp.

458 {
459  switch(pnmh->code) {
460  // resize children windows when the rebar size changes
461 
462  case RBN_AUTOSIZE:
464  break;
465 
466  case TVN_GETINFOTIP: {
467  NMTVGETINFOTIP* pnmgit = (NMTVGETINFOTIP*)pnmh;
468 
469  if (pnmgit->lParam) {
470  const BookmarkNode& node = *(BookmarkNode*)pnmgit->lParam;
471 
472  if (node._type == BookmarkNode::BMNT_FOLDER) {
473  // display tooltips for bookmark folders
474  if (!node._pfolder->_description.empty())
475  lstrcpyn(pnmgit->pszText, node._pfolder->_description.c_str(), pnmgit->cchTextMax);
476  } else if (node._type == BookmarkNode::BMNT_BOOKMARK) {
477  // display tooltips for bookmark folders
478  String txt = node._pbookmark->_description;
479 
480  if (!node._pbookmark->_url.empty()) {
481  if (!txt.empty())
482  txt += TEXT(" - ");
483 
484  txt += node._pbookmark->_url;
485  }
486 
487  lstrcpyn(pnmgit->pszText, txt.c_str(), pnmgit->cchTextMax);
488  }
489  }
490  break;}
491 
492  case NM_DBLCLK: {
495 
496  if (lparam) {
497  const BookmarkNode& node = *(BookmarkNode*)lparam;
498 
499  if (node._type == BookmarkNode::BMNT_BOOKMARK) {
501 
502  go_to(node._pbookmark->_url, new_window);
503  }
504  }
505  break;}
506  }
507 
508  return 0;
509 }
#define RBN_AUTOSIZE
Definition: commctrl.h:1603
#define NMTVGETINFOTIP
Definition: commctrl.h:3744
static WCHAR String[]
Definition: stringtable.c:55
UINT code
Definition: winuser.h:3112
LONG_PTR LPARAM
Definition: windef.h:208
#define VK_SHIFT
Definition: winuser.h:2156
void resize_frame_client()
Definition: mainframe.cpp:551
virtual bool go_to(LPCTSTR url, bool new_window)
Definition: mainframe.cpp:681
#define TreeView_GetSelection(hwnd)
Definition: commctrl.h:3445
if(!(yy_init))
Definition: macro.lex.yy.c:714
static HWND new_window(LPCSTR lpClassName, DWORD dwStyle, HWND parent)
Definition: editor.c:54
WindowHandle _hsidebar
Definition: mainframe.h:57
SHORT WINAPI GetAsyncKeyState(_In_ int)
UINT WPARAM LPARAM lparam
Definition: msvc.h:92
#define TEXT(s)
Definition: k32.h:26
#define NM_DBLCLK
Definition: commctrl.h:131
LPARAM TreeView_GetItemData(HWND hwndTreeView, HTREEITEM hItem)
Definition: window.h:968
#define TVN_GETINFOTIP
Definition: commctrl.h:3743
#define lstrcpyn
Definition: winbase.h:3689
Definition: dlist.c:348

◆ OpenShellFolders()

int MainFrameBase::OpenShellFolders ( LPIDA  pida,
HWND  hFrameWnd 
)
static

Definition at line 77 of file mainframe.cpp.

78 {
79  int cnt = 0;
80 
81  LPCITEMIDLIST parent_pidl = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]);
82  ShellFolder folder(parent_pidl);
83  LOG(FmtString(TEXT("MainFrameBase::OpenShellFolders(): parent_pidl=%s"), (LPCTSTR)FileSysShellPath(parent_pidl)));
84 
85  for(int i=pida->cidl; i>0; --i) {
86  LPCITEMIDLIST pidl = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[i]);
87 
88  SFGAOF attribs = SFGAO_FOLDER;
89  HRESULT hr = folder->GetAttributesOf(1, &pidl, &attribs);
90 
91  if (SUCCEEDED(hr))
92  if (attribs & SFGAO_FOLDER) {
93  try {
94  XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
95 
96  bool mdi = XMLBool(explorer_options, "mdi", true);
97  bool separateFolders = XMLBool(explorer_options, "separate-folders", false);
98 
99  ShellPath pidl_abs = ShellPath(pidl).create_absolute_pidl(parent_pidl);
100  LOG(FmtString(TEXT("MainFrameBase::OpenShellFolders(): pidl_abs=%s"), (LPCTSTR)FileSysShellPath(pidl_abs)));
101 
102  if (hFrameWnd && (mdi || !separateFolders)) {
103  int flags = OWM_PIDL;
104 
105  if (separateFolders)
106  flags |= OWM_SEPARATE;
107 
109  ++cnt;
110  } else {
111  HWND hwnd;
112 #ifndef _NO_MDI
113  if (mdi)
114  hwnd = MDIMainFrame::Create(pidl_abs, 0);
115  else
116 #endif
117  hwnd = SDIMainFrame::Create(pidl_abs, 0);
118 
119  if (hwnd)
120  ++cnt;
121  }
122  } catch(COMException& e) {
124  }
125  }/*TEST
126  else { // !(attribs & SFGAO_FOLDER))
127  SHELLEXECUTEINFOA shexinfo;
128 
129  shexinfo.cbSize = sizeof(SHELLEXECUTEINFOA);
130  shexinfo.fMask = SEE_MASK_INVOKEIDLIST;
131  shexinfo.hwnd = NULL;
132  shexinfo.lpVerb = NULL;
133  shexinfo.lpFile = NULL;
134  shexinfo.lpParameters = NULL;
135  shexinfo.lpDirectory = NULL;
136  shexinfo.nShow = SW_NORMAL;
137  shexinfo.lpIDList = ILCombine(parent_pidl, pidl);
138 
139  if (ShellExecuteExA(&shexinfo))
140  ++cnt;
141 
142  ILFree((LPITEMIDLIST)shexinfo.lpIDList);
143  }*/
144  }
145 
146  return cnt;
147 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
Definition: fci.c:115
Retrieval of file system paths of ShellPath objects.
Definition: shellclasses.h:932
HRESULT hr
Definition: shlfolder.c:183
const GLint * attribs
Definition: glext.h:10538
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
IShellFolder smart pointer.
Definition: shellclasses.h:593
static HWND Create()
Definition: mainframe.cpp:1342
Exception with context information.
Definition: shellclasses.h:113
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned char * LPBYTE
Definition: typedefs.h:52
#define e
Definition: ke_i.h:82
LONG_PTR LPARAM
Definition: windef.h:208
struct CFFOLDER folder
Definition: fdi.c:110
void HandleException(COMException &e, HWND hwnd)
Exception Handler for COM exceptions.
static HWND Create()
Definition: mainframe.cpp:866
LONG HRESULT
Definition: typedefs.h:77
#define PM_OPEN_WINDOW
Definition: mainframe.h:29
UINT cidl
Definition: shlobj.h:491
GLbitfield flags
Definition: glext.h:7161
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
#define LOG(txt)
Definition: utility.h:102
HWND hFrameWnd
Definition: main.c:30
#define TEXT(s)
Definition: k32.h:26
ShellPath create_absolute_pidl(LPCITEMIDLIST parent_pidl) const
XMLPos get_cfg()
Definition: explorer.cpp:119
HWND _hMainWnd
Definition: globals.h:275
UINT aoffset[1]
Definition: shlobj.h:492
#define SendMessage
Definition: winuser.h:5709
view files in detail mode
Definition: mainframe.h:35
wrapper class for item ID lists
Definition: shellclasses.h:651
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
Definition: ebrowser.c:83
#define SUCCEEDED(hr)
Definition: intsafe.h:57
path is given as PIDL, otherwise as LPCTSTR
Definition: mainframe.h:36

Referenced by DesktopWindow::OnDefaultCommand(), and ShellBrowser::OnDefaultCommand().

◆ ProcessMessage()

bool MainFrameBase::ProcessMessage ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam,
LRESULT pres 
)
protected

Definition at line 311 of file mainframe.cpp.

312 {
313  switch(nmsg) {
314  case PM_TRANSLATE_MSG:
315  *pres = TranslateMsg((MSG*)lparam);
316  return true;
317 
318  case WM_SHOWWINDOW:
319  if (wparam) { // trigger child resizing after window creation - now we can succesfully call IsWindowVisible()
323  }
324  return false; // goto def;
325 
326  case WM_CLOSE:
327  DestroyWindow(_hwnd);
328  g_Globals._hMainWnd = 0;
329  break;
330 
331  case WM_DESTROY:
332  break;
333 
334  case WM_SIZE: {
337  break;} // do not pass message to DefFrameProc
338 
339  case WM_GETMINMAXINFO: {
341 
342  lpmmi->ptMaxTrackSize.x <<= 1;/*2*GetSystemMetrics(SM_CXSCREEN) / SM_CXVIRTUALSCREEN */
343  lpmmi->ptMaxTrackSize.y <<= 1;/*2*GetSystemMetrics(SM_CYSCREEN) / SM_CYVIRTUALSCREEN */
344  break;}
345 
346  case PM_FRM_CALC_CLIENT:
348  *pres = TRUE;
349  return true;
350 
351  case PM_FRM_GET_MENUINFO:
352  *pres = (LPARAM)&_menu_info;
353  return true;
354 
356  if (wparam == FCW_STATUS) {
357  *pres = (LRESULT)(HWND)_hstatusbar;
358  return true;
359  }
360  break;
361 
362  case PM_SETSTATUSTEXT:
364  break;
365 
366  case WM_SYSCOLORCHANGE:
369  break;
370 
371  default:
372  return false;
373  }
374 
375  *pres = 0;
376  return true;
377 }
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1608
#define TRUE
Definition: types.h:120
#define LRESULT
Definition: msvc.h:49
WindowHandle _hwndrebar
Definition: mainframe.h:51
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define RB_GETBARHEIGHT
Definition: commctrl.h:1580
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define WM_SHOWWINDOW
Definition: winuser.h:1610
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PM_TRANSLATE_MSG
Definition: window.h:266
#define PM_FRM_GET_MENUINFO
Definition: window.h:280
#define PM_FRM_CALC_CLIENT
Definition: window.h:387
struct tagMINMAXINFO * LPMINMAXINFO
void resize_frame_client()
Definition: mainframe.cpp:551
#define WM_DESTROY
Definition: winuser.h:1591
#define PM_SETSTATUSTEXT
Definition: window.h:340
virtual void resize_frame(int cx, int cy)
Definition: mainframe.cpp:512
#define WM_SIZE
Definition: winuser.h:1593
#define WM_CLOSE
Definition: winuser.h:1603
#define PM_GET_CONTROLWINDOW
Definition: explorer.h:64
#define SB_SETTEXT
Definition: commctrl.h:1921
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
virtual BOOL TranslateMsg(MSG *pmsg)
Definition: mainframe.cpp:379
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
UINT WPARAM LPARAM lparam
Definition: msvc.h:92
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
WindowHandle _htoolbar
Definition: mainframe.h:53
HWND _hMainWnd
Definition: globals.h:275
virtual void frame_get_clientspace(PRECT prect)
Definition: mainframe.cpp:558
#define SendMessage
Definition: winuser.h:5709
#define HIWORD(l)
Definition: typedefs.h:246
WindowHandle _hstatusbar
Definition: mainframe.h:55
POINT ptMaxTrackSize
Definition: winuser.h:3573
#define WM_GETMINMAXINFO
Definition: winuser.h:1622
#define LOWORD(l)
Definition: pedump.c:82
MenuInfo _menu_info
Definition: mainframe.h:63
#define LPARAM
Definition: msvc.h:38
UINT WPARAM wparam
Definition: msvc.h:92

Referenced by WndProc(), and MDIMainFrame::WndProc().

◆ resize_frame()

void MainFrameBase::resize_frame ( int  cx,
int  cy 
)
protectedvirtual

Reimplemented in SDIMainFrame, and MDIMainFrame.

Definition at line 512 of file mainframe.cpp.

513 {
514  if (cy <= 0)
515  return; // avoid resizing children when receiving RBN_AUTOSIZE while getting minimized
516 
517  RECT rect = {0, 0, cx, cy};
518 
519  if (_hwndrebar) {
521  rect.top += height;
522  rect.top += 5;
523 
525  } else {
526  if (IsWindowVisible(_htoolbar)) {
527  SendMessage(_htoolbar, WM_SIZE, 0, 0);
528  WindowRect rt(_htoolbar);
529  rect.top = rt.bottom;
530  // rect.bottom -= rt.bottom;
531  }
532  }
533 
535  int parts[] = {300, 500};
536 
539  ClientRect rt(_hstatusbar);
540  rect.bottom -= rt.bottom;
541  }
542 
543  if (IsWindowVisible(_hsidebar)) {
544  WindowRect rt(_hsidebar);
545  rect.left += rt.right-rt.left;
546 
547  SetWindowPos(_hsidebar, 0, -1, rect.top-1, rt.right-rt.left, rect.bottom-rect.top+1, SWP_NOACTIVATE|SWP_NOZORDER);
548  }
549 }
WindowHandle _hwndrebar
Definition: mainframe.h:51
#define RB_GETBARHEIGHT
Definition: commctrl.h:1580
WindowHandle _haddrcombo
Definition: mainframe.h:54
#define SWP_NOZORDER
Definition: winuser.h:1232
& rect
Definition: startmenu.cpp:1413
LONG_PTR LPARAM
Definition: windef.h:208
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
smooth NULL
Definition: ftsmooth.c:416
#define WM_SIZE
Definition: winuser.h:1593
#define SWP_NOACTIVATE
Definition: winuser.h:1227
WindowHandle _hsidebar
Definition: mainframe.h:57
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
WindowHandle _htoolbar
Definition: mainframe.h:53
#define SB_SETPARTS
Definition: commctrl.h:1926
_Out_opt_ int * cx
Definition: commctrl.h:570
#define SendMessage
Definition: winuser.h:5709
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define SWP_NOMOVE
Definition: winuser.h:1229
WindowHandle _hstatusbar
Definition: mainframe.h:55
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)

Referenced by ProcessMessage(), and resize_frame_client().

◆ resize_frame_client()

void MainFrameBase::resize_frame_client ( )
protected

Definition at line 551 of file mainframe.cpp.

552 {
553  ClientRect rect(_hwnd);
554 
555  resize_frame(rect.right, rect.bottom);
556 }
& rect
Definition: startmenu.cpp:1413
virtual void resize_frame(int cx, int cy)
Definition: mainframe.cpp:512

Referenced by Notify(), ProcessMessage(), and toggle_child().

◆ toggle_child()

void MainFrameBase::toggle_child ( HWND  hwnd,
UINT  cmd,
HWND  hchild,
int  band_idx = -1 
)
protected

Definition at line 634 of file mainframe.cpp.

635 {
636  BOOL vis = IsWindowVisible(hchild);
637 
639 
640  if (band_idx != -1)
641  SendMessage(_hwndrebar, RB_SHOWBAND, band_idx, !vis);
642  else
643  ShowWindow(hchild, vis? SW_HIDE: SW_SHOW);
644 
645  if (_fullscreen._mode)
646  fullscreen_move();
647 
649 }
FullScreenParameters _fullscreen
Definition: mainframe.h:66
#define MF_BYCOMMAND
Definition: winuser.h:202
WindowHandle _hwndrebar
Definition: mainframe.h:51
Definition: ftp_var.h:139
#define SW_HIDE
Definition: winuser.h:762
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
void fullscreen_move()
Definition: mainframe.cpp:616
#define SW_SHOW
Definition: winuser.h:769
void resize_frame_client()
Definition: mainframe.cpp:551
#define MF_CHECKED
Definition: winuser.h:132
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define RB_SHOWBAND
Definition: commctrl.h:1590
HMENU _hMenuView
Definition: window.h:277
#define SendMessage
Definition: winuser.h:5709
BOOL WINAPI IsWindowVisible(_In_ HWND)
MenuInfo _menu_info
Definition: mainframe.h:63

Referenced by Command(), and MDIMainFrame::Command().

◆ toggle_fullscreen()

BOOL MainFrameBase::toggle_fullscreen ( )
protected

Definition at line 586 of file mainframe.cpp.

587 {
588  RECT rt;
589 
590  if ((_fullscreen._mode=!_fullscreen._mode)) {
591  GetWindowRect(_hwnd, &_fullscreen._orgPos);
592  _fullscreen._wasZoomed = IsZoomed(_hwnd);
593 
594  Frame_CalcFrameClient(_hwnd, &rt);
595  ClientToScreen(_hwnd, (LPPOINT)&rt.left);
596  ClientToScreen(_hwnd, (LPPOINT)&rt.right);
597 
598  rt.left = _fullscreen._orgPos.left-rt.left;
599  rt.top = _fullscreen._orgPos.top-rt.top;
600  rt.right = GetSystemMetrics(SM_CXSCREEN)+_fullscreen._orgPos.right-rt.right;
601  rt.bottom = GetSystemMetrics(SM_CYSCREEN)+_fullscreen._orgPos.bottom-rt.bottom;
602 
603  MoveWindow(_hwnd, rt.left, rt.top, rt.right-rt.left, rt.bottom-rt.top, TRUE);
604  } else {
605  MoveWindow(_hwnd, _fullscreen._orgPos.left, _fullscreen._orgPos.top,
606  _fullscreen._orgPos.right-_fullscreen._orgPos.left,
607  _fullscreen._orgPos.bottom-_fullscreen._orgPos.top, TRUE);
608 
609  if (_fullscreen._wasZoomed)
610  ShowWindow(_hwnd, WS_MAXIMIZE);
611  }
612 
613  return _fullscreen._mode;
614 }
#define TRUE
Definition: types.h:120
FullScreenParameters _fullscreen
Definition: mainframe.h:66
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
LONG top
Definition: windef.h:292
#define Frame_CalcFrameClient(hwnd, prt)
Definition: window.h:388
LONG left
Definition: windef.h:291
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LONG right
Definition: windef.h:293
#define SM_CXSCREEN
Definition: winuser.h:949
#define SM_CYSCREEN
Definition: winuser.h:950
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
BOOL WINAPI IsZoomed(_In_ HWND)
LONG bottom
Definition: windef.h:294
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WS_MAXIMIZE
Definition: pedump.c:623

Referenced by Command().

◆ TranslateMsg()

BOOL MainFrameBase::TranslateMsg ( MSG pmsg)
protectedvirtual

Reimplemented in MDIMainFrame.

Definition at line 379 of file mainframe.cpp.

380 {
381  if (TranslateAccelerator(_hwnd, _hAccel, pmsg))
382  return TRUE;
383 
384  return FALSE;
385 }
#define TranslateAccelerator
Definition: winuser.h:5726
#define TRUE
Definition: types.h:120
HACCEL _hAccel
Definition: mainframe.h:68

Referenced by ProcessMessage(), and MDIMainFrame::TranslateMsg().

◆ WndProc()

LRESULT MainFrameBase::WndProc ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)
protectedvirtual

Reimplemented from Window.

Reimplemented in ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > >, ShellBrowserChildT< MainFrameBase >, SDIMainFrame, and MDIMainFrame.

Definition at line 301 of file mainframe.cpp.

302 {
303  LRESULT res;
304 
305  if (ProcessMessage(nmsg, wparam, lparam, &res))
306  return res;
307  else
308  return super::WndProc(nmsg, wparam, lparam);
309 }
bool ProcessMessage(UINT nmsg, WPARAM wparam, LPARAM lparam, LRESULT *pres)
Definition: mainframe.cpp:311
virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:280
UINT WPARAM LPARAM lparam
Definition: msvc.h:92
GLuint res
Definition: glext.h:9613
LONG_PTR LRESULT
Definition: windef.h:209
UINT WPARAM wparam
Definition: msvc.h:92

Member Data Documentation

◆ _fullscreen

FullScreenParameters MainFrameBase::_fullscreen
protected

Definition at line 66 of file mainframe.h.

Referenced by toggle_child(), and toggle_fullscreen().

◆ _hAccel

HACCEL MainFrameBase::_hAccel
protected

Definition at line 68 of file mainframe.h.

Referenced by MainFrameBase(), and TranslateMsg().

◆ _haddrcombo

WindowHandle MainFrameBase::_haddrcombo

Definition at line 54 of file mainframe.h.

Referenced by MainFrameBase(), resize_frame(), and SDIMainFrame::set_url().

◆ _himl

HIMAGELIST MainFrameBase::_himl

Definition at line 58 of file mainframe.h.

Referenced by FillBookmarks(), MainFrameBase(), and ~MainFrameBase().

◆ _himl_old

HIMAGELIST MainFrameBase::_himl_old
protected

Definition at line 69 of file mainframe.h.

Referenced by MainFrameBase(), and ~MainFrameBase().

◆ _hMenuFrame

HMENU MainFrameBase::_hMenuFrame

Definition at line 60 of file mainframe.h.

Referenced by MainFrameBase().

◆ _hMenuWindow

HMENU MainFrameBase::_hMenuWindow

Definition at line 61 of file mainframe.h.

Referenced by MainFrameBase(), and MDIMainFrame::MDIMainFrame().

◆ _hsidebar

WindowHandle MainFrameBase::_hsidebar

◆ _hstatusbar

WindowHandle MainFrameBase::_hstatusbar

◆ _htoolbar

◆ _hwndrebar

◆ _menu_info

MenuInfo MainFrameBase::_menu_info

The documentation for this struct was generated from the following files: