ReactOS 0.4.16-dev-306-g647d351
ChildWindow Struct Referenceabstract

#include <window.h>

Inheritance diagram for ChildWindow:
Collaboration diagram for ChildWindow:

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

 ChildWindow (HWND hwnd, const ChildWndInfo &info)
 
bool go_to (LPCTSTR url)
 
- 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 ChildWindowcreate (const ChildWndInfo &info, const RECT &rect, CREATORFUNC_INFO creator, LPCTSTR classname, LPCTSTR title=NULL, DWORD style=0)
 
- 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)
 

Protected Member Functions

LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
virtual void resize_children (int cx, int cy)
 
virtual String jump_to_int (LPCTSTR url)=0
 
void set_url (LPCTSTR url)
 
- 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

MenuInfo_menu_info
 
WindowHandle _left_hwnd
 
WindowHandle _right_hwnd
 
int _focus_pane
 
int _split_pos
 
int _last_split
 
HWND _hwndFrame
 
String _statusText
 
String _url
 
stack< String_url_history
 
- 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

- Public Attributes inherited from Window
IAccessible IAccessible_iface
 
IOleWindow IOleWindow_iface
 
IEnumVARIANT IEnumVARIANT_iface
 
LONG ref
 
- 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

Class ChildWindow represents MDI child windows. It is used with class MainFrame.

Definition at line 304 of file window.h.

Member Typedef Documentation

◆ super

Definition at line 306 of file window.h.

Constructor & Destructor Documentation

◆ ChildWindow()

ChildWindow::ChildWindow ( HWND  hwnd,
const ChildWndInfo info 
)

Definition at line 359 of file window.cpp.

360 : super(hwnd),
361 _hwndFrame(GetParent(info._hmdiclient))
362{
363 _focus_pane = 0;
366}
#define DEFAULT_SPLIT_POS
Definition: window.h:270
int _split_pos
Definition: window.h:328
HWND _hwndFrame
Definition: window.h:331
int _last_split
Definition: window.h:329
int _focus_pane
Definition: window.h:326
PreTranslateWindow super
Definition: window.h:306
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
HWND WINAPI GetParent(_In_ HWND)

Member Function Documentation

◆ create()

ChildWindow * ChildWindow::create ( const ChildWndInfo info,
const RECT rect,
CREATORFUNC_INFO  creator,
LPCTSTR  classname,
LPCTSTR  title = NULL,
DWORD  style = 0 
)
static

Definition at line 369 of file window.cpp.

371{
373
374 mcs.szClass = classname;
375 mcs.szTitle = title;
376 mcs.hOwner = g_Globals._hInstance;
377 mcs.x = rect.left,
378 mcs.y = rect.top;
379 mcs.cx = rect.right - rect.left;
380 mcs.cy = rect.bottom - rect.top;
381 mcs.style = style;
382 mcs.lParam = 0;
383
384 return static_cast<ChildWindow*>(create_mdi_child(info, mcs, creator));
385}
static struct myctx * mcs
Definition: adnstest.c:53
Arabic default style
Definition: afstyles.h:94
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
static char title[]
Definition: ps.c:92
WCHAR classname[128]
Definition: startup.c:15
& rect
Definition: startmenu.cpp:1413
HINSTANCE _hInstance
Definition: globals.h:270
static Window * create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator)
Definition: window.cpp:118

Referenced by WebChildWindow::create(), and MDIShellBrowserChild::create().

◆ go_to()

bool ChildWindow::go_to ( LPCTSTR  url)

Definition at line 553 of file window.cpp.

554{
555 const String& url_str = jump_to_int(url);
556
557 if (!url_str.empty()) {
558 set_url(url_str);
559
560 _url_history.push(url_str);
561
562 return true;
563 } else
564 return false;
565}
static const WCHAR url[]
Definition: encode.c:1432
stack< String > _url_history
Definition: window.h:335
virtual String jump_to_int(LPCTSTR url)=0
void set_url(LPCTSTR url)
Definition: window.cpp:567
void push(const value_type &__x)
Definition: _stack.h:86
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433

Referenced by WndProc().

◆ jump_to_int()

virtual String ChildWindow::jump_to_int ( LPCTSTR  url)
protectedpure virtual

Implemented in FileChildWindow, MDIShellBrowserChild, and WebChildWindow.

Referenced by go_to(), and WndProc().

◆ resize_children()

void ChildWindow::resize_children ( int  cx,
int  cy 
)
protectedvirtual

Reimplemented in FileChildWindow.

Definition at line 527 of file window.cpp.

528{
529 HDWP hdwp = BeginDeferWindowPos(2);
530 RECT rt;
531
532 rt.left = 0;
533 rt.top = 0;
534 rt.right = cx;
535 rt.bottom = cy;
536
537 if (_left_hwnd) {
539
541 } else {
542 _split_pos = 0;
543 cx = 0;
544 }
545
546 if (_right_hwnd)
547 hdwp = DeferWindowPos(hdwp, _right_hwnd, 0, rt.left+cx+1, rt.top, rt.right-cx, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
548
549 EndDeferWindowPos(hdwp);
550}
#define SPLIT_WIDTH
Definition: window.h:269
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
WindowHandle _left_hwnd
Definition: window.h:324
WindowHandle _right_hwnd
Definition: window.h:325
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 SWP_NOACTIVATE
Definition: winuser.h:1245
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOZORDER
Definition: winuser.h:1250
HDWP WINAPI BeginDeferWindowPos(_In_ int)

Referenced by MDIShellBrowserChild::entry_selected(), and WndProc().

◆ set_url()

void ChildWindow::set_url ( LPCTSTR  url)
protected

Definition at line 567 of file window.cpp.

568{
569 if (_url != url) {
570 _url = url;
571
573 }
574}
#define PM_URL_CHANGED
Definition: window.h:391
String _url
Definition: window.h:333
LONG_PTR LPARAM
Definition: windef.h:208
#define SendMessage
Definition: winuser.h:5855

Referenced by MDIShellBrowserChild::entry_selected(), go_to(), WebChildWindow::NavigateComplete2(), FileChildWindow::set_curdir(), and WndProc().

◆ WndProc()

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

Reimplemented from Window.

Reimplemented in ShellBrowserChildT< ChildWindow >, IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >, ExtContextMenuHandlerT< ChildWindow >, and ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >.

Definition at line 388 of file window.cpp.

389{
390 switch(nmsg) {
391 case WM_PAINT: {
392 RECT rc;
393 PaintCanvas canvas(_hwnd);
394 ClientRect rt(_hwnd);
395 rt.left = _split_pos-SPLIT_WIDTH/2;
396 rt.right = _split_pos+SPLIT_WIDTH/2+1;
397 HBRUSH lastBrush = SelectBrush(canvas, GetStockBrush(COLOR_SPLITBAR));
398 Rectangle(canvas, rt.left, rt.top-1, rt.right, rt.bottom+1);
399 SetRect(&rc, rt.left, rt.top-1, rt.right, rt.bottom+1);
400 DrawEdge(canvas, &rc, EDGE_RAISED, BF_RECT);
401 SelectObject(canvas, lastBrush);
402 break;}
403
404 case WM_SETCURSOR:
405 if (LOWORD(lparam) == HTCLIENT) {
406 POINT pt;
408 ScreenToClient(_hwnd, &pt);
409
410 if (pt.x>=_split_pos-SPLIT_WIDTH/2 && pt.x<_split_pos+SPLIT_WIDTH/2+1) {
412 return TRUE;
413 }
414 }
415 goto def;
416
417 case WM_SIZE:
418 if (wparam != SIZE_MINIMIZED)
420 goto def;
421
422 case WM_GETMINMAXINFO:
423 DefMDIChildProc(_hwnd, nmsg, wparam, lparam);
424
426
427 lpmmi->ptMaxTrackSize.x <<= 1; // 2*GetSystemMetrics(SM_CXSCREEN) / SM_CXVIRTUALSCREEN
428 lpmmi->ptMaxTrackSize.y <<= 1; // 2*GetSystemMetrics(SM_CYSCREEN) / SM_CYVIRTUALSCREEN
429 break;}
430
431 case WM_LBUTTONDOWN: {
432 int x = GET_X_LPARAM(lparam);
433
434 ClientRect rt(_hwnd);
435
438 SetCapture(_hwnd);
439 }
440
441 break;}
442
443 case WM_LBUTTONUP:
444 if (GetCapture() == _hwnd)
446 break;
447
448 case WM_KEYDOWN:
449 if (wparam == VK_ESCAPE)
450 if (GetCapture() == _hwnd) {
452 ClientRect rt(_hwnd);
453 resize_children(rt.right, rt.bottom);
454 _last_split = -1;
457 }
458 break;
459
460 case WM_MOUSEMOVE:
461 if (GetCapture() == _hwnd) {
462 int x = GET_X_LPARAM(lparam);
463
464 ClientRect rt(_hwnd);
465
466 if (x>=0 && x<rt.right) {
467 _split_pos = x;
468 resize_children(rt.right, rt.bottom);
469 rt.left = x-SPLIT_WIDTH/2;
470 rt.right = x+SPLIT_WIDTH/2+1;
471 InvalidateRect(_hwnd, &rt, FALSE);
473 UpdateWindow(_hwnd);
475 }
476 }
477 break;
478
480 switch(LOWORD(wparam)) {
481 case ID_GO_BACK:
482 if (!_url_history.empty()) {
484
485 if (jump_to_int(url))
486 set_url(url);
487
489 }
490 break;
491
492 case ID_GO_FORWARD:
493 //@@
494 break;
495
496 case ID_GO_UP:
498 break;
499
500 case ID_GO_HOME:
501 //@@
502 break;
503
504 default:
505 return FALSE;
506 }
507 return TRUE;
508
509 case WM_MDIACTIVATE:
510 if ((HWND)lparam == _hwnd) {
513 }
514 break;
515
516 case PM_JUMP_TO_URL:
517 return go_to((LPCTSTR)lparam)? TRUE: FALSE;
518
519 default: def:
520 return DefMDIChildProc(_hwnd, nmsg, wparam, lparam);
521 }
522
523 return 0;
524}
@ lparam
Definition: SystemMenu.c:31
@ wparam
Definition: SystemMenu.c:30
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define pt(x, y)
Definition: drawing.c:79
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define ID_GO_UP
Definition: resource.h:210
#define ID_GO_HOME
Definition: resource.h:208
#define ID_GO_FORWARD
Definition: resource.h:207
#define ID_GO_BACK
Definition: resource.h:206
#define PM_SETSTATUSTEXT
Definition: window.h:340
#define PM_JUMP_TO_URL
Definition: window.h:390
#define COLOR_SPLITBAR
Definition: window.h:271
#define PM_DISPATCH_COMMAND
Definition: window.h:265
#define LOWORD(l)
Definition: pedump.c:82
#define DefMDIChildProc
Definition: ros2win.h:33
bool go_to(LPCTSTR url)
Definition: window.cpp:553
String _statusText
Definition: window.h:332
virtual void resize_children(int cx, int cy)
Definition: window.cpp:527
bool empty() const
Definition: _stack.h:82
reference top()
Definition: _stack.h:84
void pop()
Definition: _stack.h:87
POINT ptMaxTrackSize
Definition: winuser.h:3634
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define HIWORD(l)
Definition: typedefs.h:247
#define GetStockBrush(i)
Definition: windowsx.h:307
#define SelectBrush(hdc, hbr)
Definition: windowsx.h:515
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
#define WM_PAINT
Definition: winuser.h:1623
HWND WINAPI SetCapture(_In_ HWND hWnd)
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
#define WM_SIZE
Definition: winuser.h:1614
#define IDC_ARROW
Definition: winuser.h:687
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2722
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define WM_MOUSEMOVE
Definition: winuser.h:1778
HWND WINAPI GetCapture(void)
Definition: message.c:2881
#define SIZE_MINIMIZED
Definition: winuser.h:2509
#define WM_LBUTTONDOWN
Definition: winuser.h:1779
#define WM_MDIACTIVATE
Definition: winuser.h:1817
#define WM_GETMINMAXINFO
Definition: winuser.h:1643
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
BOOL WINAPI UpdateWindow(_In_ HWND)
#define HTCLIENT
Definition: winuser.h:2478
#define LoadCursor
Definition: winuser.h:5824
#define WM_LBUTTONUP
Definition: winuser.h:1780
#define WM_SETCURSOR
Definition: winuser.h:1639
struct tagMINMAXINFO * LPMINMAXINFO
#define WM_KEYDOWN
Definition: winuser.h:1718
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define BF_RECT
Definition: winuser.h:462
#define IDC_SIZEWE
Definition: winuser.h:694
#define VK_ESCAPE
Definition: winuser.h:2217
#define EDGE_RAISED
Definition: winuser.h:450
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
const CHAR * LPCTSTR
Definition: xmlstorage.h:193

Member Data Documentation

◆ _focus_pane

int ChildWindow::_focus_pane
protected

◆ _hwndFrame

HWND ChildWindow::_hwndFrame
protected

◆ _last_split

int ChildWindow::_last_split
protected

Definition at line 329 of file window.h.

Referenced by ChildWindow(), and WndProc().

◆ _left_hwnd

◆ _menu_info

MenuInfo* ChildWindow::_menu_info
protected

Definition at line 322 of file window.h.

◆ _right_hwnd

◆ _split_pos

int ChildWindow::_split_pos
protected

◆ _statusText

String ChildWindow::_statusText
protected

Definition at line 332 of file window.h.

Referenced by WebChildWindow::StatusTextChange(), and WndProc().

◆ _url

String ChildWindow::_url
protected

Definition at line 333 of file window.h.

Referenced by set_url(), MDIShellBrowserChild::WndProc(), and WndProc().

◆ _url_history

stack<String> ChildWindow::_url_history
protected

Definition at line 335 of file window.h.

Referenced by FileChildWindow::FileChildWindow(), go_to(), and WndProc().


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