foobar2000 SDK  2015-01-14
Public Member Functions | Data Fields | Protected Member Functions | Static Private Member Functions | Private Attributes
dialog_helper::dialog_modalabstract

#include <win32_dialog.h>

Public Member Functions

 __declspec (deprecated) int run(unsigned p_id
 

Data Fields

HWND HINSTANCE p_instance = core_api::get_my_instance())
 
HWND p_parent
 

Protected Member Functions

 dialog_modal ()
 
void end_dialog (int p_code)
 
HWND get_wnd () const
 
virtual BOOL on_message (UINT msg, WPARAM wp, LPARAM lp)=0
 

Static Private Member Functions

static INT_PTR CALLBACK DlgProc (HWND wnd, UINT msg, WPARAM wp, LPARAM lp)
 

Private Attributes

modal_dialog_scope m_modal_scope
 
HWND m_wnd
 

Detailed Description

This class is meant to be instantiated on-stack, as a local variable. Using new/delete operators instead or even making this a member of another object works, but does not make much sense because of the way this works (single run() call).

Definition at line 38 of file win32_dialog.h.

Constructor & Destructor Documentation

dialog_helper::dialog_modal::dialog_modal ( )
inlineprotected

Definition at line 45 of file win32_dialog.h.

Member Function Documentation

dialog_helper::dialog_modal::__declspec ( deprecated  )
INT_PTR CALLBACK dialog_helper::dialog_modal::DlgProc ( HWND  wnd,
UINT  msg,
WPARAM  wp,
LPARAM  lp 
)
staticprivate

Definition at line 84 of file win32_dialog.cpp.

85  {
86  dialog_modal * _this;
87  if (msg==WM_INITDIALOG)
88  {
89  _this = reinterpret_cast<dialog_modal*>(lp);
90  _this->m_wnd = wnd;
91  SetWindowLongPtr(wnd,DWLP_USER,lp);
92 
93  _this->m_modal_scope.initialize(wnd);
94  }
95  else _this = reinterpret_cast<dialog_modal*>(GetWindowLongPtr(wnd,DWLP_USER));
96 
97  assert(_this == 0 || _this->m_wnd == wnd);
98 
99  return _this ? _this->on_message(msg,wp,lp) : FALSE;
100  }
void dialog_helper::dialog_modal::end_dialog ( int  p_code)
protected

Definition at line 78 of file win32_dialog.cpp.

79  {
80  EndDialog(m_wnd,p_code);
81  }
HWND dialog_helper::dialog_modal::get_wnd ( ) const
inlineprotected

Definition at line 47 of file win32_dialog.h.

47 {return m_wnd;}
virtual BOOL dialog_helper::dialog_modal::on_message ( UINT  msg,
WPARAM  wp,
LPARAM  lp 
)
protectedpure virtual

Field Documentation

modal_dialog_scope dialog_helper::dialog_modal::m_modal_scope
private

Definition at line 52 of file win32_dialog.h.

HWND dialog_helper::dialog_modal::m_wnd
private

Definition at line 51 of file win32_dialog.h.

HWND HINSTANCE dialog_helper::dialog_modal::p_instance = core_api::get_my_instance())

Definition at line 41 of file win32_dialog.h.

HWND dialog_helper::dialog_modal::p_parent

Definition at line 41 of file win32_dialog.h.


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