WinapiExtension
 All Classes Files Functions Variables Typedefs Pages
Public Member Functions | List of all members
IWindow Class Referenceabstract

Interface for common window functions. More...

#include <IWindow.h>

Inheritance diagram for IWindow:
Control Window Button ComboBox Edit ListBox ListView ProgressBar ScrollBar StaticCtrl StatusBar TabCtrl TreeView WindowModal

Public Member Functions

virtual HWND _InternalGetHandle ()=0
 
Rect ClientRect ()
 
void Destroy ()
 
void DragAcceptFiles (BOOL accept=TRUE)
 
void Enable (BOOL enable)
 
DWORD GetExStyle ()
 
HFONT GetFont ()
 
HICON GetIcon (BOOL bigIcon)
 
DWORD GetID ()
 
DWORD GetStyle ()
 
tstring GetText ()
 
BOOL Invalidate (const RECT *rect=NULL, BOOL eraseBkgnd=TRUE)
 
BOOL IsEnabled ()
 
BOOL IsVisible ()
 
void KillTimer (UINT_PTR timerID)
 
void ModifyStyle (DWORD add, DWORD remove)
 
void Move (int x, int y, BOOL redraw=TRUE)
 
void Move (const POINT &p, BOOL redraw=TRUE)
 
void Move (int x, int y, int width, int height, BOOL redraw=TRUE)
 
void Move (const POINT &p, const SIZE &s, BOOL redraw=TRUE)
 
void Move (const RECT &r, BOOL redraw=TRUE)
 
HWND ParentHandle ()
 
Rect RectOnParent ()
 
BOOL Redraw (const RECT *rect=NULL, HRGN region=NULL, UINT flags=RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE)
 
HWND SetFocus ()
 
void SetFont (HFONT font, BOOL redraw=TRUE)
 
HICON SetIcon (HICON icon, BOOL bigIcon)
 
void SetRedraw (BOOL allowRedraw)
 
void SetText (const tstring &text)
 
UINT_PTR SetTimer (UINT_PTR timerID, UINT interval, TIMERPROC proc=NULL)
 
BOOL Show (int cmdShow)
 
Rect WindowRect ()
 

Detailed Description

Interface for common window functions.

Window and Control are unrelated, but they share this interface.

Member Function Documentation

virtual HWND IWindow::_InternalGetHandle ( )
pure virtual

Subclasses must override this function to make this interface work.

Returns
Handle of the window that implements this interface.

Implemented in Window, and Control.

Rect IWindow::ClientRect ( )
inline
Returns
Client coordinates of the window. The topleft corner is always 0,0.
See Also
WindowRect(), RectOnParent()
void IWindow::Destroy ( )
inline

Destroys the window.

void IWindow::DragAcceptFiles ( BOOL  accept = TRUE)
inline

Enable the window to accept files from Windows Explorer.

void IWindow::Enable ( BOOL  enable)
inline
DWORD IWindow::GetExStyle ( )
inline
Returns
Extended style of the window.
HFONT IWindow::GetFont ( )
inline
HICON IWindow::GetIcon ( BOOL  bigIcon)
inline
Parameters
bigIconWhether the big or small icon of the window should be retrieved.
DWORD IWindow::GetID ( )
inline
Returns
Identifier of the window.
DWORD IWindow::GetStyle ( )
inline
Returns
Style of the window.
tstring IWindow::GetText ( )
inline
Returns
Title of the window.
BOOL IWindow::Invalidate ( const RECT *  rect = NULL,
BOOL  eraseBkgnd = TRUE 
)
inline
BOOL IWindow::IsEnabled ( )
inline
BOOL IWindow::IsVisible ( )
inline
void IWindow::KillTimer ( UINT_PTR  timerID)
inline

Stop a timer.

void IWindow::ModifyStyle ( DWORD  add,
DWORD  remove 
)
inline

Add or remove window styles.

Note
Not all styles can be modified after window creation. You can't remove WS_CHILD from a button, for example.
void IWindow::Move ( int  x,
int  y,
BOOL  redraw = TRUE 
)
inline
void IWindow::Move ( const POINT &  p,
BOOL  redraw = TRUE 
)
inline
void IWindow::Move ( int  x,
int  y,
int  width,
int  height,
BOOL  redraw = TRUE 
)
inline
void IWindow::Move ( const POINT &  p,
const SIZE &  s,
BOOL  redraw = TRUE 
)
inline
void IWindow::Move ( const RECT &  r,
BOOL  redraw = TRUE 
)
inline
HWND IWindow::ParentHandle ( )
inline
Returns
Handle of the parent window or NULL.
Rect IWindow::RectOnParent ( )
inline
Returns
Coordinates of the window relative to its parent window.
See Also
ClientRect(), WindowRect()
BOOL IWindow::Redraw ( const RECT *  rect = NULL,
HRGN  region = NULL,
UINT  flags = RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE 
)
inline
HWND IWindow::SetFocus ( )
inline
Returns
Previously focused window.
void IWindow::SetFont ( HFONT  font,
BOOL  redraw = TRUE 
)
inline
HICON IWindow::SetIcon ( HICON  icon,
BOOL  bigIcon 
)
inline
Parameters
iconThe new icon.
bigIconWhether the big or small icon of the window should be set.
Returns
Handle of the previous icon.
void IWindow::SetRedraw ( BOOL  allowRedraw)
inline

This function can be used to disable redrawing, e.g. while adding many items to a listbox.

void IWindow::SetText ( const tstring text)
inline

Set title of the window.

UINT_PTR IWindow::SetTimer ( UINT_PTR  timerID,
UINT  interval,
TIMERPROC  proc = NULL 
)
inline

Start a timer that periodically creates WM_TIMER messages.

BOOL IWindow::Show ( int  cmdShow)
inline
Rect IWindow::WindowRect ( )
inline
Returns
Screen coordinates of the window.
See Also
ClientRect(), RectOnParent()

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