foobar2000 SDK  2015-08-03
Public Member Functions | Private Attributes
cfgWindowSizeTracker

#include <WindowPositionUtils.h>

+ Inheritance diagram for cfgWindowSizeTracker:

Public Member Functions

 cfgWindowSizeTracker (cfgWindowSize &p_var)
 
bool Apply (HWND p_wnd)
 
BOOL ProcessWindowMessage (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult)
 

Private Attributes

bool m_applied
 
cfgWindowSizem_var
 

Detailed Description

Definition at line 66 of file WindowPositionUtils.h.

Constructor & Destructor Documentation

cfgWindowSizeTracker::cfgWindowSizeTracker ( cfgWindowSize p_var)
inline

Definition at line 68 of file WindowPositionUtils.h.

68 : m_var(p_var), m_applied(false) {}

Member Function Documentation

bool cfgWindowSizeTracker::Apply ( HWND  p_wnd)
inline

Definition at line 70 of file WindowPositionUtils.h.

70  {
71  bool retVal = false;
72  m_applied = false;
73  if (m_var.m_width != ~0 && m_var.m_height != ~0) {
74  CRect rect (0,0,m_var.m_width,m_var.m_height);
75  if (AdjustWindowRectHelper(p_wnd, rect)) {
76  SetWindowPos(p_wnd,NULL,0,0,rect.right-rect.left,rect.bottom-rect.top,SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER);
77  retVal = true;
78  }
79  }
80  m_applied = true;
81  return retVal;
82  }
static BOOL AdjustWindowRectHelper(CWindow wnd, CRect &rc)
BOOL cfgWindowSizeTracker::ProcessWindowMessage ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
LRESULT &  lResult 
)
inline

Definition at line 84 of file WindowPositionUtils.h.

84  {
85  if (uMsg == WM_SIZE && m_applied) {
86  if (lParam != 0) {
87  m_var.m_width = (short)LOWORD(lParam); m_var.m_height = (short)HIWORD(lParam);
88  }
89  }
90  return FALSE;
91  }

Field Documentation

bool cfgWindowSizeTracker::m_applied
private

Definition at line 94 of file WindowPositionUtils.h.

cfgWindowSize& cfgWindowSizeTracker::m_var
private

Definition at line 93 of file WindowPositionUtils.h.


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