ReactOS  0.4.12-dev-75-g00dd17e
Dialog Struct Reference

#include <window.h>

Inheritance diagram for Dialog:
Collaboration diagram for Dialog:

Public Types

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

 Dialog (HWND)
 
 ~Dialog ()
 
- 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 int DoModal (UINT nid, CREATORFUNC creator, HWND hwndParent=0)
 
static int DoModal (UINT nid, CREATORFUNC_INFO creator, const void *info, HWND hwndParent=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 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 ()
 

Protected Member Functions

LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
int Command (int id, int code)
 
- Protected Member Functions inherited from Window
virtual LRESULT Init (LPCREATESTRUCT pcs)
 
virtual int Notify (int id, NMHDR *pnmh)
 

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 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

The class Dialog implements modal dialogs. A Dialog object should be constructed by calling Dialog::DoModal() and specifying the class using the WINDOW_CREATOR() macro.

Definition at line 371 of file window.h.

Member Typedef Documentation

◆ super

Definition at line 373 of file window.h.

Constructor & Destructor Documentation

◆ Dialog()

Dialog::Dialog ( HWND  hwnd)

Definition at line 690 of file window.cpp.

691  : super(hwnd)
692 {
693  register_dialog(hwnd);
694 }
Window super
Definition: window.h:373
static void register_dialog(HWND hwnd)
Definition: window.cpp:609

◆ ~Dialog()

Dialog::~Dialog ( )

Definition at line 696 of file window.cpp.

697 {
698  unregister_dialog(_hwnd);
699 }
static void unregister_dialog(HWND hwnd)
Definition: window.cpp:614

Member Function Documentation

◆ Command()

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

Reimplemented from Window.

Reimplemented in PropSheetPageDlg.

Definition at line 765 of file window.cpp.

Referenced by FindProgramDlg::Command().

766 {
767  if (code == BN_CLICKED) {
768  EndDialog(_hwnd, id);
769  return 0; // message has been processed
770  }
771 
772  return 1;
773 }
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define BN_CLICKED
Definition: winuser.h:1886

◆ DoModal() [1/2]

int Dialog::DoModal ( UINT  nid,
CREATORFUNC  creator,
HWND  hwndParent = 0 
)
static
Todo:
call Window::pretranslate_msg()

Definition at line 701 of file window.cpp.

Referenced by TaskbarSettingsDlg::Command(), MainFrameBase::Command(), NotifyArea::Command(), StartMenuHandler::Command(), and explorer_about().

702 {
703  Lock lock(GetStaticWindowData()._create_crit_sect); // protect access to s_window_creator and s_new_info
704 
705  s_window_creator = creator;
706  s_new_info = NULL;
707 
709 
710  return DialogBoxParam(g_Globals._hInstance, MAKEINTRESOURCE(nid), hwndParent, DialogProc, 0/*lpParam*/);
711 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
rwlock_t lock
Definition: tcpcore.h:1163
NOTIFYICONDATA nid
Definition: magnifier.c:45
static StaticWindowData & GetStaticWindowData()
Definition: window.cpp:63
static CREATORFUNC s_window_creator
Definition: window.h:120
smooth NULL
Definition: ftsmooth.c:416
#define DialogBoxParam
Definition: winuser.h:5630
HINSTANCE _hInstance
Definition: globals.h:270
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
static const void * s_new_info
Definition: window.h:119
static INT_PTR CALLBACK DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:725

◆ DoModal() [2/2]

int Dialog::DoModal ( UINT  nid,
CREATORFUNC_INFO  creator,
const void info,
HWND  hwndParent = 0 
)
static
Todo:
call Window::pretranslate_msg()

Definition at line 713 of file window.cpp.

714 {
715  Lock lock(GetStaticWindowData()._create_crit_sect); // protect access to s_window_creator and s_new_info
716 
717  s_window_creator = (CREATORFUNC) creator;
718  s_new_info = NULL;
719 
721 
722  return DialogBoxParam(g_Globals._hInstance, MAKEINTRESOURCE(nid), hwndParent, DialogProc, 0/*lpParam*/);
723 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
rwlock_t lock
Definition: tcpcore.h:1163
NOTIFYICONDATA nid
Definition: magnifier.c:45
static StaticWindowData & GetStaticWindowData()
Definition: window.cpp:63
static CREATORFUNC s_window_creator
Definition: window.h:120
smooth NULL
Definition: ftsmooth.c:416
#define DialogBoxParam
Definition: winuser.h:5630
HINSTANCE _hInstance
Definition: globals.h:270
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
static const void * s_new_info
Definition: window.h:119
static INT_PTR CALLBACK DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:725
Window *(* CREATORFUNC)(HWND)
Definition: window.h:66

◆ WndProc()

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

Reimplemented from Window.

Reimplemented in OwnerDrawParent< PropSheetPageDlg >, OwnerDrawParent< Dialog >, CtlColorParent< OwnerDrawParent< Dialog > >, and ResizeController< Dialog >.

Definition at line 760 of file window.cpp.

Referenced by PropSheetPageDlg::DialogProc().

761 {
762  return FALSE; // message has not been processed
763 }

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