dialog_helper::dialog_modeless Class Reference

#include <win32_dialog.h>

List of all members.

Public Member Functions

bool create (unsigned p_id, HWND p_parent, HINSTANCE p_instance=core_api::get_my_instance())

Protected Member Functions

virtual BOOL on_message (UINT msg, WPARAM wp, LPARAM lp)=0
 Standard windows message handler (DialogProc-style). Use get_wnd() to retrieve our dialog window handle.
 dialog_modeless ()
HWND get_wnd () const
virtual ~dialog_modeless ()


Detailed Description

This class is meant to be used with new/delete operators only. Destroying the window - outside create() / WM_INITDIALOG - will result in object calling delete this. If object is deleted directly using delete operator, WM_DESTROY handler may not be called so it should not be used (use destructor of derived class instead). Classes derived from dialog_modeless must not be instantiated in any other way than operator new().

Typical usage :
class mydialog : public dialog_helper::dialog_modeless {...}; (...) bool createmydialog() { mydialog * instance = new mydialog; if (instance == 0) return flase; if (!instance->create(...)) {delete instance; return false;} return true; }


Constructor & Destructor Documentation

dialog_helper::dialog_modeless::dialog_modeless (  )  [inline, protected]

virtual dialog_helper::dialog_modeless::~dialog_modeless (  )  [protected, virtual]


Member Function Documentation

bool dialog_helper::dialog_modeless::create ( unsigned  p_id,
HWND  p_parent,
HINSTANCE  p_instance = core_api::get_my_instance() 
)

Creates the dialog window. This will call on_message with WM_INITDIALOG. To abort creation, you can call DestroyWindow() on our window; it will not delete the object but make create() return false instead. You should not delete the object from inside WM_INITDIALOG handler or anything else possibly called from create().

Returns:
true on success, false on failure.

virtual BOOL dialog_helper::dialog_modeless::on_message ( UINT  msg,
WPARAM  wp,
LPARAM  lp 
) [protected, pure virtual]

Standard windows message handler (DialogProc-style). Use get_wnd() to retrieve our dialog window handle.

HWND dialog_helper::dialog_modeless::get_wnd (  )  const [inline, protected]


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

Generated on Fri Apr 18 13:56:58 2008 for foobar2000 SDK by  doxygen 1.5.5