foobar2000 SDK  2015-01-14
Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
dialog_helper::dialog_modeless_v2

#include <win32_dialog.h>

Protected Member Functions

virtual ~dialog_modeless_v2 ()
 
 __declspec (deprecated) explicit dialog_modeless_v2(unsigned p_id
 
HWND get_wnd () const
 
virtual BOOL on_message (UINT msg, WPARAM wp, LPARAM lp)
 

Static Protected Member Functions

static dialog_modeless_v2__unsafe__instance_from_window (HWND p_wnd)
 

Protected Attributes

HWND HINSTANCE p_instance = core_api::get_my_instance()
 
HWND p_parent
 
HWND HINSTANCE bool p_stealfocus = true)
 

Private Types

enum  { status_construction, status_lifetime, status_destruction_requested, status_destruction }
 

Private Member Functions

 dialog_modeless_v2 (const dialog_modeless_v2 &)
 
void detach_window ()
 
BOOL on_message_internal (UINT msg, WPARAM wp, LPARAM lp)
 
const dialog_modeless_v2operator= (const dialog_modeless_v2 &)
 

Static Private Member Functions

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

Private Attributes

enum dialog_helper::dialog_modeless_v2:: { ... }  m_status
 
const bool m_stealfocus
 
HWND m_wnd
 

Detailed Description

Definition at line 94 of file win32_dialog.h.

Member Enumeration Documentation

anonymous enum
private

Constructor & Destructor Documentation

dialog_helper::dialog_modeless_v2::~dialog_modeless_v2 ( )
protectedvirtual

Definition at line 207 of file win32_dialog.cpp.

208  {
209  bool is_window_being_destroyed = (m_status == status_destruction_requested);
211 
212  if (m_wnd != 0)
213  {
214  if (is_window_being_destroyed)
215  detach_window();
216  else
217  DestroyWindow(m_wnd);
218  }
219  }
enum dialog_helper::dialog_modeless_v2::@24 m_status
dialog_helper::dialog_modeless_v2::dialog_modeless_v2 ( const dialog_modeless_v2 )
private

Definition at line 201 of file win32_dialog.cpp.

202  {
203  WIN32_OP( CreateDialogParam(p_instance,MAKEINTRESOURCE(p_id),p_parent,DlgProc,reinterpret_cast<LPARAM>(this)) != NULL );
205  }
static INT_PTR CALLBACK DlgProc(HWND wnd, UINT msg, WPARAM wp, LPARAM lp)
enum dialog_helper::dialog_modeless_v2::@24 m_status
HWND HINSTANCE bool p_stealfocus
Definition: win32_dialog.h:97

Member Function Documentation

dialog_helper::dialog_modeless_v2::__declspec ( deprecated  )
protected
static dialog_modeless_v2* dialog_helper::dialog_modeless_v2::__unsafe__instance_from_window ( HWND  p_wnd)
inlinestaticprotected

Definition at line 102 of file win32_dialog.h.

102 {return reinterpret_cast<dialog_modeless_v2*>(GetWindowLongPtr(p_wnd,DWLP_USER));}
dialog_modeless_v2(const dialog_modeless_v2 &)
void dialog_helper::dialog_modeless_v2::detach_window ( )
private

Definition at line 248 of file win32_dialog.cpp.

249  {
250  if (m_wnd != 0)
251  {
252  SetWindowLongPtr(m_wnd,DWLP_USER,0);
253  m_wnd = 0;
254  }
255  }
INT_PTR CALLBACK dialog_helper::dialog_modeless_v2::DlgProc ( HWND  wnd,
UINT  msg,
WPARAM  wp,
LPARAM  lp 
)
staticprivate

Definition at line 221 of file win32_dialog.cpp.

222  {
223  dialog_modeless_v2 * thisptr;
224  BOOL rv = FALSE;
225  if (msg == WM_INITDIALOG)
226  {
227  thisptr = reinterpret_cast<dialog_modeless_v2*>(lp);
228  assert(thisptr->m_status == status_construction);
229  thisptr->m_wnd = wnd;
230  SetWindowLongPtr(wnd,DWLP_USER,lp);
231  if (GetWindowLong(wnd,GWL_STYLE) & WS_POPUP) {
233  }
234  }
235  else thisptr = reinterpret_cast<dialog_modeless_v2*>(GetWindowLongPtr(wnd,DWLP_USER));
236 
237  if (thisptr != NULL) rv = thisptr->on_message_internal(msg,wp,lp);
238 
239  if (msg == WM_DESTROY)
240  {
242  }
243 
244  return rv;
245  }
typedef BOOL(WINAPI *pPowerSetRequest_t)(__in HANDLE PowerRequest
static void g_add(HWND p_wnd)
Static helper; see add().
dialog_modeless_v2(const dialog_modeless_v2 &)
static void g_remove(HWND p_wnd)
Static helper; see remove().
HWND dialog_helper::dialog_modeless_v2::get_wnd ( ) const
inlineprotected

Definition at line 99 of file win32_dialog.h.

virtual BOOL dialog_helper::dialog_modeless_v2::on_message ( UINT  msg,
WPARAM  wp,
LPARAM  lp 
)
inlineprotectedvirtual

Definition at line 100 of file win32_dialog.h.

100 {return FALSE;}
BOOL dialog_helper::dialog_modeless_v2::on_message_internal ( UINT  msg,
WPARAM  wp,
LPARAM  lp 
)
private

Definition at line 258 of file win32_dialog.cpp.

259  {
261  {
262  if (msg == WM_DESTROY)
263  {
264  assert(m_status == status_lifetime);
266  delete this;
267  return TRUE;
268  }
269  else
270  return on_message(msg,wp,lp);
271  }
272  else if (m_status == status_construction)
273  {
274  if (msg == WM_INITDIALOG) return m_stealfocus ? TRUE : FALSE;
275  else return FALSE;
276  }
277  else return FALSE;
278  }
enum dialog_helper::dialog_modeless_v2::@24 m_status
virtual BOOL on_message(UINT msg, WPARAM wp, LPARAM lp)
Definition: win32_dialog.h:100
const dialog_modeless_v2& dialog_helper::dialog_modeless_v2::operator= ( const dialog_modeless_v2 )
private

Field Documentation

enum { ... } dialog_helper::dialog_modeless_v2::m_status
const bool dialog_helper::dialog_modeless_v2::m_stealfocus
private

Definition at line 109 of file win32_dialog.h.

HWND dialog_helper::dialog_modeless_v2::m_wnd
private

Definition at line 108 of file win32_dialog.h.

HWND HINSTANCE dialog_helper::dialog_modeless_v2::p_instance = core_api::get_my_instance()
protected

Definition at line 97 of file win32_dialog.h.

HWND dialog_helper::dialog_modeless_v2::p_parent
protected

Definition at line 97 of file win32_dialog.h.

HWND HINSTANCE bool dialog_helper::dialog_modeless_v2::p_stealfocus = true)
protected

Definition at line 97 of file win32_dialog.h.


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