ReactOS 0.4.15-dev-7958-gcd0bb1a
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)
 
 Window (INT cx, INT cy, BOOL fAutoHide=FALSE)
 
virtual ~Window ()
 
virtual LRESULT CALLBACK WindowProcDx (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void DoAction ()
 

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
 
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 ()
 
static BOOL DoRegisterClass (HINSTANCE hInstance)
 
static HWND DoCreateMainWnd (HINSTANCE hInstance, LPCTSTR pszText, INT cx, INT cy, DWORD style=WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN, DWORD exstyle=WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW|WS_EX_TOPMOST, BOOL fAutoHide=FALSE)
 
static INT DoMainLoop ()
 
static WindowGetAppbarData (HWND hwnd)
 
static LRESULT CALLBACK WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static DWORD WINAPI ActionThreadFunc (LPVOID args)
 

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)
 
virtual LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
virtual int Command (int id, int code)
 
virtual int Notify (int id, NMHDR *pnmh)
 
void OnCommand (HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
 
void OnPaint (HWND hwnd)
 
void OnRButtonDown (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
 
void OnKey (HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags)
 
void OnAppBarCallback (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL AppBar_Register (HWND hwnd)
 
BOOL AppBar_UnRegister (HWND hwnd)
 
BOOL AppBar_SetAutoHide (HWND hwnd, BOOL fHide)
 
BOOL AppBar_AutoHide (HWND hwnd)
 
BOOL AppBar_NoAutoHide (HWND hwnd)
 
BOOL AppBar_SetSide (HWND hwnd, UINT uSide)
 
void AppBar_SetAlwaysOnTop (HWND hwnd, BOOL fOnTop)
 
void AppBar_Hide (HWND hwnd)
 
void AppBar_UnHide (HWND hwnd)
 
void AppBar_SetAutoHideTimer (HWND hwnd)
 
void AppBar_SetAutoUnhideTimer (HWND hwnd)
 
void AppBar_Size (HWND hwnd)
 
void AppBar_QueryPos (HWND hwnd, LPRECT lprc)
 
void AppBar_QuerySetPos (UINT uEdge, LPRECT lprc, PAPPBARDATA pabd, BOOL fMove)
 
void AppBar_PosChanged (PAPPBARDATA pabd)
 
BOOL OnCreate (HWND hwnd, LPCREATESTRUCT lpCreateStruct)
 
void OnActivate (HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized)
 
void OnWindowPosChanged (HWND hwnd, const LPWINDOWPOS lpwpos)
 
void OnSize (HWND hwnd, UINT state, int cx, int cy)
 
void OnMove (HWND hwnd, int x, int y)
 
void OnNCDestroy (HWND hwnd)
 
void OnTimer (HWND hwnd, UINT id)
 
UINT OnNCHitTest (HWND hwnd, int x, int y)
 
void OnLButtonDown (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
 
void OnMouseMove (HWND hwnd, int x, int y, UINT keyFlags)
 
void OnLButtonUp (HWND hwnd, int x, int y, UINT keyFlags)
 
void GetWorkArea (LPRECT prc) const
 

Protected Attributes

FullScreenParameters _fullscreen
 
HACCEL _hAccel
 
HIMAGELIST _himl_old
 
- Protected Attributes inherited from Window
HWND m_hwnd
 
BOOL m_fAutoHide
 
BOOL m_fOnTop
 
BOOL m_fHiding
 
UINT m_uSide
 
LONG m_cxWidth
 
LONG m_cyHeight
 
LONG m_cxSave
 
LONG m_cySave
 
BOOL m_fAppBarRegd
 
BOOL m_fMoving
 
BOOL m_bDragged
 
POINT m_ptDragOn
 
RECT m_rcAppBar
 
RECT m_rcDrag
 

Additional Inherited Members

- Static Protected Member Functions inherited from Window
static Windowcreate_controller (HWND hwnd)
 create controller for a new window
 
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;
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
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}
static HDC hDC
Definition: 3dtext.c:33
#define ID_STOP
Definition: resource.h:19
#define ID_REFRESH
Definition: resource.h:16
HFONT hFont
Definition: main.c:53
#define ID_VIEW_STATUSBAR
Definition: resource.h:54
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 NULL
Definition: types.h:112
DWORD bpp
Definition: surface.c:185
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define IDW_TOOLBAR
Definition: explorer.h:53
#define IDW_SIDEBAR
Definition: explorer.h:57
#define IDW_ADDRESSBAR
Definition: explorer.h:56
#define IDW_STATUSBAR
Definition: explorer.h:52
unsigned long DWORD
Definition: ntddk_ex.h:95
#define TEXT(s)
Definition: k32.h:26
#define RBBS_HIDETITLE
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
#define ID_GO_UP
Definition: resource.h:210
#define ID_GO_HOME
Definition: resource.h:208
#define ID_GO_SEARCH
Definition: resource.h:209
#define ID_GO_FORWARD
Definition: resource.h:207
#define ID_VIEW_SIDE_BAR
Definition: resource.h:140
#define IDA_EXPLORER
Definition: resource.h:59
#define ID_VIEW_TOOL_BAR
Definition: resource.h:138
#define ID_GO_BACK
Definition: resource.h:206
static HDC
Definition: imagelist.c:92
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
#define WS_CHILD
Definition: pedump.c:617
#define WS_TABSTOP
Definition: pedump.c:634
#define WS_BORDER
Definition: pedump.c:625
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define ILC_COLOR4
Definition: commctrl.h:354
#define BTNS_BUTTON
Definition: commctrl.h:998
#define RBBS_BREAK
Definition: commctrl.h:1489
#define RB_INSERTBAND
Definition: commctrl.h:1602
#define CreateStatusWindow
Definition: commctrl.h:1933
#define RBBIM_CHILDSIZE
Definition: commctrl.h:1507
#define ILC_COLOR16
Definition: commctrl.h:356
#define ILC_COLOR8
Definition: commctrl.h:355
#define BTNS_SEP
Definition: commctrl.h:999
#define RBS_BANDBORDERS
Definition: commctrl.h:1472
#define REBARBANDINFO
Definition: commctrl.h:1569
#define TVSIL_NORMAL
Definition: commctrl.h:3443
#define RBBIM_CHILD
Definition: commctrl.h:1506
#define TB_GETBUTTONSIZE
Definition: commctrl.h:1160
#define TVS_SHOWSELALWAYS
Definition: commctrl.h:3252
#define ILC_COLOR32
Definition: commctrl.h:358
#define TVS_HASLINES
Definition: commctrl.h:3248
#define RBS_AUTOSIZE
Definition: commctrl.h:1475
#define REBARCLASSNAME
Definition: commctrl.h:1466
#define WC_TREEVIEW
Definition: commctrl.h:3245
#define RBBS_CHILDEDGE
Definition: commctrl.h:1491
#define CCS_NODIVIDER
Definition: commctrl.h:2248
#define TBSTATE_ENABLED
Definition: commctrl.h:974
#define TBSTYLE_FLAT
Definition: commctrl.h:992
#define RBS_VARHEIGHT
Definition: commctrl.h:1471
#define TVS_HASBUTTONS
Definition: commctrl.h:3247
#define ILC_MASK
Definition: commctrl.h:351
#define CCS_NOPARENTALIGN
Definition: commctrl.h:2246
#define CCS_NORESIZE
Definition: commctrl.h:2245
#define CCS_NOMOVEY
Definition: commctrl.h:2243
#define RBBIM_STYLE
Definition: commctrl.h:1502
#define TreeView_SetImageList(hwnd, himl, iImage)
Definition: commctrl.h:3447
#define ILC_COLOR24
Definition: commctrl.h:357
#define RBBIM_SIZE
Definition: commctrl.h:1508
#define RBBIM_TEXT
Definition: commctrl.h:1504
#define RBS_DBLCLKTOGGLE
Definition: commctrl.h:1477
#define TVS_INFOTIP
Definition: commctrl.h:3258
#define WC_COMBOBOX
Definition: commctrl.h:4718
#define ILC_COLOR
Definition: commctrl.h:352
#define RBBS_GRIPPERALWAYS
Definition: commctrl.h:1496
HINSTANCE _hInstance
Definition: globals.h:270
PreTranslateWindow super
Definition: mainframe.h:43
WindowHandle _hstatusbar
Definition: mainframe.h:55
WindowHandle _htoolbar
Definition: mainframe.h:53
WindowHandle _hsidebar
Definition: mainframe.h:57
MenuInfo _menu_info
Definition: mainframe.h:63
WindowHandle _haddrcombo
Definition: mainframe.h:54
HIMAGELIST _himl_old
Definition: mainframe.h:69
HMENU _hMenuFrame
Definition: mainframe.h:60
HMENU _hMenuWindow
Definition: mainframe.h:61
HACCEL _hAccel
Definition: mainframe.h:68
WindowHandle _hwndrebar
Definition: mainframe.h:51
HIMAGELIST _himl
Definition: mainframe.h:58
HMENU _hMenuView
Definition: window.h:277
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define ANSI_VAR_FONT
Definition: wingdi.h:907
#define BITSPIXEL
Definition: wingdi.h:720
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CreateWindowEx
Definition: winuser.h:5755
#define WS_EX_STATICEDGE
Definition: winuser.h:403
#define MF_BYCOMMAND
Definition: winuser.h:202
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define SM_CYSMICON
Definition: winuser.h:1013
#define MF_CHECKED
Definition: winuser.h:132
#define MF_UNCHECKED
Definition: winuser.h:204
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define SM_CXSMICON
Definition: winuser.h:1012
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_SETFONT
Definition: winuser.h:1650
#define SendMessage
Definition: winuser.h:5843
HDC WINAPI GetDC(_In_opt_ HWND)
#define CBS_DROPDOWN
Definition: winuser.h:283
#define MAKEINTRESOURCE
Definition: winuser.h:591
int WINAPI GetSystemMetrics(_In_ int)
#define LoadAccelerators
Definition: winuser.h:5810
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HMENU WINAPI GetMenu(_In_ HWND)
#define IDB_TOOLBAR
Definition: wordpad.h:183
char TCHAR
Definition: xmlstorage.h:189

◆ ~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
298}
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
bool _desktop_mode
Definition: globals.h:276
HWND _hMainWnd
Definition: globals.h:275
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)

Member Function Documentation

◆ Command()

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

Reimplemented from Window.

Reimplemented in MDIMainFrame, and SDIMainFrame.

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
402 toggle_child(_hwnd, id, _hstatusbar);
403 break;
404
405 case ID_VIEW_SIDE_BAR:
406 // lazy initialization
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
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
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 IDS_TITLE
Definition: resource.h:30
#define ID_HELP
Definition: resource.h:26
#define ID_FILE_EXIT
Definition: resource.h:46
#define IDD_EXECUTE
Definition: resource.h:112
void explorer_about(HWND hwndParent)
Definition: explorer.cpp:934
#define ID_EXECUTE
Definition: resource.h:68
#define ID_ABOUT_EXPLORER
Definition: resource.h:204
#define ID_TOOLS_OPTIONS
Definition: resource.h:222
#define ID_VIEW_FULLSCREEN
Definition: resource.h:193
#define IDD_MDI_SDI
Definition: resource.h:105
#define ID_EXPLORER_FAQ
Definition: resource.h:189
#define ID_ABOUT_WINDOWS
Definition: resource.h:203
BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow, LPCTSTR parameters)
Definition: utility.cpp:189
void display_error(HWND hwnd, DWORD error)
Definition: utility.cpp:98
#define WINDOW_CREATOR(WND_CLASS)
Definition: window.h:202
static HINSTANCE hinst
Definition: edit.c:551
struct _CONTEXT CONTEXT
#define TreeView_GetCount(hwnd)
Definition: commctrl.h:3432
#define ShellExecute
Definition: shellapi.h:693
#define ShellAbout
Definition: shellapi.h:692
static int DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0)
Definition: window.cpp:701
The "Execute..."-dialog lets the user enter a command line to launch.
Definition: filechild.h:133
static INT_PTR CALLBACK WndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: filechild.cpp:95
BOOL toggle_fullscreen()
Definition: mainframe.cpp:586
void toggle_child(HWND hwnd, UINT cmd, HWND hchild, int band_idx=-1)
Definition: mainframe.cpp:634
void FillBookmarks()
Definition: mainframe.cpp:651
configuration dialog to choose between MDI and SDI mode
Definition: settings.h:92
convenient loading of string resources
Definition: globals.h:304
int32_t INT_PTR
Definition: typedefs.h:64
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define WM_CLOSE
Definition: winuser.h:1621
#define WinHelp
Definition: winuser.h:5864
#define DialogBoxParam
Definition: winuser.h:5764
#define IDOK
Definition: winuser.h:830
#define HELP_INDEX
Definition: winuser.h:2410
#define SW_SHOW
Definition: winuser.h:775

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}
@ OWM_EXPLORE
Definition: mainframe.h:32
@ OWM_DETAILS
"rooted" window with special shell namespace root
Definition: mainframe.h:34
#define PM_OPEN_WINDOW
Definition: mainframe.h:29
static HWND Create()
Definition: mainframe.cpp:866
static HWND Create()
Definition: mainframe.cpp:1342
Definition: ftp_var.h:139
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI UpdateWindow(_In_ HWND)
#define PostMessage
Definition: winuser.h:5832
BOOL WINAPI DestroyWindow(_In_ HWND)
const CHAR * LPCTSTR
Definition: xmlstorage.h:193

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;
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}
#define IDI_DOT
Definition: resource.h:10
#define IDS_FAVORITES
Definition: resource.h:35
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
@ ICID_FAVORITES
Definition: globals.h:73
@ ICID_BOOKMARK
Definition: globals.h:85
@ ICID_FOLDER
Definition: globals.h:66
#define TVI_LAST
Definition: commctrl.h:3370
#define TreeView_DeleteAllItems(hwnd)
Definition: commctrl.h:3417
#define TVIF_TEXT
Definition: commctrl.h:3266
#define TreeView_Expand(hwnd, hitem, code)
Definition: commctrl.h:3420
#define TVIF_IMAGE
Definition: commctrl.h:3267
#define TVE_EXPAND
Definition: commctrl.h:3423
#define TV_INSERTSTRUCT
Definition: commctrl.h:3377
#define TVI_ROOT
Definition: commctrl.h:3368
#define TreeView_InsertItem(hwnd, lpis)
Definition: commctrl.h:3412
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3271
void fill_tree(HWND hwnd, HTREEITEM parent, HIMAGELIST, HDC hdc_wnd) const
fill treeview control with bookmark tree content
Definition: favorites.cpp:327
IconCache _icon_cache
Definition: globals.h:285
Favorites _favorites
Definition: globals.h:297
const Icon & get_icon(int icon_id)
Definition: explorer.cpp:625
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
convenient loading of small (16x16) icon resources
Definition: globals.h:321
#define GetStockBrush(i)
Definition: windowsx.h:307
#define WHITE_BRUSH
Definition: wingdi.h:902

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 {
564
565 GetWindowPlacement(_hwnd, &wp);
566
567 prect->left = prect->top = 0;
573 }
574
576 ClientRect rt(_htoolbar);
577 prect->top += rt.bottom+2;
578 }
579
581 ClientRect rt(_hstatusbar);
582 prect->bottom -= rt.bottom;
583 }
584}
RECT rcNormalPosition
Definition: winuser.h:3295
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define SM_CYEDGE
Definition: winuser.h:1009
#define SM_CXEDGE
Definition: winuser.h:1008
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
BOOL WINAPI IsIconic(_In_ HWND)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SM_CXSIZEFRAME
Definition: winuser.h:993
#define SM_CYMENUSIZE
Definition: winuser.h:1018
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define SM_CYCAPTION
Definition: winuser.h:963
#define SM_CYSIZEFRAME
Definition: winuser.h:995

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;
629
630 MoveWindow(_hwnd, rt.left, rt.top, rt.right-rt.left, rt.bottom-rt.top, TRUE);
631}
#define TRUE
Definition: types.h:120
#define Frame_CalcFrameClient(hwnd, prt)
Definition: window.h:388
#define SM_CYSCREEN
Definition: winuser.h:960
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
#define SM_CXSCREEN
Definition: winuser.h:959
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)

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
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) {
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}
@ lparam
Definition: SystemMenu.c:31
if(dx< 0)
Definition: linetemp.h:194
LPARAM TreeView_GetItemData(HWND hwndTreeView, HTREEITEM hItem)
Definition: window.h:968
static HWND new_window(LPCSTR lpClassName, DWORD dwStyle, HWND parent)
Definition: editor.c:54
#define NM_DBLCLK
Definition: commctrl.h:131
#define TreeView_GetSelection(hwnd)
Definition: commctrl.h:3473
#define RBN_AUTOSIZE
Definition: commctrl.h:1631
#define TVN_GETINFOTIP
Definition: commctrl.h:3771
#define NMTVGETINFOTIP
Definition: commctrl.h:3772
void resize_frame_client()
Definition: mainframe.cpp:551
virtual bool go_to(LPCTSTR url, bool new_window)
Definition: mainframe.cpp:681
UINT code
Definition: winuser.h:3159
Definition: dlist.c:348
#define lstrcpyn
Definition: winbase.h:3875
#define VK_SHIFT
Definition: winuser.h:2202
SHORT WINAPI GetAsyncKeyState(_In_ int)

◆ 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)
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}
HWND hFrameWnd
Definition: main.c:35
Retrieval of file system paths of ShellPath objects.
Definition: shellclasses.h:933
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
Definition: ebrowser.c:83
GLbitfield flags
Definition: glext.h:7161
const GLint * attribs
Definition: glext.h:10538
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
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define e
Definition: ke_i.h:82
@ OWM_SEPARATE
path is given as PIDL, otherwise as LPCTSTR
Definition: mainframe.h:36
@ OWM_PIDL
view files in detail mode
Definition: mainframe.h:35
#define LOG(txt)
Definition: utility.h:102
void HandleException(COMException &e, HWND hwnd)
Exception Handler for COM exceptions.
HRESULT hr
Definition: shlfolder.c:183
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
UINT aoffset[1]
Definition: shlobj.h:566
UINT cidl
Definition: shlobj.h:565
Exception with context information.
Definition: shellclasses.h:114
XMLPos get_cfg()
Definition: explorer.cpp:119
IShellFolder smart pointer.
Definition: shellclasses.h:594
wrapper class for item ID lists
Definition: shellclasses.h:652
ShellPath create_absolute_pidl(LPCITEMIDLIST parent_pidl) const
Definition: fci.c:116
unsigned char * LPBYTE
Definition: typedefs.h:53

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);
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
348 *pres = TRUE;
349 return true;
350
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
369 break;
370
371 default:
372 return false;
373 }
374
375 *pres = 0;
376 return true;
377}
@ wparam
Definition: SystemMenu.c:30
#define PM_GET_CONTROLWINDOW
Definition: explorer.h:64
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define PM_TRANSLATE_MSG
Definition: window.h:266
#define PM_SETSTATUSTEXT
Definition: window.h:340
#define PM_FRM_GET_MENUINFO
Definition: window.h:280
#define PM_FRM_CALC_CLIENT
Definition: window.h:387
#define LRESULT
Definition: ole.h:14
#define LOWORD(l)
Definition: pedump.c:82
#define RB_GETBARHEIGHT
Definition: commctrl.h:1608
#define SB_SETTEXT
Definition: commctrl.h:1949
virtual BOOL TranslateMsg(MSG *pmsg)
Definition: mainframe.cpp:379
virtual void resize_frame(int cx, int cy)
Definition: mainframe.cpp:512
virtual void frame_get_clientspace(PRECT prect)
Definition: mainframe.cpp:558
POINT ptMaxTrackSize
Definition: winuser.h:3631
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define WM_SIZE
Definition: winuser.h:1611
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1626
#define WM_SHOWWINDOW
Definition: winuser.h:1628
#define WM_GETMINMAXINFO
Definition: winuser.h:1640
struct tagMINMAXINFO * LPMINMAXINFO
#define WM_DESTROY
Definition: winuser.h:1609

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

◆ resize_frame()

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

Reimplemented in MDIMainFrame, and SDIMainFrame.

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 {
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
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}
static const D3D_BLOB_PART parts[]
Definition: blob.c:76
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
#define SB_SETPARTS
Definition: commctrl.h:1954
& rect
Definition: startmenu.cpp:1413
#define SWP_NOACTIVATE
Definition: winuser.h:1242
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOMOVE
Definition: winuser.h:1244
#define SWP_NOZORDER
Definition: winuser.h:1247

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}

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)
647
649}
unsigned int BOOL
Definition: ntddk_ex.h:94
#define RB_SHOWBAND
Definition: commctrl.h:1618
FullScreenParameters _fullscreen
Definition: mainframe.h:66
void fullscreen_move()
Definition: mainframe.cpp:616
#define SW_HIDE
Definition: winuser.h:768

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 WS_MAXIMIZE
Definition: pedump.c:623
BOOL WINAPI IsZoomed(_In_ HWND)

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 FALSE
Definition: types.h:117
#define TranslateAccelerator
Definition: winuser.h:5860

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

◆ WndProc()

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

Reimplemented from Window.

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

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}
GLuint res
Definition: glext.h:9613
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
LONG_PTR LRESULT
Definition: windef.h:209

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: