OWLNext 6.32
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Friends
owl::TWindow Class Reference

#include <window.h>

Inheritance diagram for owl::TWindow:
owl::TEventHandler owl::TStreamableBase ocf::TOleWindow ocf::TPadWindow owl::TClipboardViewer owl::TControl owl::TDialog owl::TEdgeSlip owl::TFrameWindow owl::TGadgetWindow owl::THarbor owl::THostInfoWindow owl::TLayoutWindow owl::TMciHiddenWindow owl::TMDIClient owl::TPickListPopup owl::TPictureWindow owl::TPreviewPage owl::TPropertySheet owl::TServiceWindow owl::TSocketWindow owl::TTinyCaption owl::TTransferBufferWindowBase owl::TTransferWindow< TDataSource > owl::TWindowView

List of all members.

Public Types

typedef HWND THandle

Public Member Functions

void TraceWindowPlacement ()
 TWindow (TWindow *parent, LPCTSTR title=0, TModule *module=0)
 TWindow (TWindow *parent, const tstring &title, TModule *module=0)
 TWindow (HWND handle, TModule *module=0)
virtual ~TWindow ()
TApplicationGetApplication () const
virtual bool Register ()
TScrollerGetScroller ()
void SetScroller (TScroller *scroller)
virtual void CloseWindow (int retVal=0)
TWindowAttrGetWindowAttr ()
const TWindowAttrGetWindowAttr () const
LPCTSTR GetCaption () const
virtual void SetParent (TWindow *newParent)
virtual bool CanClose ()
void ChildBroadcastMessage (uint msg, TParam1 wParam=0, TParam2 lParam=0)
TResult HandleMessage (uint msg, TParam1 p1=0, TParam2 p2=0)
virtual TResult EvCommand (uint id, HWND hWndCtl, uint notifyCode)
virtual TResult EvNotify (uint id, TNotify &notifyInfo)
TResult DefaultProcessing ()
virtual void Paint (TDC &dc, bool erase, TRect &rect)
void SubclassWindowFunction ()
Two iterators that take function pointers
TWindowFirstThat (TCondFunc test, void *paramList=0) const
void ForEach (TActionFunc action, void *paramList=0)
Two iterators that take pointers to member functions
TWindowFirstThat (TCondMemFunc test, void *paramList=0)
void ForEach (TActionMemFunc action, void *paramList=0)
Other functions for iteration
TWindowNext ()
void SetNext (TWindow *next)
TWindowGetFirstChild ()
TWindowGetLastChild ()
TWindowPrevious ()
uint NumChildren () const
Query and set the Owl window flags.

Accepts TWindowFlag args, possibly or'd together.

void SetFlag (uint mask)
void ClearFlag (uint mask)
bool IsFlagSet (uint mask)
Sets/clears auto-create flag

It indicates that the TWindow should be created if a create is sent while in the parent's child list

void EnableAutoCreate ()
void DisableAutoCreate ()
Retrieves/assigns tooltip of/to window
virtual TTooltipGetTooltip () const
virtual void EnableTooltip (bool enable=true)
void SetTooltip (TTooltip *tooltip)
Sets/clears transfer flag

It indicates that the TWindow can/will transfer data via the transfer mechanism

void EnableTransfer ()
void DisableTransfer ()
Window's default module access functions
TModuleGetModule () const
void SetModule (TModule *module)
tstring LoadString (uint id) const
HBITMAP LoadBitmap (TResId id) const
HACCEL LoadAccelerators (TResId id) const
HMENU LoadMenu (TResId id) const
HCURSOR LoadCursor (TResId id) const
HICON LoadIcon (LPCTSTR name) const
Create/destroy an native window to be associated with this window
virtual bool Create ()
bool CreateChildren ()
virtual void Destroy (int retVal=0)
Create a modal window, and perform actual modal execute call
virtual int Execute ()
virtual int DoExecute ()
Attach or detach a window handle to a TWindow object.

Used when a child re-creates itself.

void AttachHandle (HWND handle)
void DetachHandle ()
Message preprocessing

Called from TApplication::ProcessAppMsg() to give the window an opportunity to perform preprocessing of the Windows message

virtual bool PreProcessMsg (MSG &msg)
virtual bool IdleAction (long idleCount)
virtual bool HoldFocusHWnd (HWND hLose, HWND hGain)
Child and parenting
int GetId () const
TWindowChildWithId (int id) const
Get this window's parent.

Either the handle of native window, or a pointer to the OWL object. May return different objects in some cases. Use H & O varieties to avoid change across version

HWND GetParentH () const
TWindowGetParentO () const
TWindowGetParent () const
Other attributes
virtual bool SetDocTitle (LPCTSTR docname, int index)
bool SetDocTitle (const tstring &docname, int index)
void SetCaption (LPCTSTR title)
void SetCaption (const tstring &title)
void SetCaption (uint resourceStringId)
bool SetCursor (TModule *module, TResId resId)
void SetBkgndColor (const TColor &color)
void SetAcceleratorTable (TResId resId)
Message forwarding

Forward the current event to "handle" using either PostMessage() or SendMessage(). Owl window version calls directly to window proc on send.

TResult ForwardMessage (HWND handle, bool send=true)
TResult ForwardMessage (bool send=true)
Notify a window (parent usually) of a child action.
void SendNotification (int id, int notifyCode, HWND hCtl, uint msg=WM_COMMAND)
void SendNotification (HWND receiver, int id, int notifyCode, HWND hCtl, uint msg=WM_COMMAND)
TResult SendNotification (int id, NMHDR &nmhdr, uint msg=WM_NOTIFY)
TResult SendNotification (HWND receiver, uint id, NMHDR &nmhdr, uint msg=WM_NOTIFY)
Windows message handlers

Virtual functions called to handle a message, and to deal with an unhandled message in a default way.

virtual TResult WindowProc (uint msg, TParam1 p1, TParam2 p2)
virtual TResult DefWindowProc (uint msg, TParam1 p1, TParam2 p2)
Called by WindowProc() to handle WM_COMMAND_ENABLE, & helper function
virtual void EvCommandEnable (TCommandEnabler &ce)
void RouteCommandEnable (HWND hInitCmdTarget, TCommandEnabler &ce)
Transfer buffer functionality
void SetTransferBuffer (void *transferBuffer, uint size)
template<class TBuffer >
void SetTransferBuffer (TBuffer *transferBuffer)
template<class TElement , uint Count>
void SetTransferBuffer (TElement(&transferBuffer)[Count])
void * GetTransferBuffer () const
uint GetTransferBufferSize () const
virtual uint Transfer (void *buffer, TTransferDirection direction)
virtual void TransferData (TTransferDirection direction)
Allow a TWindow& to be used as an HWND in Windows API calls
HWND GetHandle () const
 operator HWND () const
bool IsWindow () const
Window and class Words and Longs, window properties
long GetClassName (TCHAR *className, int maxCount) const
long GetClassLong (int index) const
long SetClassLong (int index, long newLong)
uint16 GetClassWord (int index) const
uint16 SetClassWord (int index, uint16 newWord)
LONG_PTR GetWindowLongPtr (int index) const
LONG_PTR SetWindowLongPtr (int index, LONG_PTR newLong)
long GetWindowLong (int index) const
long SetWindowLong (int index, long newLong)
uint16 GetWindowWord (int index) const
uint16 SetWindowWord (int index, uint16 newWord)
WNDPROC GetWindowProc () const
WNDPROC SetWindowProc (WNDPROC wndProc)
int EnumProps (PROPENUMPROC proc)
HANDLE GetProp (uint16 atom) const
HANDLE RemoveProp (uint16 atom) const
bool SetProp (uint16 atom, HANDLE data) const
HANDLE GetProp (LPCTSTR str) const
HANDLE GetProp (const tstring &str) const
HANDLE RemoveProp (LPCTSTR str) const
HANDLE RemoveProp (const tstring &str) const
bool SetProp (LPCTSTR str, HANDLE data) const
bool SetProp (const tstring &str, HANDLE data) const
Dual mode accessors.

Work with Attr and other members as well as the underlying window information

uint32 GetStyle () const
uint32 SetStyle (uint32 style)
uint32 GetExStyle () const
uint32 SetExStyle (uint32 style)
bool ModifyStyle (uint32 offBits, uint32 onBits, uint swpFlags=0)
bool ModifyExStyle (uint32 offBits, uint32 onBits, uint swpFlags=0)
Window placement(X,Y) and display
bool MoveWindow (int x, int y, int w, int h, bool repaint=false)
bool MoveWindow (const TRect &rect, bool repaint=false)
virtual bool ShowWindow (int cmdShow)
void ShowOwnedPopups (bool show)
bool IsWindowVisible () const
bool IsZoomed () const
bool IsIconic () const
int GetWindowTextLength () const
int GetWindowText (TCHAR *str, int maxCount) const
tstring GetWindowText () const
void SetWindowText (LPCTSTR str)
void SetWindowText (const tstring &str)
void SetWindowText (uint resourceStringId)
bool GetWindowPlacement (WINDOWPLACEMENT *place) const
bool SetWindowPlacement (const WINDOWPLACEMENT *place)
Window painting: invalidating, validating & updating
virtual void Invalidate (bool erase=true)
virtual void InvalidateRect (const TRect &rect, bool erase=true)
void InvalidateRgn (HRGN hRgn, bool erase=true)
void Validate ()
void ValidateRect (const TRect &rect)
void ValidateRgn (HRGN hRgn)
void UpdateWindow ()
bool FlashWindow (bool invert)
bool GetUpdateRect (TRect &rect, bool erase=true) const
int GetUpdateRgn (TRegion &rgn, bool erase=true) const
bool LockWindowUpdate (bool lock=true)
bool RedrawWindow (TRect *update, HRGN hUpdateRgn, uint redrawFlags=RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE)
Scrolling and scrollbars
int GetScrollPos (int bar) const
int SetScrollPos (int bar, int pos, bool redraw=true)
void GetScrollRange (int bar, int &minPos, int &maxPos) const
void SetScrollRange (int bar, int minPos, int maxPos, bool redraw=true)
void SetScrollPage (int bar, int page, bool redraw=true)
int GetScrollPage (int bar) const
bool EnableScrollBar (uint sbFlags=SB_BOTH, uint arrowFlags=ESB_ENABLE_BOTH)
void ShowScrollBar (int bar, bool show=true)
void ScrollWindow (int dx, int dy, const TRect *scroll=0, const TRect *clip=0)
void ScrollWindowEx (int dx, int dy, const TRect *scroll=0, const TRect *clip=0, HRGN hUpdateRgn=0, TRect *update=0, uint flags=0)
void SetScrollInfo (int bar, SCROLLINFO *scrollInfo, bool redraw=true)
void GetScrollInfo (int bar, SCROLLINFO *scrollInfo) const
Parent/child with Ids
int GetDlgCtrlID () const
HWND GetDlgItem (int childId) const
uint GetDlgItemInt (int childId, bool *translated=0, bool isSigned=true) const
void SetDlgItemInt (int childId, uint value, bool isSigned=true) const
int GetDlgItemText (int childId, TCHAR *text, int max) const
tstring GetDlgItemText (int childId) const
void SetDlgItemText (int childId, LPCTSTR text) const
void SetDlgItemText (int childId, const tstring &text) const
void SetDlgItemText (int childId, uint resourceStringId) const
uint IsDlgButtonChecked (int buttonId) const
bool IsChild (HWND hWnd) const
HWND GetNextDlgGroupItem (HWND hWndCtrl, bool previous=false) const
HWND GetNextDlgTabItem (HWND hWndCtrl, bool previous=false) const
void CheckDlgButton (int buttonId, uint check)
void CheckRadioButton (int firstButtonId, int lastButtonId, int checkButtonId)
Menus and menubar
HMENU GetMenu () const
HMENU GetSystemMenu (bool revert=false) const
bool SetMenu (HMENU hMenu)
bool HiliteMenuItem (HMENU hMenu, uint idItem, uint hilite)
void DrawMenuBar ()
Timer
bool KillTimer (UINT_PTR timerId)
UINT_PTR SetTimer (UINT_PTR timerId, uint timeout, TIMERPROC proc=0)
Hot keys
bool RegisterHotKey (int idHotKey, uint modifiers, uint virtKey)
bool UnregisterHotKey (int idHotKey)
Misc
bool WinHelp (LPCTSTR helpFile, uint command, uint32 data)
bool WinHelp (const tstring &helpFile, uint command, uint32 data)
void AssignContextMenu (TPopupMenu *menu)
TPopupMenuGetContextMenu () const
int MessageBox (LPCTSTR text, LPCTSTR caption=0, uint flags=MB_OK)
int MessageBox (const tstring &text, const tstring &caption=tstring(), uint flags=MB_OK)
int MessageBox (uint resId, LPCTSTR caption=0, uint flags=MB_OK)
int MessageBox (uint resId, const tstring &caption, uint flags=MB_OK)
int FormatMessageBox (LPCTSTR text, LPCTSTR caption, uint flags, va_list argp)
int FormatMessageBox (LPCTSTR text, LPCTSTR caption, uint flags,...)
int FormatMessageBox (const tstring &text, const tstring &caption, uint flags, va_list argp)
int FormatMessageBox (const tstring &text, const tstring &caption, uint flags,...)
int FormatMessageBox (uint resId, LPCTSTR caption, uint flags, va_list argp)
int FormatMessageBox (uint resId, LPCTSTR caption=0, uint flags=MB_OK,...)
int FormatMessageBox (uint resId, const tstring &caption, uint flags, va_list argp)
int FormatMessageBox (uint resId, const tstring &caption, uint flags=MB_OK,...)
HTASK GetWindowTask () const
void DragAcceptFiles (bool accept)
TCurrentEventGetCurrentEvent ()
void SethAccel (HACCEL)

Protected Types

typedef void TPerformCreateReturnType
typedef LPCTSTR TGetClassNameReturnType

Protected Member Functions

 TWindow ()
void Init (TWindow *parent, LPCTSTR title, TModule *module)
void Init (TWindow *parent, const tstring &title, TModule *module)
void Init (HWND hWnd, TModule *module)
virtual TPerformCreateReturnType PerformCreate (int deprecated_argument=0)
void SetHandle (THandle)
TPerformCreateReturnType SetOrReturnHandle (THandle)
void GetHWndState (bool forceStyleSync=false)
void GetWindowTextTitle ()
virtual void GetWindowClass (WNDCLASS &wndClass)
virtual TGetClassNameReturnType GetClassName ()
void PerformSetupAndTransfer ()
virtual void SetupWindow ()
virtual void CleanupWindow ()
void DispatchScroll (uint scrollCode, uint thumbPos, HWND hWndCtrl)
void LoadAcceleratorTable ()
virtual void RemoveChild (TWindow *child)
TWindowGetWindowPtr (HWND hWnd) const
These events are processed by TWindow
void EvClose ()
int EvCreate (CREATESTRUCT &createStruct)
void EvDestroy ()
TResult EvCompareItem (uint ctrlId, COMPAREITEMSTRUCT &compareInfo)
void EvDeleteItem (uint ctrlId, DELETEITEMSTRUCT &deleteInfo)
void EvDrawItem (uint ctrlId, DRAWITEMSTRUCT &drawInfo)
void EvMeasureItem (uint ctrlId, MEASUREITEMSTRUCT &measureInfo)
void EvHScroll (uint scrollCode, uint thumbPos, HWND hWndCtl)
void EvVScroll (uint scrollCode, uint thumbPos, HWND hWndCtl)
void EvMove (TPoint &clientOrigin)
void EvNCDestroy ()
bool EvQueryEndSession ()
void EvSize (uint sizeType, TSize &size)
void EvLButtonDown (uint modKeys, TPoint &point)
bool EvEraseBkgnd (HDC)
void EvPaint ()
void EvSysColorChange ()
TResult EvWin32CtlColor (TParam1, TParam2)
Input validation message handler
void EvChildInvalid (HWND hWnd)
System messages
void EvCommNotify (uint commId, uint status)
void EvCompacting (uint compactRatio)
void EvDevModeChange (TCHAR *devName)
void EvEnable (bool enabled)
void EvEndSession (bool endSession, bool logOff)
void EvFontChange ()
int EvPower (uint powerEvent)
void EvSysCommand (uint cmdType, TPoint &point)
void EvSystemError (uint error)
void EvTimeChange ()
void EvTimer (uint timerId)
void EvWinIniChange (TCHAR *section)
Window manager messages
void EvActivate (uint active, bool minimized, HWND hWndOther)
void EvActivateApp (bool active, HTASK hTask)
void EvCancelMode ()
void EvGetMinMaxInfo (MINMAXINFO &minmaxinfo)
void EvGetText (uint buffSize, TCHAR *buff)
uint EvGetTextLength ()
void EvIconEraseBkgnd (HDC hDC)
void EvKillFocus (HWND hWndGetFocus)
uint EvMouseActivate (HWND hTopLevel, uint hitCode, uint msg)
The following are called under Win32 only
void EvInputFocus (bool gainingFocus)
void EvOtherWindowCreated (HWND hWndOther)
void EvOtherWindowDestroyed (HWND hWndOther)
void EvPaintIcon ()
void EvHotKey (int idHotKey)
TResult EvCopyData (HWND hwnd, COPYDATASTRUCT *dataStruct)
void EvNextDlgCtl (uint hctlOrDir, uint isHCtl)
void EvParentNotify (uint event, uint childHandleOrX, uint childIDOrY)
HANDLE EvQueryDragIcon ()
bool EvQueryOpen ()
void EvQueueSync ()
bool EvSetCursor (HWND hWndCursor, uint hitTest, uint mouseMsg)
void EvSetFocus (HWND hWndLostFocus)
HFONT EvGetFont ()
void EvSetFont (HFONT hFont, bool redraw)
void EvSetRedraw (bool redraw)
void EvSetText (LPCTSTR text)
void EvShowWindow (bool show, uint status)
void EvWindowPosChanged (WINDOWPOS &windowPos)
void EvWindowPosChanging (WINDOWPOS &windowPos)
Controls
HBRUSH EvCtlColor (HDC hDC, HWND hWndChild, uint ctlType)
Keyboard input
void EvChar (uint key, uint repeatCount, uint flags)
void EvDeadChar (uint deadKey, uint repeatCount, uint flags)
void EvKeyDown (uint key, uint repeatCount, uint flags)
void EvKeyUp (uint key, uint repeatCount, uint flags)
void EvSysChar (uint key, uint repeatCount, uint flags)
void EvSysDeadChar (uint key, uint repeatCount, uint flags)
void EvSysKeyDown (uint key, uint repeatCount, uint flags)
void EvSysKeyUp (uint key, uint repeatCount, uint flags)
Mouse input
void EvLButtonDblClk (uint modKeys, TPoint &point)
void EvLButtonUp (uint modKeys, TPoint &point)
void EvMButtonDblClk (uint modKeys, TPoint &point)
void EvMButtonDown (uint modKeys, TPoint &point)
void EvMButtonUp (uint modKeys, TPoint &point)
void EvMouseMove (uint modKeys, TPoint &point)
bool EvMouseWheel (uint modKeys, int zDelta, TPoint &point)
void EvRButtonDblClk (uint modKeys, TPoint &point)
void EvRButtonDown (uint modKeys, TPoint &point)
void EvRButtonUp (uint modKeys, TPoint &point)
TResult EvRegisteredMouseWheel (TParam1, TParam2)
Menu related messages
void EvInitMenu (HMENU hMenu)
void EvInitMenuPopup (HMENU hPopupMenu, uint index, bool sysMenu)
int32 EvMenuChar (uint nChar, uint menuType, HMENU hMenu)
void EvMenuSelect (uint menuItemId, uint flags, HMENU hMenu)
void EvContextMenu (HWND childHwnd, int x, int y)
Dialog [Menu] messages
uint EvGetDlgCode (MSG *msg)
void EvEnterIdle (uint source, HWND hWndDlg)
Print manager messages
void EvSpoolerStatus (uint jobStatus, uint jobsLeft)
Clipboard messages
void EvAskCBFormatName (uint bufLen, TCHAR *buffer)
void EvChangeCBChain (HWND hWndRemoved, HWND hWndNext)
void EvDrawClipboard ()
void EvDestroyClipboard ()
void EvHScrollClipboard (HWND hCBViewer, uint scrollCode, uint pos)
void EvPaintClipboard (HWND hWnd, HANDLE hPaintStruct)
void EvRenderAllFormats ()
void EvRenderFormat (uint dataFormat)
void EvSizeClipboard (HWND hWndViewer, HANDLE hRect)
void EvVScrollClipboard (HWND hCBViewer, uint scrollCode, uint pos)
Palette manager messages
void EvPaletteChanged (HWND hWndPalChg)
void EvPaletteIsChanging (HWND hWndPalChg)
bool EvQueryNewPalette ()
Drag-n-drop messages
void EvDropFiles (TDropInfo dropInfo)
List box messages
int EvCharToItem (uint key, HWND hWndListBox, uint caretPos)
int EvVKeyToItem (uint key, HWND hWndListBox, uint caretPos)
Non-client messages
bool EvNCActivate (bool active)
uint EvNCCalcSize (bool calcValidRects, NCCALCSIZE_PARAMS &params)
bool EvNCCreate (CREATESTRUCT &createStruct)
uint EvNCHitTest (TPoint &point)
void EvNCLButtonDblClk (uint hitTest, TPoint &point)
void EvNCLButtonDown (uint hitTest, TPoint &point)
void EvNCLButtonUp (uint hitTest, TPoint &point)
void EvNCMButtonDblClk (uint hitTest, TPoint &point)
void EvNCMButtonDown (uint hitTest, TPoint &point)
void EvNCMButtonUp (uint hitTest, TPoint &point)
void EvNCMouseMove (uint hitTest, TPoint &point)
void EvNCPaint (HRGN)
void EvNCRButtonDblClk (uint hitTest, TPoint &point)
void EvNCRButtonDown (uint hitTest, TPoint &point)
void EvNCRButtonUp (uint hitTest, TPoint &point)
Icon messages
Todo:
There is no implementation for these functions
HICON EvGetIcon (bool largeIcon)
HICON EvSetIcon (bool largeIcon, HICON icon)

Static Protected Member Functions

Callback procs for hooking TWindow to native window
static TResult CALLBACK InitWndProc (HWND, uint, TParam1, TParam2)

Friends

void * GetMessageReceiverMemberFunctionAddress ()

Unconditionally shut down a given window.

Destroy() is called to destroy the Handle, & then the window is deleted. Non-static version is safe as long as it is inline and not called on itself

void ShutDownWindow (int retVal=0)
static void ShutDownWindow (TWindow *win, int retVal=0)

Messages

TResult SendMessage (uint msg, TParam1 p1=0, TParam2 p2=0) const
TResult SendDlgItemMessage (int childId, uint msg, TParam1 p1=0, TParam2 p2=0)
bool PostMessage (uint msg, TParam1 p1=0, TParam2 p2=0)
HWND SetCapture ()
HWND SetFocus ()
bool IsWindowEnabled () const
virtual bool EnableWindow (bool enable)
void SetRedraw (bool redraw)
static HWND GetCapture ()
static void ReleaseCapture ()
static HWND GetFocus ()

Window coordinates, dimensions...

void ScreenToClient (TPoint &point) const
void MapWindowPoints (HWND hWndTo, TPoint *pts, int count) const
void GetClientRect (TRect &rect) const
TRect GetClientRect () const
HWND ChildWindowFromPoint (const TPoint &point) const
void ClientToScreen (TPoint &point) const
void GetWindowRect (TRect &rect) const
TRect GetWindowRect () const
static HWND WindowFromPoint (const TPoint &point)
static void AdjustWindowRect (TRect &rect, uint32 style, bool menu)
static void AdjustWindowRectEx (TRect &rect, uint32 style, bool menu, uint32 exStyle)

Window positioning(Z), sibling relationships

void BringWindowToTop ()
HWND SetActiveWindow ()
HWND GetLastActivePopup () const
HWND GetNextWindow (uint dirFlag) const
HWND GetTopWindow () const
HWND GetWindow (uint cmd) const
bool SetWindowPos (HWND hWndInsertAfter, const TRect &rect, uint flags)
bool SetWindowPos (HWND hWndInsertAfter, int x, int y, int w, int h, uint flags)
static HWND GetActiveWindow ()
static HWND GetDesktopWindow ()

Caret, cursor, font

void CreateCaret (HBITMAP hBitmap)
void CreateCaret (bool isGray, int width, int height)
void HideCaret ()
void ShowCaret ()
void SetWindowFont (HFONT font, bool redraw)
HFONT GetWindowFont ()
static uint GetCaretBlinkTime ()
static void GetCaretPos (TPoint &point)
static void SetCaretBlinkTime (uint16 milliSecs)
static void SetCaretPos (int x, int y)
static void SetCaretPos (const TPoint &pos)
static void DestroyCaret ()
static void GetCursorPos (TPoint &pos)

Detailed Description

TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encapsulates many functions that control window behavior and specify window creation and registration attributes.

TWindow is a generic window that can be resized and moved. You can construct an instance of TWindow, though normally you use TWindow as a base for your specialized window classes. In general, to associate and disassociate a TWindow object with a window element, you need to follow these steps:

The ObjectWindows destroy process consists of two parts: (1) call Destroy to destroy the interface element and (2) then delete the C++ object. However, it is perfectly valid to call Destroy on the interface element without deleting the C++ object and then to call Create at a later time to re-create the window. Because it is also valid to construct a C++ window object on the stack or as an aggregated member, the Destroy function cannot assume it should delete the C++ object.

The user-generated WM_CLOSE event handler, EvClose, also causes a C++ object to be deleted by passing the this pointer to the application. The C++ object is deleted automatically because the EvClose event frequently occurs in response to a user action, and this is the most convenient place for the deletion to take place. Later, when it's safe to do so, the application then deletes the window pointer. Because the stack often contains selectors that refer to the addresses of objects that may become invalid during the delete process, it is not safe to delete the this pointer while events are still being processed. If the addresses become invalid, they could cause trouble when they are reloaded from the stack.

TWindow is the base class for all window classes, including TFrameWindow, TControl, TDialog, and TMDIChild. The ObjectWindows hierarchy diagram shows the many classes that are derived from TWindow.


Member Typedef Documentation

typedef HWND owl::TWindow::THandle

TWindow encapsulates an HWND.

typedef void owl::TWindow::TPerformCreateReturnType [protected]

For code safety and 64-bit compatibility the old parameter to PerformCreate has been deprecated. In the strict build mode, the parameter is no longer used, and the signature of PerformCreate has been changed to force a compilation error for legacy code. This is achieved by changing the return type but leaving the old parameter in place, although now unused.


Constructor & Destructor Documentation

owl::TWindow::TWindow ( TWindow parent,
LPCTSTR  title = 0,
TModule module = 0 
)

Adds this to the child list of parent if nonzero, and calls EnableAutoCreate so that this will be created and displayed along with parent. Also sets the title of the window and initializes the window's creation attributes.

The following paragraphs describe procedures common to both constructor syntaxes. module specifies the application or DLL that owns the TWindow instance. ObjectWindows needs the correct value of module to find needed resources. If module is 0, TWindow sets its module according to the following rules:

  • If the window has a parent, the parent's module is used.
  • If the TWindow constructor is invoked from an application, the module is set to the application.
  • If the TWindow constructor is invoked from a DLL that is dynamically linked with the ObjectWindows DLL and the currently running application is linked the same way, the module is set to the currently running application.
  • If the TWindow constructor is invoked from a DLL that is statically linked with the ObjectWindows library or the invoking DLL is dynamically linked with ObjectWindows DLL but the currently running application is not, no default is used for setting the module. Instead, a TXInvalidModule exception is thrown and the object is not created.

References Init().

owl::TWindow::TWindow ( TWindow parent,
const tstring &  title,
TModule module = 0 
)

String-aware overload.

References Init().

owl::TWindow::TWindow ( HWND  handle,
TModule module = 0 
)

Constructs a TWindow that is used as an alias for a non-ObjectWindows window, and sets wfAlias. Because the HWND is already available, this constructor, unlike the other TWindow constructor, performs the "thunking" and extraction of HWND information instead of waiting until the function Create creates the interface element.

The following paragraphs describe procedures common to both constructor syntaxes. module specifies the application or DLL that owns the TWindow instance. ObjectWindows needs the correct value of module to find needed resources. If module is 0, TWindow sets its module according to the following rules:

  • If the window has a parent, the parent's module is used.
  • If the TWindow constructor is invoked from an application, the module is set to the application.
  • If the TWindow constructor is invoked from a DLL that is dynamically linked with the ObjectWindows DLL and the currently running application is linked the same way, the module is set to the currently running application.
  • If the TWindow constructor is invoked from a DLL that is statically linked with the ObjectWindows library or the invoking DLL is dynamically linked with ObjectWindows DLL but the currently running application is not, no default is used for setting the module. Instead, a TXInvalidModule exception is thrown and the object is not created.

References Init().

owl::TWindow::~TWindow ( ) [virtual]

Destroys a still-associated interface element by calling Destroy. Deletes the window objects in the child list, then removes this from the parent window's child list. Deletes the Scroller if it is nonzero. Frees the cursor, if any exists, and the object instance (thunk). Destroys a still-associated Handle and frees the instance window proc used for linking the TWindow to the Handle.

References DefWindowProc(), Destroy(), ForEach(), GetApplication(), GetHandle(), owl::TResIdT< T >::GetString(), IsFlagSet(), owl::TResIdT< T >::IsString(), owl::TWindowAttr::Menu, RemoveChild(), SetCaption(), SetCursor(), SetScroller(), owl::TApplication::Uncondemn(), owl::wfAlias, and owl::wfMainWindow.

owl::TWindow::TWindow ( ) [protected]

Protected constructor for use by immediate virtually derived classes. Immediate derivitives must call an Init() before constructions are done.


Member Function Documentation

void owl::TWindow::AdjustWindowRect ( TRect rect,
uint32  style,
bool  menu 
) [inline, static]

Calculates the size of the window rectangle according to the indicated client-rectangle size. rect refers to the structure that contains the client rectangle's coordinates. style specifies the style of the window. menu is true if the window has a menu.

Note:
Wrapper for Windows API.
void owl::TWindow::AdjustWindowRectEx ( TRect rect,
uint32  style,
bool  menu,
uint32  exStyle 
) [inline, static]

Calculates the size of a window rectangle that has an extended style. TRect refers to the class that contains the client rectangle's coordinates. style specifies the window styles of the window to be adjusted. menu returns true if the window has a menu. exStyle indicates the extended styles to be used for the window. Extended styles include the following styles:

  • WS_EX_ACCEPTFILES The window can make use of drag and drop files.
  • WS_EX_DLGMODALFRAME The window has a double border that can be created with a title bar if the WS_CAPTION style flag is specified.
  • WS_EX_NOPARENTNOTIFY The child window created from this style does not send parent notify messages to the parent window when the child is created or destroyed.
  • WS_EX_TOPMOST A window having this style is placed above windows that are not topmost and remains above the non-topmost windows even when it's deactivated.
  • WS_EX_TRANSPARENT A window having this style is transparent, that is, any windows beneath this window are not concealed by this window.
Note:
Wrapper for Windows API.
void owl::TWindow::AssignContextMenu ( TPopupMenu popupMenu)

Associates a pop-up menu with the window so that it can automatically handle a WM_CONTEXTMENU message.

void owl::TWindow::BringWindowToTop ( ) [inline]

Brings a pop-up or child window to the top of the stack of overlapping windows and activates it.

Note:
Wrapper for Windows API.

References GetHandle().

bool owl::TWindow::CanClose ( ) [virtual]

Use this function to determine if it is okay to close a window. Returns true if the associated interface element can be closed. Calls the CanClose member function of each of its child windows. Returns false if any of the CanClose calls returns false. In your application's main window, you can override TWindow's CanClose and call TWindow::MessageBox to display a YESNOCANCEL message prompting the user as follows:

  • YES Save the data
  • NO Do not save the data, but close the window
  • CANCEL Cancel the close operation and return to the edit window

The following example shows how to write a CanClose function that displays a message box asking if the user wants to save a drawing that has changed. To save time, CanClose uses the IsDirty flag to see if the drawing has changed. If so, CanClose queries the user before closing the window.

 bool TMyWindow::CanClose()
 { 
   if (IsDirty)
     switch(MessageBox("Do you want to save?", "Drawing has changed.",
                       MB_YESNOCANCEL | MB_ICONQUESTION)) { 
       case IDCANCEL:
         // Choosing Cancel means to abort the close -- return false.
         return false;
 
       case IDYES:
         // Choosing Yes means to save the drawing.
         CmFileSave();
     }
   return true;
 }

Reimplemented in owl::TTreeViewCtrlView, owl::TListViewCtrlView, owl::TWindowView, owl::TDialogView, owl::TEdit, owl::TEditFile, owl::TEditView, owl::TListBoxView, owl::TPaneSplitterView, owl::TRichEditView, owl::TTabbedView, owl::TTraceWindow, ocf::TOleView, and ocf::TOleWindow.

References FirstThat().

void owl::TWindow::CheckDlgButton ( int  buttonId,
uint  check 
) [inline]

Places a check mark in (or removes a check mark from) the button specified in buttonId. If check is nonzero, the check mark is placed next to the button; if 0, the check mark is removed. For buttons having three states, check can be 0 (clear), 1 (checked), or 2 (gray).

Note:
Wrapper for Windows API.

Reimplemented in owl::TTransferWindow< TDataSource >.

References GetHandle().

void owl::TWindow::CheckRadioButton ( int  firstButtonId,
int  lastButtonId,
int  checkButtonId 
) [inline]

Checks the radio button specified by checkButtonId and removes the check mark from the other radio buttons in the group. firstButtonId and lastButtonId specify the first and last buttons, respectively, in the group.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::ChildBroadcastMessage ( uint  msg,
TParam1  param1 = 0,
TParam2  param2 = 0 
)

Sends the specified message to all immediate children using SendMessage.

Note:
Includes non-object windows

References GetWindow(), and SendMessage().

HWND owl::TWindow::ChildWindowFromPoint ( const TPoint point) const [inline]

Determines which of the child windows contains the point specified in TPoint. Returns a handle to the window that contains the point, or 0 if the point lies outside the parent window.

Note:
Wrapper for Windows API.

References GetHandle().

TWindow * owl::TWindow::ChildWithId ( int  id) const

Returns a pointer to the window in the child window list that has the supplied id. Returns 0 if no child window has the indicated id.

References FirstThat().

void owl::TWindow::CleanupWindow ( ) [protected, virtual]

Always called immediately before the HWindow becomes invalid, CleanupWindow gives derived classes an opportunity to clean up HWND related resources. This function is the complement to SetupWindow.

Override this function in your derived class to handle window cleanup. Derived classes should call the base class's version of CleanupWindow as the last step before returning. The following example from the sample program, APPWIN.CPP, illustrates this process:

 //Tell windows that we are not accepting drag and drop transactions any more and
 //perform other window cleanup.
 void
 TAppWindow::CleanupWindow()
 { 
   AppLauncherCleanup();
   DragAcceptFiles(false);
   TWindow::CleanupWindow();
 }

Reimplemented in owl::TComboBox, owl::TDecoratedFrame, owl::TFrameWindow, owl::TGadgetWindow, owl::TMemComboBox, owl::TPaneSplitter, owl::TPropertySheet, owl::TSplashWindow, owl::TTraceWindow, ocf::TOleFrame, ocf::TOleView, and ocf::TOleWindow.

void owl::TWindow::ClearFlag ( uint  mask) [inline]

Clears the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer, and so on) in the Flags member.

void owl::TWindow::ClientToScreen ( TPoint point) const [inline]

Converts the client coordinates specified in point to screen coordinates for the new window.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::CloseWindow ( int  retVal = 0) [virtual]

Determines if it is okay to close a window before actually closing the window. If this is the main window of the application, calls GetApplication->CanClose. Otherwise, calls this->CanClose to determine whether the window can be closed. After determining that it is okay to close the window, CloseWindow calls Destroy to destroy the HWND.

Reimplemented in owl::TDialog.

References CanClose(), owl::TApplication::CanClose(), Destroy(), GetApplication(), IsFlagSet(), and owl::wfMainWindow.

bool owl::TWindow::Create ( ) [virtual]

Creates the window interface element to be associated with this ObjectWindows interface element. Specifically, Create performs the following window creation tasks:

  • 1. If the HWND already exists, Create returns true. (It is perfectly valid to call Create even if the window currently exists.)
  • 2. If the wfFromResource flag is set, then Create grabs the HWND based on the window ID. Otherwise, Create registers the window, sets up the window thunk, loads accelerators and menus, and calls PerformCreate in the derived class to create the HWND.
  • 3. If class registration fails for the window, Create calls TXWindow with IDS_CLASSREGISTERFAIL. If the window creation fails, Create calls TXWindow with IDS_WINDOWCREATEFAIL.
  • 4. If the window is created for a predefined Window class (for example, a button or dialog class) registered outside of ObjectWindows, then ObjectWindows thunks the window so that it can intercept messages and obtains the state of the window (the window's attributes) from the HWND.
Note:
Since this member function now throws an exception on error, it always returns true.

Reimplemented in owl::TDialog, owl::TEditView, owl::TGadgetWindow, owl::TListBoxView, owl::TMDIClient, owl::TPropertyPage, owl::TPropertySheet, owl::TRichEditView, owl::TSplashWindow, and owl::TTabbedWindow.

References DisableAutoCreate(), GetClassName(), GetDlgItem(), GetHandle(), GetHWndState(), GetModule(), GetWindowPtr(), GetWindowTextTitle(), owl::TWindowAttr::Id, InitWndProc(), IsFlagSet(), LoadAcceleratorTable(), ModifyExStyle(), PerformCreate(), PerformSetupAndTransfer(), owl::TXWindow::Raise(), Register(), SendMessage(), SetCaption(), SetFlag(), SetHandle(), owl::TWindowAttr::Style, SubclassWindowFunction(), owl::wfFromResource, owl::wfMainWindow, and owl::wfPredefinedClass.

void owl::TWindow::CreateCaret ( HBITMAP  hBitmap) [inline]

Creates a new caret for the system. HBITMAP specifies the bitmapped caret shape.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::CreateCaret ( bool  isGray,
int  width,
int  height 
) [inline]

Create a new caret for the system with the specified shape, bitmap shade, width, and height. If width or height is 0, the corresponding system-defined border size is used.

Note:
Wrapper for Windows API.

References CreateCaret(), and GetHandle().

bool owl::TWindow::CreateChildren ( )

Creates the child windows in the child list whose auto-create flags (with wfAutoCreate mask) are set. If all of the child windows are created successfully, CreateChildren returns true.

Note:
Throws an exception (TXWindow) if a child object could not be created.

References FirstThat(), GetHandle(), NumChildren(), owl::TXWindow::Raise(), and SetWindowPos().

TResult owl::TWindow::DefaultProcessing ( )

Handles default processing of events, which includes continued processing of menu/accelerators commands and enablers, as well as notifications Serves as a general-purpose default processing function that handles a variety of messages. After being created and before calling DefaultProcessing, however, a window completes the following sequence of events (illustrated in the Default Message-Processing Flowchart).

  • If the window is already created, SubclassWindow is used to install StdWndProc in place of the window's current procedure. The previous window procedure is saved in DefaultProc.
  • If the window has not been created, InitWndProc is set up as the window proc in the class. Then, when the window first receives a message, InitWndProc calls GetThunk to get the window's instance thunk (created by the constructor by calling CreateInstanceThunk). InitWndProc then switches the message-receiving capability from the window's procedure to StdWndProc. After this point, StdWndProc responds to incoming messages by calling the window's virtual WindowProc to process the messages. ObjectWindows uses the special registered message ::GetWindowPtrMsgId to get the this pointer of an HWND. StdWndProc responds to this message by returning the this pointer obtained from the thunk.

If the incoming message is not a command or command enable message, WindowProc immediately searches the window's response table for a matching entry. If the incoming message is a command or command enable message, WindowProc calls EvCommand or EvCommandEnable. EvCommand and EvCommandEnable begin searching for a matching entry in the focus window's response table. If an entry is found, the corresponding function is dispatched; otherwise ObjectWindows calls DefaultProcessing to finish the recursive walk back up the parent chain, searching for a match until the receiving window (the window that initially received the message) is reached. At this point, one of the following actions occurs:

  • If there is still no match and this is the MainWindow of the application, the window searches the application's response table.
  • If there are no matches and this is a command, DefWindowProc is called.
  • If this is a CommandEnable message, no further action is taken.
  • If this is not a command, and if a response table entry exists for the window, WindowProc dispatches the corresponding EvXxxx function to handle the message.
  • If this is the application's MainWindow, and the message is designed for the application, the message is forwarded to the application.
  • For any other cases, the window calls DefWindowProc.

The following diagram illustrates this sequence of message-processing events:

bm282.BMP

References DefaultProcessing(), DefWindowProc(), owl::TEventHandler::Dispatch(), owl::TEventHandler::TEventInfo::Entry, owl::TApplication::Find(), owl::TEventHandler::Find(), GetApplication(), GetCurrentEvent(), GetDlgCtrlID(), owl::TCommandEnabler::GetId(), owl::TEventHandler::TEventInfo::Id, IsFlagSet(), owl::TCurrentEvent::Message, owl::TResponseTableEntry< T >::NotifyCode, owl::TCurrentEvent::Param1, owl::TCurrentEvent::Param2, owl::wfAlias, and owl::TCurrentEvent::Win.

TResult owl::TWindow::DefWindowProc ( uint  message,
TParam1  param1,
TParam2  param2 
) [virtual]

Virtual function provides final default processing for an incoming message Calls original window proc that was subclassed, using ::CallWindowProc to make sure that registers get setup correctly. Performs default Windows processing and passes the incoming Windows message. You usually do not need to call this function directly. Classes such as TMDIFrame and TMDIChild override this function to perform specialized default processing.

Reimplemented in owl::TDecoratedMDIFrame, owl::TMDIFrame, owl::TMDIChild, and ocf::TOleMDIFrame.

References GetHandle().

void owl::TWindow::Destroy ( int  ret = 0) [virtual]

Destroys an MS-Windows element associated with the TWindow.

First, Destroy calls EnableAutoCreate for each window in the child list to ensure that windows in the child list will be re-created if this is re-created. Then, it destroys the associated interface element. If a derived window class expects to be destructed directly, it should call Destroy as the first step in its destruction so that any virtual functions and event handlers can be called during the destroy sequence.

Reimplemented in owl::TDialog, owl::TMDIChild, and ocf::TOleFrame.

References ClearFlag(), owl::TApplication::EndModal(), ForEach(), GetApplication(), GetHandle(), IsFlagSet(), SetFocus(), SetHandle(), owl::wfAlias, and owl::wfModalWindow.

void owl::TWindow::DestroyCaret ( ) [inline, static]

DestroyCaret first checks the ownership of the caret. If a window in the current task owns the caret, DestroyCaret destroys the caret and removes it from the screen.

Note:
Wrapper for Windows API.
void owl::TWindow::DisableAutoCreate ( ) [inline]

Disables the feature that allows an associated child window interface element to be created and displayed along with its parent window. Call DisableAutoCreate for pop-up windows and controls if you want to create and display them at a time later than their parent windows.

References ClearFlag(), and owl::wfAutoCreate.

void owl::TWindow::DisableTransfer ( ) [inline]

Disables (for the interface object) the transfer mechanism, which allows state data to be transferred to and from a transfer buffer.

References ClearFlag(), and owl::wfTransfer.

void owl::TWindow::DispatchScroll ( uint  scrollCode,
uint  thumbPos,
HWND  hWndCtrl 
) [protected]
int owl::TWindow::DoExecute ( ) [virtual]
void owl::TWindow::DragAcceptFiles ( bool  accept)

If a window can process dropped files, DragAcceptFiles sets accept to true.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::DrawMenuBar ( ) [inline]

DrawMenuBar redraws the menu bar. This function should be called to redraw the menu if the menu is changed after the window is created.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::EnableAutoCreate ( ) [inline]

Ensures that an associated child window interface element is created and displayed along with its parent window. By default, this feature is enabled for windows and controls, but disabled for dialog boxes.

References SetFlag(), and owl::wfAutoCreate.

bool owl::TWindow::EnableScrollBar ( uint  sbFlags = SB_BOTH,
uint  arrowFlags = ESB_ENABLE_BOTH 
) [inline]

Disables or enables one or both of the scroll bar arrows on the scroll bars associated with this window. sbFlags, which specifies the type of scroll bar, can be one of the Scroll Bar constants (SB_CTL, SB_HORZ, SB_VERT, or SB_BOTH). By default, the arrows on both the horizontal and vertical scroll bars are either enabled or disabled. arrowFlags, which indicates whether the scroll bar arrows are enabled or disabled, can be one of the Enable Scroll Bar constants (ESB_ENABLE_BOTH, ESB_DISABLE_LTUP, ESB_DISABLE_RTDN, ESB_DISABLE_BOTH). By default, the arrows on both the horizontal and vertical scroll bars are enabled.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::EnableTransfer ( ) [inline]

Enables the transfer mechanism, which allows state data to be transferred between the window and a transfer buffer.

References SetFlag(), and owl::wfTransfer.

bool owl::TWindow::EnableWindow ( bool  enable) [inline, virtual]

Allows the given window to receive input from the keyboard of mouse. If enable is true, the window can receive input. Use the function IsWindowEnabled to determine if the window has been enabled.

Note:
Wrapper for Windows API.

Reimplemented in owl::TMDIChild.

References GetHandle().

int owl::TWindow::EnumProps ( PROPENUMPROC  proc) [inline]

Enumerates all the items in the property list of the current window and passes them one by one to the callback function indicated in proc. The process continues until every item has been enumerated or until proc returns zero. proc holds the address of the callback function.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::EvActivate ( uint  active,
bool  minimized,
HWND  hWndOther 
) [inline, protected]

Default message handler for WM_ACTIVATE.

Reimplemented in owl::TTraceWindow.

References DefaultProcessing().

void owl::TWindow::EvActivateApp ( bool  active,
HTASK  hTask 
) [inline, protected]

The default message handler for WM_ACTIVATEAPP.

Reimplemented in owl::TFloatingFrame, owl::TGridPicker, owl::TPopupPicker, ocf::TOleFrame, and ocf::TOleMDIFrame.

References DefaultProcessing().

void owl::TWindow::EvAskCBFormatName ( uint  bufLen,
TCHAR *  buffer 
) [inline, protected]

The default message handler for WM_ASKCBFORMATNAME.

References DefaultProcessing().

void owl::TWindow::EvCancelMode ( ) [inline, protected]

The default message handler for WM_CANCELMODE.

Reimplemented in owl::TGlyphButton, and owl::TGridPicker.

References DefaultProcessing().

void owl::TWindow::EvChangeCBChain ( HWND  hWndRemoved,
HWND  hWndNext 
) [inline, protected]

The default message handler for WM_CHANGECBCHAIN.

Reimplemented in owl::TClipboardViewer.

References DefaultProcessing().

void owl::TWindow::EvChar ( uint  key,
uint  repeatCount,
uint  flags 
) [inline, protected]

The default message handler for WM_CHAR.

Reimplemented in owl::TCheckList, owl::TEdit, owl::TRichEdit, and owl::TGroupList.

References DefaultProcessing().

int owl::TWindow::EvCharToItem ( uint  key,
HWND  hWndListBox,
uint  caretPos 
) [inline, protected]

The default message handler for WM_CHARTOITEM.

References DefaultProcessing().

void owl::TWindow::EvChildInvalid ( HWND  handle) [protected]

Handle message posted to us by a control needing assistance in dealing with invalid inputs

Responds to a WM_CHILDINVALID message posted by a child edit control. Indicates that the contents of the child window are invalid.

Reimplemented in owl::TEdit, and owl::TRichEdit.

References SendMessage().

void owl::TWindow::EvClose ( ) [protected]

The default response to a WM_CLOSE message is to call CloseWindow() and then have the window deleted if the Handle was really destroyed.

Reimplemented in owl::TCommonDialog, owl::TDialog, owl::TFloatingSlip, and owl::TPropertyPage.

References CloseWindow(), owl::TApplication::Condemn(), DefaultProcessing(), GetApplication(), GetHandle(), IsFlagSet(), owl::wfAlias, and owl::wfDeleteOnClose.

TResult owl::TWindow::EvCommand ( uint  id,
HWND  hWndCtl,
uint  notifyCode 
) [virtual]

WindowProc calls EvCommand to handle WM_COMMAND messages. id is the identifier of the menu item or control. hWndCtl holds a value that represents the control sending the message. If the message is not from a control, it is 0. notifyCode holds a value that represents the control's notification message. If the message is from an accelerator, notifyCode is 1; if the message is from a menu, notifyCode is 0.

Reimplemented in owl::TDecoratedFrame, owl::TEdgeSlip, owl::TFloatingFrame, owl::TFrameWindow, owl::TGadgetWindow, owl::TPickListPopup, owl::TTinyCaption, ocf::TOleWindow, and ocf::TRemViewBucket.

References DefaultProcessing(), owl::TEventHandler::Dispatch(), owl::TEventHandler::TEventInfo::Entry, owl::TEventHandler::Find(), GetWindowPtr(), and owl::TResponseTableEntry< T >::NotifyCode.

void owl::TWindow::EvCommandEnable ( TCommandEnabler commandEnabler) [virtual]

Called by WindowProc to handle WM_COMMAND_ENABLE messages, EvCommandEnable calls the CmXxxx command-handling function or calls DefaultProcessing to handle the incoming message.

Reimplemented in owl::TDecoratedFrame, owl::TEdgeSlip, owl::TFloatingFrame, owl::TFrameWindow, owl::TGadgetWindow, ocf::TOleWindow, and ocf::TRemViewBucket.

References owl::TEventHandler::Dispatch(), owl::TEventHandler::Find(), and owl::TCommandEnabler::GetId().

void owl::TWindow::EvCommNotify ( uint  commId,
uint  status 
) [inline, protected]

The default message handler for WM_COMMNOTIFY.

References DefaultProcessing().

void owl::TWindow::EvCompacting ( uint  compactRatio) [inline, protected]

The default message handler for WM_COMPACTING.

References DefaultProcessing().

TResult owl::TWindow::EvCompareItem ( uint  ctrlId,
COMPAREITEMSTRUCT &  compareInfo 
) [protected]

Handles WM_COMPAREITEM message (for owner draw controls) by forwarding message to control itself

Reimplemented in owl::TComboBoxEx, and owl::TControl.

References DefaultProcessing(), ForwardMessage(), and GetWindowPtr().

void owl::TWindow::EvContextMenu ( HWND  childHwnd,
int  x,
int  y 
) [protected]

The default message handler for WM_CONTEXTMENU. Respond to a right button click in window. If a context menu is set, display it.

References DefaultProcessing(), GetApplication(), GetContextMenu(), owl::TApplication::GetMainWindow(), owl::TPopupMenu::TrackPopupMenu(), and WM_OWLHELPHIT.

int owl::TWindow::EvCreate ( CREATESTRUCT &  createStruct) [protected]

Response method for an incoming WM_CREATE message

Performs setup and data transfer now that we are created & have a Handle

References DefaultProcessing(), and PerformSetupAndTransfer().

HBRUSH owl::TWindow::EvCtlColor ( HDC  hDC,
HWND  hWndChild,
uint  ctlType 
) [protected]

Respond to WM_CTLCOLOR if we have a bkgnd color set & pass that to the control

Reimplemented in owl::TDialog, and owl::TUrlLink.

References DefaultProcessing(), owl::TColor::None, and owl::TColor::Transparent.

void owl::TWindow::EvDeadChar ( uint  deadKey,
uint  repeatCount,
uint  flags 
) [inline, protected]

The default message handler for WM_DEADCHAR.

References DefaultProcessing().

void owl::TWindow::EvDeleteItem ( uint  ctrlId,
DELETEITEMSTRUCT &  deleteInfo 
) [protected]

Handles WM_DELETEITEM message (for owner draw controls) by forwarding message to control itself

Reimplemented in owl::TComboBoxEx, and owl::TControl.

References DefaultProcessing(), ForwardMessage(), GetHandle(), and GetWindowPtr().

void owl::TWindow::EvDestroy ( ) [protected]

Responds to an incoming WM_DESTROY message

Calls CleanupWindow() to let derived classes cleanup Clears the wfFullyCreated flag since this window is no longer fully created

If the TWindow is the application's main window posts a 'quit' message to end the application, unless already in ~TApplication() (MainWindow == 0)

Reimplemented in owl::TClipboardViewer.

References CleanupWindow(), ClearFlag(), DefaultProcessing(), GetApplication(), IsFlagSet(), owl::wfAlias, owl::wfFullyCreated, and owl::wfMainWindow.

void owl::TWindow::EvDestroyClipboard ( ) [inline, protected]

The default message handler for WM_DESTROYCLIPBOARD.

References DefaultProcessing().

void owl::TWindow::EvDevModeChange ( TCHAR *  devName) [inline, protected]

The default message handler for WM_DEVMODECHANGE.

References DefaultProcessing().

void owl::TWindow::EvDrawClipboard ( ) [inline, protected]

The default message handler for WM_DRAWCLIPBOARD.

Reimplemented in owl::TClipboardViewer.

References DefaultProcessing().

void owl::TWindow::EvDropFiles ( TDropInfo  dropInfo) [inline, protected]

The default message handler for WM_DROPFILES.

Reimplemented in owl::TMDIClient, and ocf::TOleWindow.

References DefaultProcessing().

void owl::TWindow::EvEnable ( bool  enabled) [inline, protected]

The default message handler for WM_ENABLE.

Reimplemented in owl::TGlyphButton.

References DefaultProcessing().

void owl::TWindow::EvEndSession ( bool  endSession,
bool  logOff 
) [protected]

The default message handler for WM_ENDSESSION. If Windows is shutting down, throws an exception that is to be caught only by Owl's WinMain, which shuts down the entire application.

References DefaultProcessing().

void owl::TWindow::EvEnterIdle ( uint  source,
HWND  hWndDlg 
) [protected]

The default message handler for WM_ENTERIDLE.

Reimplemented in owl::TDecoratedFrame, and owl::TMDIChild.

References DefaultProcessing(), GetWindowPtr(), IdleAction(), IsFlagSet(), and owl::wfMainWindow.

bool owl::TWindow::EvEraseBkgnd ( HDC  hDC) [protected]

Response method for an incoming WM_ERASEBKGND message If a background color is set, and is not transparent - paint the background.

Reimplemented in owl::TEdgeSlip, owl::TFrameWindow, owl::TGauge, and owl::TGlyphButton.

References DefaultProcessing(), GetClientRect(), owl::TColor::None, owl::TDC::RestoreBrush(), owl::TDC::SelectObject(), owl::TDC::SetBkColor(), and owl::TColor::Transparent.

void owl::TWindow::EvFontChange ( ) [inline, protected]

The default message handler for WM_FONTCHANGE.

References DefaultProcessing().

uint owl::TNoteTab::EvGetDlgCode ( MSG *  msg) [inline, protected]

The default message handler for WM_GETDLGCODE.

WM_GETDLGCODE handler - Informs dialog manager that arrow keys are to be used.

Reimplemented in owl::TButton, owl::TCheckBox, owl::TEdit, owl::TGlyphButton, owl::TListBoxView, owl::TNoteTab, owl::TGridPicker, owl::TRichEdit, and owl::TUrlLink.

References DefaultProcessing().

HFONT owl::TWindow::EvGetFont ( ) [inline, protected]

The default message handler for WM_GETFONT.

Reimplemented in owl::TGlyphButton, and owl::TUrlLink.

References DefaultProcessing().

void owl::TWindow::EvGetMinMaxInfo ( MINMAXINFO &  minmaxinfo) [inline, protected]

The default message handler for WM_GETMINMAXINFO.

Reimplemented in owl::TFloatingSlip.

References DefaultProcessing().

void owl::TWindow::EvGetText ( uint  buffSize,
TCHAR *  buff 
) [inline, protected]

The default message handler for WM_GETTEXT.

References DefaultProcessing().

uint owl::TWindow::EvGetTextLength ( ) [inline, protected]

The default message handler for WM_GETTEXTLENGTH.

References DefaultProcessing().

void owl::TWindow::EvHotKey ( int  idHotKey) [inline, protected]

The default message handler for WM_HOTKEY.

References DefaultProcessing().

void owl::TWindow::EvHScroll ( uint  scrollCode,
uint  thumbPos,
HWND  hWndCtl 
) [protected]

Response method for an incoming WM_HSCROLL message

If the message is from a scrollbar control, calls DispatchScroll() otherwise passes the message to the TWindow's scroller if it has been constructed, else calls DefaultProcessing()

Assumes, because of a Windows bug, that if the window has the scrollbar style, it will not have scrollbar controls

Reimplemented in owl::TNoteTab, owl::TScrollBar, owl::TTabControl, owl::TUpDown, and ocf::TOleWindow.

References DefaultProcessing(), DispatchScroll(), GetWindowLong(), and owl::TScroller::HScroll().

void owl::TWindow::EvHScrollClipboard ( HWND  hCBViewer,
uint  scrollCode,
uint  pos 
) [inline, protected]

The default message handler for WM_HSCROLLCLIPBOARD.

References DefaultProcessing().

void owl::TWindow::EvIconEraseBkgnd ( HDC  hDC) [inline, protected]

The default message handler for WM_ICONERASEBKGND.

References DefaultProcessing().

void owl::TWindow::EvInitMenu ( HMENU  hMenu) [inline, protected]

The default message handler for WM_INITMENU.

References DefaultProcessing().

void owl::TWindow::EvInitMenuPopup ( HMENU  hPopupMenu,
uint  index,
bool  sysMenu 
) [protected]

Handle WM_INITMENUPOPUP while embeded to generate command enable messages for our server menu items. Very similar to TFrameWindow::EvInitMenuPopup; could rearrange code to share better.

Reimplemented in owl::TFrameWindow.

References DefaultProcessing(), EvCommandEnable(), GetHandle(), GetMenu(), owl::TMenu::GetMenuItemID(), IsFlagSet(), and owl::wfAlias.

void owl::TWindow::EvInputFocus ( bool  gainingFocus) [inline, protected]

The default message handler for WM_INPUTFOCUS.

References DefaultProcessing().

void owl::TWindow::EvKeyDown ( uint  key,
uint  repeatCount,
uint  flags 
) [inline, protected]

The default message handler for WM_KEYDOWN.

Reimplemented in owl::TEdit, owl::TGlyphButton, owl::TNoteTab, owl::TGridPicker, and owl::TRichEdit.

References DefaultProcessing().

void owl::TWindow::EvKeyUp ( uint  key,
uint  repeatCount,
uint  flags 
) [inline, protected]

The default message handler for WM_KEYUP.

Reimplemented in owl::TGlyphButton, and owl::TGridPicker.

References DefaultProcessing().

void owl::TWindow::EvKillFocus ( HWND  getFocus) [protected]

Handle WM_KILLFOCUS so that we can have a parent window hold onto our Handle and possibly restore focus later.

Reimplemented in owl::TEdit, owl::TGlyphButton, owl::TMemComboBox, owl::TNoteTab, owl::TGridPicker, owl::TPopupPicker, and owl::TRichEdit.

References DefaultProcessing(), GetHandle(), HoldFocusHWnd(), IsFlagSet(), and owl::wfFullyCreated.

void owl::TWindow::EvLButtonDblClk ( uint  modKeys,
TPoint point 
) [inline, protected]

The default message handler for WM_LBUTTONDBLCLK.

Reimplemented in owl::TEdgeSlip, owl::THarbor, owl::TGadgetWindow, owl::TGlyphButton, owl::TGridPicker, and ocf::TOleWindow.

References DefaultProcessing().

void owl::TWindow::EvLButtonDown ( uint  modKeys,
TPoint point 
) [protected]

Response method for an incoming WM_LBUTTONDOWN message

If the TWindow's Scroller has been constructed and if auto-scrolling has been requested, captures mouse input, loops until a WM_LBUTTONUP message comes in calling the Scroller's AutoScroll method, and then releases capture on mouse input. Will also break if a WM_MOUSEMOVE comes in without the left button down indicating a lost WM_LBUTTONUP

Reimplemented in owl::TCheckList, owl::TDockableGadgetWindow, owl::TFloatingSlip, owl::TEdgeSlip, owl::TGadgetWindow, owl::TGlyphButton, owl::TNoteTab, owl::TGridPicker, owl::TPopupPicker, owl::TSplashWindow, owl::TSplitter, owl::TUrlLink, owl::TGroupList, and ocf::TOleWindow.

References owl::TScroller::AutoScroll(), DefaultProcessing(), owl::TScroller::IsAutoMode(), ReleaseCapture(), and SetCapture().

void owl::TWindow::EvLButtonUp ( uint  modKeys,
TPoint point 
) [inline, protected]

The default message handler for WM_LBUTTONUP.

Reimplemented in owl::THarbor, owl::TGadgetWindow, owl::TGlyphButton, owl::TGridPicker, owl::TSplitter, owl::TTinyCaption, and ocf::TOleWindow.

References DefaultProcessing().

void owl::TWindow::EvMButtonDblClk ( uint  modKeys,
TPoint point 
) [inline, protected]

The default message handler for WM_MBUTTONDBLCLK.

References DefaultProcessing().

void owl::TWindow::EvMButtonDown ( uint  modKeys,
TPoint point 
) [inline, protected]

The default message handler for WM_MBUTTONDOWN.

References DefaultProcessing().

void owl::TWindow::EvMButtonUp ( uint  modKeys,
TPoint point 
) [inline, protected]

The default message handler for WM_MBUTTONUP.

References DefaultProcessing().

void owl::TWindow::EvMeasureItem ( uint  ctrlId,
MEASUREITEMSTRUCT &  measureInfo 
) [protected]

Handles WM_MEASUREITEM message (for owner draw controls & menus) by forwarding message to control itself

win->HandleMessage(WM_MEASUREITEM, ctrlId, TParam2(&measureInfo)); win->ForewardMessage();

Reimplemented in owl::TComboBoxEx, and owl::TControl.

References ChildWithId(), DefaultProcessing(), owl::TEventHandler::Dispatch(), owl::TEventHandler::Find(), GetDlgItem(), GetHandle(), GetWindowPtr(), and SendMessage().

int32 owl::TWindow::EvMenuChar ( uint  nChar,
uint  menuType,
HMENU  hMenu 
) [inline, protected]

The default message handler for WM_MENUCHAR.

References DefaultProcessing().

void owl::TWindow::EvMenuSelect ( uint  menuItemId,
uint  flags,
HMENU  hMenu 
) [inline, protected]

The default message handler for WM_MENUSELECT.

Reimplemented in owl::TDecoratedFrame, owl::TMDIChild, and ocf::TOleWindow.

References DefaultProcessing().

uint owl::TWindow::EvMouseActivate ( HWND  hTopLevel,
uint  hitCode,
uint  msg 
) [inline, protected]

The default message handler for WM_MOUSEACTIVATE.

Reimplemented in owl::TFloatingFrame, and ocf::TOleWindow.

References DefaultProcessing().

void owl::TWindow::EvMouseMove ( uint  modKeys,
TPoint point 
) [inline, protected]

The default message handler for WM_MOUSEMOVE.

Reimplemented in owl::THarbor, owl::TGadgetWindow, owl::TGlyphButton, owl::TGridPicker, owl::TSplitter, owl::TTinyCaption, owl::TUrlLink, and ocf::TOleWindow.

References DefaultProcessing().

bool owl::TWindow::EvMouseWheel ( uint  modKeys,
int  zDelta,
TPoint point 
) [protected]

Respond to MouseWheel event if Scroller exist.

References DefaultProcessing(), owl::TScroller::ScrollBy(), owl::TScroller::YLine, and owl::TScroller::YPage.

void owl::TWindow::EvMove ( TPoint clientOrigin) [protected]

Save the normal position of the window. If IsIconic() or IsZoomed() ignore the position since it does not reflect the normal state

References DefaultProcessing(), GetHandle(), GetWindowLong(), GetWindowRect(), IsIconic(), IsZoomed(), ScreenToClient(), owl::TRect::TopLeft(), owl::TWindowAttr::X, and owl::TWindowAttr::Y.

bool owl::TWindow::EvNCActivate ( bool  active) [inline, protected]

The default message handler for WM_NCACTIVATE.

Reimplemented in owl::TFloatingFrame, owl::TMDIChild, and owl::TTinyCaption.

References DefaultProcessing().

uint owl::TWindow::EvNCCalcSize ( bool  calcValidRects,
NCCALCSIZE_PARAMS &  params 
) [inline, protected]

The default message handler for WM_NCCALCSIZE.

Reimplemented in owl::TEdgeSlip, owl::TFloatingFrame, and owl::TTinyCaption.

References DefaultProcessing().

bool owl::TWindow::EvNCCreate ( CREATESTRUCT &  createStruct) [inline, protected]

The default message handler for WM_NCCREATE.

References DefaultProcessing().

void owl::TWindow::EvNCDestroy ( ) [protected]

Responds to an incoming WM_NCDESTROY message, the last message sent to an MS-Windows interface element

Sets the Handle data member of the TWindow to zero to indicate that an interface element is no longer associated with the object

Reimplemented in owl::TEditView, and owl::TFindReplaceDialog.

References DefaultProcessing(), and SetHandle().

uint owl::TWindow::EvNCHitTest ( TPoint point) [inline, protected]

The default message handler for WM_NCHITTEST.

Reimplemented in owl::TFloatingFrame, owl::TStatusBar, and owl::TTinyCaption.

References DefaultProcessing().

void owl::TWindow::EvNCLButtonDblClk ( uint  hitTest,
TPoint point 
) [inline, protected]

The default message handler for WM_NCLBUTTONDBLCLK.

References DefaultProcessing().

void owl::TWindow::EvNCLButtonDown ( uint  hitTest,
TPoint point 
) [inline, protected]

The default message handler for WM_NCLBUTTONDOWN.

Reimplemented in owl::TFloatingSlip, and owl::TTinyCaption.

References DefaultProcessing().

void owl::TWindow::EvNCLButtonUp ( uint  hitTest,
TPoint point 
) [inline, protected]

The default message handler for WM_NCLBUTTONUP.

References DefaultProcessing().

void owl::TWindow::EvNCMButtonDblClk ( uint  hitTest,
TPoint point 
) [inline, protected]

The default message handler for WM_NCMBUTTONDBLCLK.

References DefaultProcessing().

void owl::TWindow::EvNCMButtonDown ( uint  hitTest,
TPoint point 
) [inline, protected]

The default message handler for WM_NCMBUTTONDOWN.

References DefaultProcessing().

void owl::TWindow::EvNCMButtonUp ( uint  hitTest,
TPoint point 
) [inline, protected]

The default message handler for WM_NCMBUTTONUP.

References DefaultProcessing().

void owl::TWindow::EvNCMouseMove ( uint  hitTest,
TPoint point 
) [inline, protected]

The default message handler for WM_NCMOUSEMOVE.

References DefaultProcessing().

void owl::TWindow::EvNCPaint ( HRGN  ) [inline, protected]

The default message handler for WM_NCPAINT.

Reimplemented in owl::TEdgeSlip, owl::TFloatingFrame, and owl::TTinyCaption.

References DefaultProcessing().

void owl::TWindow::EvNCRButtonDblClk ( uint  hitTest,
TPoint point 
) [inline, protected]

The default message handler for WM_NCRBUTTONDBLCLK.

References DefaultProcessing().

void owl::TWindow::EvNCRButtonDown ( uint  hitTest,
TPoint point 
) [inline, protected]

The default message handler for WM_NCRBUTTONDOWN.

References DefaultProcessing().

void owl::TWindow::EvNCRButtonUp ( uint  hitTest,
TPoint point 
) [inline, protected]

The default message handler for WM_NCRBUTTONUP.

References DefaultProcessing().

void owl::TWindow::EvNextDlgCtl ( uint  hctlOrDir,
uint  isHCtl 
) [inline, protected]

The default message handler for WM_NEXTDLGCTL.

References DefaultProcessing().

TResult owl::TWindow::EvNotify ( uint  ctlId,
TNotify notifyInfo 
) [virtual]

Handles WM_NOTIFY and subdispatch messages from child controls. This is the default message handler for WM_NOTIFY.

Reimplemented in owl::TPropertyPage, and ocf::TRemViewBucket.

References owl::TTooltipText::CopyText(), DefaultProcessing(), owl::TEventHandler::Dispatch(), owl::TEventHandler::Find(), owl::TCommandEnabler::GetHandled(), owl::TCommandEnabler::GetId(), GetParentH(), GetParentO(), GetWindowPtr(), and RouteCommandEnable().

void owl::TWindow::EvOtherWindowCreated ( HWND  hWndOther) [inline, protected]

The default message handler for WM_OTHERWINDOWCREATED.

References DefaultProcessing().

void owl::TWindow::EvOtherWindowDestroyed ( HWND  hWndOther) [inline, protected]

The default message handler for WM_OTHERWINDOWDESTROYED.

References DefaultProcessing().

void owl::TWindow::EvPaint ( ) [protected]

Response method for an incoming WM_PAINT message

Calls Paint(), performing Windows-required paint setup and cleanup before and after. if the TWindow has a TScroller, also calls its BeginView() and EndView() methods before and after call to Paint()

Reimplemented in owl::TControl, owl::TDialog, owl::TFlatComboBox, owl::TFlatEdit, owl::TFlatListBox, owl::TFrameWindow, owl::TGlyphButton, owl::TNoteTab, owl::TUrlLink, and ocf::TOleWindow.

References owl::TScroller::BeginView(), DefaultProcessing(), owl::TScroller::EndView(), IsFlagSet(), Paint(), owl::TPaintDC::Ps, and owl::wfAlias.

void owl::TWindow::EvPaintClipboard ( HWND  hWnd,
HANDLE  hPaintStruct 
) [inline, protected]

The default message handler for WM_PAINTCLIPBOARD.

References DefaultProcessing().

void owl::TWindow::EvPaintIcon ( ) [inline, protected]

The default message handler for WM_PAINTICON.

References DefaultProcessing().

void owl::TWindow::EvPaletteChanged ( HWND  hWndPalChg) [inline, protected]

The default message handler for WM_PALETTECHANGED.

Reimplemented in owl::TFrameWindow, and owl::TColorPicker.

References DefaultProcessing().

void owl::TWindow::EvPaletteIsChanging ( HWND  hWndPalChg) [inline, protected]

The default message handler for WM_PALETTEISCHANGING.

References DefaultProcessing().

void owl::TWindow::EvParentNotify ( uint  event,
uint  childHandleOrX,
uint  childIDOrY 
) [inline, protected]

The default message handler for WM_PARENTNOTIFY.

Reimplemented in owl::TEdgeSlip, and owl::TFrameWindow.

References DefaultProcessing().

int owl::TWindow::EvPower ( uint  powerEvent) [inline, protected]

The default message handler for WM_POWER.

References DefaultProcessing().

HANDLE owl::TWindow::EvQueryDragIcon ( ) [inline, protected]

The default message handler for WM_QUERYDRAGICON.

Reimplemented in owl::TFrameWindow.

References DefaultProcessing().

bool owl::TWindow::EvQueryEndSession ( ) [protected]

Respond to Windows attempt to close down. Determines if this app or window is ready to close.

References CanClose(), owl::TApplication::CanClose(), DefaultProcessing(), GetApplication(), IsFlagSet(), owl::wfAlias, and owl::wfMainWindow.

bool owl::TWindow::EvQueryNewPalette ( ) [inline, protected]

The default message handler for WM_QUERYNEWPALETTE.

Reimplemented in owl::TFrameWindow, and owl::TColorPicker.

References DefaultProcessing().

bool owl::TWindow::EvQueryOpen ( ) [inline, protected]

The default message handler for WM_QUERYOPEN.

References DefaultProcessing().

void owl::TWindow::EvQueueSync ( ) [inline, protected]

The default message handler for WM_QUEUESYNC.

References DefaultProcessing().

void owl::TWindow::EvRButtonDblClk ( uint  modKeys,
TPoint point 
) [inline, protected]

The default message handler for WM_RBUTTONDBLCLK.

References DefaultProcessing().

void owl::TWindow::EvRButtonDown ( uint  modKeys,
TPoint point 
) [inline, protected]

The default message handler for WM_RBUTTONDOWN.

Reimplemented in owl::TGadgetWindow, and ocf::TOleWindow.

References DefaultProcessing().

void owl::TWindow::EvRButtonUp ( uint  modKeys,
TPoint point 
) [inline, protected]

The default message handler for WM_RBUTTONUP.

Reimplemented in owl::TGadgetWindow.

References DefaultProcessing().

TResult owl::TWindow::EvRegisteredMouseWheel ( TParam1  param1,
TParam2  param2 
) [protected]

Response method for an incoming mouse wheel message.

References GetDesktopWindow(), GetFocus(), GetParent(), and SendMessage().

void owl::TWindow::EvRenderAllFormats ( ) [inline, protected]

The default message handler for WM_RENDERALLFORMATS.

References DefaultProcessing().

void owl::TWindow::EvRenderFormat ( uint  dataFormat) [inline, protected]

The default message handler for WM_RENDERFORMAT.

References DefaultProcessing().

bool owl::TWindow::EvSetCursor ( HWND  hWndCursor,
uint  hitTest,
uint  mouseMsg 
) [protected]

Response method for an incoming WM_SETCURSOR message

If a cursor has been set for this window, & the mouse is over the client area, set the cursor

Reimplemented in owl::TDockableGadgetWindow, owl::TSplitter, and ocf::TOleWindow.

References DefaultProcessing(), GetHandle(), and SetCursor().

void owl::TWindow::EvSetFocus ( HWND  hWndLostFocus) [inline, protected]

The default message handler for WM_SETFOCUS.

Reimplemented in owl::TEdit, owl::TFrameWindow, owl::TGlyphButton, owl::TNoteTab, owl::TGridPicker, owl::TRichEdit, and ocf::TOleWindow.

References DefaultProcessing().

void owl::TWindow::EvSetFont ( HFONT  hFont,
bool  redraw 
) [inline, protected]

The default message handler for WM_SETFONT.

Reimplemented in owl::TDialog, owl::TGlyphButton, and owl::TUrlLink.

References DefaultProcessing().

void owl::TWindow::EvSetRedraw ( bool  redraw) [inline, protected]

The default message handler for WM_SETREDRAW.

References DefaultProcessing().

void owl::TWindow::EvSetText ( LPCTSTR  text) [inline, protected]

The default message handler for WM_SETTEXT.

References DefaultProcessing().

void owl::TWindow::EvShowWindow ( bool  show,
uint  status 
) [inline, protected]

The default message handler for WM_SHOWWINDOW.

References DefaultProcessing().

void owl::TWindow::EvSize ( uint  sizeType,
TSize size 
) [protected]

Response method for an incoming WM_SIZE message

Saves the normal size of the window in Attr. Also calls the SetPageSize() and SetBarRange() methods of the TWindow's scroller, if it has been constructed.

Reimplemented in owl::TDecoratedFrame, owl::TFrameWindow, owl::TLayoutWindow, owl::TNoteTab, owl::TPaneSplitter, owl::TPreviewPage, owl::TSplitter, owl::TStatic, ocf::TOleFrame, and ocf::TOleWindow.

References DefaultProcessing(), GetExStyle(), GetHandle(), GetWindowRect(), owl::TWindowAttr::H, owl::TRect::Height(), SendMessage(), owl::TScroller::SetPageSize(), owl::TScroller::SetSBarRange(), TraceWindowPlacement(), owl::TWindowAttr::W, and owl::TRect::Width().

void owl::TWindow::EvSizeClipboard ( HWND  hWndViewer,
HANDLE  hRect 
) [inline, protected]

The default message handler for WM_SIZECLIPBOARD.

References DefaultProcessing().

void owl::TWindow::EvSpoolerStatus ( uint  jobStatus,
uint  jobsLeft 
) [inline, protected]

The default message handler for WM_SPOOLERSTATUS.

References DefaultProcessing().

void owl::TWindow::EvSysChar ( uint  key,
uint  repeatCount,
uint  flags 
) [inline, protected]

The default message handler for WM_SYSCHAR.

References DefaultProcessing().

void owl::TWindow::EvSysColorChange ( ) [protected]

Respond to WM_SYSCOLORCHANGE by broadcasting it to all children.

Reimplemented in owl::TGadgetWindow, and owl::TGlyphButton.

References ChildBroadcastMessage(), and DefaultProcessing().

void owl::TWindow::EvSysCommand ( uint  cmdType,
TPoint point 
) [inline, protected]

Responds to a user-selected command from the System menu or when the user selects the maximize or minimize box. Applications that modify the system menu must process EvSysCommand messages. Any EvSysCommand messages not handled by the application must be passed to DefaultProcessing. The parameter cmdType can be one of the following system commands:

  • SC_CLOSE Close the window.
  • SC_HOTKEY Activate the specified window.
  • SC_HSCROLL Scroll horizontally.
  • SC_KEYMENU Retrieve a menu through a keystroke.
  • SC_MAXIMIZE (or SC_ZOOM) Maximize the window.
  • SC_MINIMIZE (or SC_ICON) Minimize the window.
  • SC_MOUSEMENU Retrieve a menu through a mouse click.
  • SC_NEXTWINDOW Move to the next window.
  • SC_PREVWINDOW Move to the previous window.
  • SC_SCREENSAVE Execute the specified screen saver.
  • SC_SIZE Size the window
  • SC_TASKLIST Activate the Windows Task Manager.
  • SC_VSCROLL Scroll vertically.

In the following example, EvSysCommand either processes system messages or calls DefaultProcessing:

 void MyWindow::EvSysCommand(uint cmdType, TPoint&)
 { 
    switch (cmdType&  0xFFF0) { 
       case SC_MOUSEMENU:
       case SC_KEYMENU:
          break;
       default:
          DefaultProcessing();
        }
 }

Reimplemented in owl::TFloatingFrame, owl::TRollDialog, and owl::TTinyCaption.

References DefaultProcessing().

void owl::TWindow::EvSysDeadChar ( uint  key,
uint  repeatCount,
uint  flags 
) [inline, protected]

The default message handler for WM_SYSDEADCHAR.

References DefaultProcessing().

void owl::TWindow::EvSysKeyDown ( uint  key,
uint  repeatCount,
uint  flags 
) [inline, protected]

The default message handler for WM_SYSKEYDOWN.

References DefaultProcessing().

void owl::TWindow::EvSysKeyUp ( uint  key,
uint  repeatCount,
uint  flags 
) [inline, protected]

The default message handler for WM_SYSKEYUP.

References DefaultProcessing().

void owl::TWindow::EvSystemError ( uint  error) [inline, protected]

The default message handler for WM_SYSTEMERROR.

References DefaultProcessing().

void owl::TWindow::EvTimeChange ( ) [inline, protected]

The default message handler for WM_TIMECHANGE.

References DefaultProcessing().

void owl::TWindow::EvTimer ( uint  timerId) [inline, protected]

The default message handler for WM_TIMER.

Reimplemented in owl::TSplashWindow, and ocf::TOleFrame.

References DefaultProcessing().

int owl::TWindow::EvVKeyToItem ( uint  key,
HWND  hWndListBox,
uint  caretPos 
) [inline, protected]

The default message handler for WM_VKEYTOITEM.

References DefaultProcessing().

void owl::TWindow::EvVScroll ( uint  scrollCode,
uint  thumbPos,
HWND  hWndCtl 
) [protected]

Response method for an incoming WM_VSCROLL message

If the message is from a scrollbar control, calls DispatchScroll() otherwise passes the message to the TWindow's scroller if it has been constructed, else calls DefaultProcessing()

Assumes, because of a Windows bug, that if the window has the scrollbar style, it will not have scrollbar controls

Reimplemented in owl::TScrollBar, owl::TTabControl, owl::TUpDown, and ocf::TOleWindow.

References DefaultProcessing(), DispatchScroll(), GetWindowLong(), and owl::TScroller::VScroll().

void owl::TWindow::EvVScrollClipboard ( HWND  hCBViewer,
uint  scrollCode,
uint  pos 
) [inline, protected]

The default message handler for WM_VSCROLLCLIPBOARD.

References DefaultProcessing().

TResult owl::TWindow::EvWin32CtlColor ( TParam1  param1,
TParam2  param2 
) [protected]

The default message handler for WM_WIN32CTLCOLOR. Process Win32 Control Color messages by redispatching to Win16-like member function.

References DefWindowProc(), owl::TEventHandler::TEventInfo::Entry, owl::TEventHandler::Find(), GetCurrentEvent(), owl::TCurrentEvent::Message, owl::TEventHandler::TEventInfo::Object, and owl::TResponseTableEntry< T >::Pmf.

void owl::TWindow::EvWindowPosChanged ( WINDOWPOS &  windowPos) [inline, protected]

The default message handler for WM_WINDOWPOSCHANGED.

Reimplemented in owl::TFloatingSlip.

References DefaultProcessing().

void owl::TWindow::EvWindowPosChanging ( WINDOWPOS &  windowPos) [inline, protected]

The default message handler for WM_WINDOWPOSCHANGING.

Reimplemented in owl::TFloatingSlip, owl::TEdgeSlip, and owl::TGadgetWindow.

References DefaultProcessing().

void owl::TWindow::EvWinIniChange ( TCHAR *  section) [inline, protected]

The default message handler for WM_WININICHANGE.

Reimplemented in owl::TFloatingSlip.

References DefaultProcessing().

int owl::TWindow::Execute ( ) [virtual]

Creates the underlying HWND and makes it modal with the help of TApplication's BeginModal support.

Reimplemented in owl::TDialog, owl::TPickListPopup, and owl::TPropertySheet.

References DoExecute().

TWindow * owl::TWindow::FirstThat ( TCondMemFunc  test,
void *  paramList = 0 
)

Returns a pointer to the first TWindow in the ChildList that meets some specified criteria

If no child in the list meets the criteria, 0 is returned

The Test parameter which defines the criteria, is a pointer to a member function (this is how it's different from FirstThat above) that takes a pointer to a TWindow & a pointer to void

The TWindow pointer will be used as the pointer to the child window and the void pointer as a pointer to the Test function's additional parameters

The Test function must return a Boolean value indicating whether the child passed meets the criteria

References Next().

TWindow * owl::TWindow::FirstThat ( TCondFunc  test,
void *  paramList = 0 
) const

Returns a pointer to the first TWindow in the ChildList that meets some specified criteria

If no child in the list meets the criteria, 0 is returned

The Test parameter which defines the criteria, is a pointer to a function that takes a TWindow pointer & a pointer to void

The TWindow* will be used as the pointer to the child window and the void* as a pointer to the Test function's additional parameters

The Test function must return a Boolean value indicating whether the child passed meets the criteria

In the following example, GetFirstChecked calls FirstThat to obtain a pointer (p) to the first check box in the child list that is checked:

 bool IsThisBoxChecked(TWindow* p, void*) { 
    return ((TCheckBox*)p)->GetCheck() == BF_CHECKED;
 }
 TCheckBox* TMyWindow::GetFirstChecked() { 
    return FirstThat(IsThisBoxChecked);
 }

References Next().

bool owl::TWindow::FlashWindow ( bool  invert) [inline]

Changes the window from active to inactive or vice versa. If invert is nonzero, the window is flashed. If invert is 0, the window is returned to its original state–either active or inactive.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::ForEach ( TActionMemFunc  action,
void *  paramList = 0 
)

Iterates over each child window in the TWindow's ChildList, calling the member function (unlike ForEach above which takes pointer to non-member function) whose pointer is passed as the Action to be performed for each child

A pointer to a child is passed as the first parameter to the iteration procedure

References Next().

void owl::TWindow::ForEach ( TActionFunc  action,
void *  paramList = 0 
)

Iterates over each child window in the TWindow's ChildList, calling the procedure whose pointer is passed as the Action to be performed for each child

A pointer to a child is passed as the first parameter to the iteration procedure

In the following example, CheckAllBoxes calls ForEach, checking all the check boxes in the child list:

 void CheckTheBox(TWindow* p, void*) { 
  ((TCheckBox*)p)->Check();
 }
 void CheckAllBoxes() { 
   ForEach(CheckTheBox);
 }

References Next().

TResult owl::TWindow::ForwardMessage ( HWND  handle,
bool  send = true 
)

Forwards the window's current message. Calls SendMessage if send is true; otherwise calls PostMessage.

References GetCurrentEvent(), owl::TCurrentEvent::Message, owl::TCurrentEvent::Param1, owl::TCurrentEvent::Param2, PostMessage(), and SendMessage().

TResult owl::TWindow::ForwardMessage ( bool  send = true)

Forwards the window's current message. Calls SendMessage if send is true; otherwise calls PostMessage.

References ForwardMessage(), GetCurrentEvent(), GetHandle(), owl::TCurrentEvent::Message, owl::TCurrentEvent::Param1, and owl::TCurrentEvent::Param2.

HWND owl::TWindow::GetActiveWindow ( ) [inline, static]

Retrieves the handle of the active window. Returns 0 if no window is associated with the calling thread.

Note:
Wrapper for Windows API.
TApplication * owl::TWindow::GetApplication ( ) const [inline]

Gets a pointer to the TApplication object associated with this. Use GetApplication to obtain access to data and functions in the TApplication object.

LPCTSTR owl::TWindow::GetCaption ( ) const [inline]

Returns the Title member of TWindow. Returns 0 if the caption has not yet been set.

Note:
It may differ from the actual window caption, if not set via TWindow::SetCaption(). TWindow::GetWindowTextTitle() can be used to keep Title synchronized.
HWND owl::TWindow::GetCapture ( ) [inline, static]

Returns the handle of the window that has captured the mouse.

Note:
Wrapper for Windows API.
uint owl::TWindow::GetCaretBlinkTime ( ) [inline, static]

Retrieves the caret blink rate in milliseconds.

Note:
Wrapper for Windows API.
void owl::TWindow::GetCaretPos ( TPoint point) [inline, static]

Gets the position of the caret in the coordinates of the client window. point refers to the structure that receives the client coordinates of the caret.

Note:
Wrapper for Windows API.
long owl::TWindow::GetClassLong ( int  index) const [inline]

Retrieves the 32-bit value containing information about the window class. If unsuccessful, returns 0. Depending on the value of index, GetClassLong can retrieve the following information:

  • GCL_CBCLSEXTRA Size in bytes of memory associated with this class
  • GCL_CBWINDEXTRA Size of extra window memory associated with each window
  • GCL_HBRBACKGROUND Handle of the background brush associated with the class
  • GCL_HCURSOR Handle of the cursor
  • GCL_HICON Handle of the icon
  • GCL_HMODULE Handle of the module that registered the class
  • GCL_MENUNAME Address of the menu name string
  • GCL_STYLE The style bits associated with a window class
  • GCL_WNDPROC Address of the window procedure associated with this class

References GetHandle().

long owl::TWindow::GetClassName ( TCHAR *  className,
int  maxCount 
) const [inline]

Returns the class name for a generic OWL window.

Returns the Windows registration class name. The default class name is generated using the module name plus Window. If you are registering a new class or changing the name of an existing window class, override this function in your derived class.

References GetHandle().

uint16 owl::TWindow::GetClassWord ( int  index) const [inline]

Gets a 16-bit value containing information about the class or style of the window. If unsuccessful; returns 0. Depending on the value of index, GetClassWord can retrieve the following information:

  • GCW_CBCLSEXTRA Number of additional class information
  • GCW_CBWINDEXTRA Number of bytes of additional window information
  • GCW_HBRBACKGROUND Handle of the background brush
  • GCW_HCURSOR Handle of the cursor
  • GCW_HICON Handle of the icon
  • GCW_HMODULE Handle of the module
  • GCW_STYLE The style bits associated with a window class

References GetHandle().

TRect owl::TWindow::GetClientRect ( ) const [inline]

Gets the coordinates of the window's client area (the area in a window you can use for drawing).

Note:
Wrapper for Windows API.
void owl::TWindow::GetClientRect ( TRect rect) const

Gets the coordinates of the window's client area and then copies them into the object referred to by TRect.

Note:
Gets the window's client rectangle whether it has been created or not

References GetClientRect(), GetHandle(), owl::TWindowAttr::H, owl::TRect::Set(), and owl::TWindowAttr::W.

TPopupMenu * owl::TWindow::GetContextMenu ( ) const [inline]

Returns the associated popup menu used by the window.

TCurrentEvent & owl::TWindow::GetCurrentEvent ( ) [inline]

Returns the current event to be processed in the message queue.

References GetApplication(), and owl::TApplication::GetCurrentEvent().

void owl::TWindow::GetCursorPos ( TPoint pos) [inline, static]

Retrieves the cursor's current position (in window screen coordinates) and copies the values into the structure pointed to by pos.

Note:
Wrapper for Windows API.
HWND owl::TWindow::GetDesktopWindow ( ) [inline, static]

Returns a handle to the desktop window.

Note:
Wrapper for Windows API.
int owl::TWindow::GetDlgCtrlID ( ) const [inline]

Returns the ID of the control.

Note:
Wrapper for Windows API.

References GetHandle().

HWND owl::TWindow::GetDlgItem ( int  childId) const [inline]

Retrieves the handle of a control specified by childId.

Note:
Wrapper for Windows API.

References GetHandle().

uint owl::TWindow::GetDlgItemInt ( int  childId,
bool *  translated = 0,
bool  isSigned = true 
) const

Retrieves the text of a control specified by childId. translated points to the variable that receives the translated value. isSigned indicates that the retrieved value is signed (the default).

References GetHandle().

int owl::TWindow::GetDlgItemText ( int  childId,
TCHAR *  text,
int  max 
) const [inline]

Retrieves the text of a control specified by childId. text points to the text buffer to receive the text. max specifies the maximum length of the caption, which is truncated if it exceeds this length.

Note:
Wrapper for Windows API.

References GetHandle().

tstring owl::TWindow::GetDlgItemText ( int  childId) const

String-aware overload.

References GetDlgItem(), and GetWindowTextLength().

uint32 owl::TWindow::GetExStyle ( ) const

Gets the extra style bits of the window.

References owl::TWindowAttr::ExStyle, GetHandle(), and GetWindowLong().

TWindow * owl::TWindow::GetFirstChild ( ) [inline]

Returns a pointer to the first child window, which is the first window created in the interface object's child list.

HWND owl::TWindow::GetFocus ( ) [inline, static]

Gets a handle to the window that has the focus. Use the function SetFocus to set the keyboard focus to this window.

Note:
Wrapper for Windows API.

Reimplemented in owl::TGridPicker.

HWND owl::TWindow::GetHandle ( ) const [inline]

Returns the handle of the window.

void owl::TWindow::GetHWndState ( bool  forceStyleSync = false) [protected]
int owl::TWindow::GetId ( ) const [inline]

Returns Attr.Id, the ID used to find the window in a specified parent's child list.

References owl::TWindowAttr::Id.

HWND owl::TWindow::GetLastActivePopup ( ) const [inline]

Returns the last active pop-up window in the list.

Note:
Wrapper for Windows API.

References GetHandle().

TWindow * owl::TWindow::GetLastChild ( ) [inline]

Returns a pointer to the last child window in the interface object's child list.

HMENU owl::TWindow::GetMenu ( ) const [inline]

Returns the handle to the menu of the indicated window. If the window has no menu, the return value is 0.

Note:
Wrapper for Windows API.

References GetHandle().

TModule * owl::TWindow::GetModule ( ) const [inline]

Returns a pointer to the module object.

HWND owl::TWindow::GetNextDlgGroupItem ( HWND  hWndCtrl,
bool  previous = false 
) const [inline]

Returns either the next or the previous control in the dialog box. hWndCtrl identifies the control in the dialog box where the search begins. If previous is 0, GetNextDlgGroupItem searches for the next control. If previous is nonzero, it searches for the previous control.

Note:
Wrapper for Windows API.

References GetHandle().

HWND owl::TWindow::GetNextDlgTabItem ( HWND  hWndCtrl,
bool  previous = false 
) const [inline]

Returns the handle of the first control that lets the user press the Tab key to move to the next control (that is, the first control with the WS_TABSTOP style associated with it). hWndCtrl identifies the control in the dialog box where the search begins. If previous is 0, GetNextDlgTabItem searches for the next control. If previous is nonzero, it searches for the previous control.

Note:
Wrapper for Windows API.

References GetHandle().

HWND owl::TWindow::GetNextWindow ( uint  flag) const [inline]

Finds the handle associated with either the next or previous window in the window manager's list. dirFlag specifies the direction of the search. Under the Win 32 API, GetNextWindow returns either the next or the previous window's handle. If the application is not running under Win32, GetNextWindow returns the next window's handle.

Note:
Wrapper for Windows API.

References GetHandle(), and GetWindow().

TWindow * owl::TWindow::GetParent ( ) const [inline]

Retrieves the OWL object of the parent window. If none exists, returns 0.

References GetParentO().

HWND owl::TWindow::GetParentH ( ) const [inline]

Return the handle of the parent.

References GetHandle(), and GetParent().

TWindow * owl::TWindow::GetParentO ( ) const [inline]

Return the OWL's parent for this window.

HANDLE owl::TWindow::GetProp ( uint16  atom) const [inline]

Returns a handle to the property list of the specified window. atom contains a value that identifies the character string whose handle is to be retrieved. If the specified string is not found in the property list for this window, returns NULL.

Note:
Wrapper for Windows API.

References GetHandle().

HANDLE owl::TWindow::GetProp ( LPCTSTR  str) const [inline]

Returns a handle to the property list of the specified window. Unlike the Syntax 1 GetProp function, string points to the string whose handle is to be retrieved. If the specified string is not found in the property list for this window, returns NULL.

Note:
Wrapper for Windows API.

References GetHandle(), and GetProp().

TScroller * owl::TWindow::GetScroller ( ) [inline]

Returns the associated scroller object for this window.

int owl::TWindow::GetScrollPos ( int  bar) const

Returns the thumb position in the scroll bar. The position returned is relative to the scrolling range. If bar is SB_CTL, it returns the position of a control in the scroll bar. If bar is SB_HORZ, it returns the position of a horizontal scroll bar. If bar is SB_VERT, it returns the position of a vertical scroll bar.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::GetScrollRange ( int  bar,
int &  minPos,
int &  maxPos 
) const

Returns the minimum and maximum positions in the scroll bar. If bar is SB_CTL, it returns the position of a control in the scroll bar. If bar is SB_HORZ, it returns the position of a horizontal scroll bar. If bar is SB_VERT, it returns the position of a vertical scroll bar. minPos and maxPos hold the lower and upper range, respectively, of the scroll bar positions. If there are no scroll bar controls or if the scrolls are non-standard, minPos and maxPos are zero.

Note:
Wrapper for Windows API.

References GetHandle().

uint32 owl::TWindow::GetStyle ( ) const

Gets the style bits of the underlying window or the 'Style' member of the attribute structure associated with this TWindow object.

Reimplemented in owl::TSplashWindow.

References GetHandle(), GetWindowLong(), and owl::TWindowAttr::Style.

HMENU owl::TWindow::GetSystemMenu ( bool  revert = false) const [inline]

Returns a handle to the system menu so that an application can access the system menu.

Note:
Wrapper for Windows API.

References GetHandle().

HWND owl::TWindow::GetTopWindow ( ) const [inline]

Returns a handle to the top window currently owned by this parent window. If no children exist, GetTopWindow returns 0.

Note:
Wrapper for Windows API.

References GetHandle().

bool owl::TWindow::GetUpdateRect ( TRect rect,
bool  erase = true 
) const [inline]

Retrieves the screen coordinates of the rectangle that encloses the updated region of the specified window. erase specifies whether GetUpdateRect should erase the background of the updated region.

Note:
Wrapper for Windows API.

References GetHandle().

int owl::TWindow::GetUpdateRgn ( TRegion region,
bool  erase = true 
) const

Copies a window's update region into a region specified by region. If erase is true, GetUpdateRgn erases the background of the updated region and redraws nonclient regions of any child windows. If erase is false, no redrawing occurs. If the call is successful, GetUpdateRgn returns a value indicating the kind of region that was updated. If the region has no overlapping borders, it returns SIMPLEREGION; if the region has overlapping borders, it returns COMPLEXREGION; if the region is empty, it returns NULLREGION; if an error occurs, it returns ERROR.

Note:
Not inline to avoid requiring gdiobjec.h by window.h just to get TRegion's conversion operator

References GetHandle().

HWND owl::TWindow::GetWindow ( uint  flag) const [inline]

Returns the handle of the window that has the indicated relationship to this window. cmd, which indicates the type of relationship to be obtained, can be one of the following values:

  • GW_CHILD If the given window is a parent window, the return value indicates the child window at the top of the Z order (the position of a window in a series of overlapping windows arranged in a stack). Otherwise, the return value is 0. Only child windows are examined.
  • GW_HWNDFIRST The return value indicates the window at the top of the Z order. If this window is a topmost window, the return value identifies the topmost window at the top of the Z order. If this window is a top-level window, the return value identifies the top-level window at the bottom of the Z order. If this window is a child window, the return value indicates the sibling window at the bottom of the Z order.
  • GW_HWNDNEXT The return value identifies the window below the given window in the Z order. If this window is a topmost window, the return value identifies the topmost window below this window. If this window is a top-level window, the return value indicates the top-level window below this window. If this window is a child window, the return value indicates the sibling window below this window.
  • GW_HWNDPREV The return value identifies the window above the given window in the Z order. If this window is a topmost window, the return value identifies the topmost window above this window. If this window is a top-level window, the return value indicates the top-level window above this window. If this window is a child window, the return value indicates the sibling window above this window.
  • GW_OWNER The return value identifies this window's owner window, if one exists.
Note:
Wrapper for Windows API.

References GetHandle().

TWindowAttr & owl::TWindow::GetWindowAttr ( ) [inline]

Returns the TWindowAttr structure, which contains the window's creation attributes.

const TWindowAttr & owl::TWindow::GetWindowAttr ( ) const [inline]

Returns the TWindowAttr structure, which contains the window's creation attributes.

void owl::TWindow::GetWindowClass ( WNDCLASS &  wndClass) [protected, virtual]

Redefined by derived classes, GetWindowClass fills the supplied MS-Windows registration class structure with registration attributes, thus, allowing instances of TWindow to be registered. This function, along with GetClassName, allows Windows classes to be used for the specified ObjectWindows class and its derivatives. It sets the fields of the passed WNDCLASS parameter to the default attributes appropriate for a TWindow. The fields and their default attributes for the class are the following:

  • cbClsExtra 0 (the number of extra bytes to reserve after the Window class structure). This value is not used by ObjectWindows.
  • cbWndExtra 0 (the number of extra bytes to reserve after the Window instance). This value is not used by ObjectWindows.
  • hInstance The instance of the class in which the window procedure exists
  • hIcon 0 (Provides a handle to the class resource.) By default, the application must create an icon if the application's window is minimized.
  • hCursor IDC_ARROW (provides a handle to a cursor resource)
  • hbrBackground COLOR_WINDOW + 1 (the system background color)
  • lpszMenuName 0 (Points to a string that contains the name of the class's menu.) By default, the windows in this class have no assigned menus.
  • lpszClassName Points to a string that contains the name of the window class.
  • lpfnWndProc The address of the window procedure. This value is not used by ObjectWindows.
  • style Style field.

The style field can contain one or more of the following values:

  • CS_BYTEALIGNCLIENT Aligns the window's client on a byte boundary in the x direction. This alignment, designed to improve performance, determines the width and horizontal position of the window.
  • CS_BYTEALIGNWINDOW Aligns a window on a byte boundary in the x direction. This alignment, designed to improve performance, determines the width and horizontal position of the window.
  • CS_CLASSDC Allocates a single device context (DC) that's going to be shared by all of the window in the class. This style controls how multi-threaded applications that have windows belonging to the same class share the same DC.
  • CS_DBLCLKS Sends a double-click mouse message to the window procedure when the mouse is double-clicked on a window belonging to this class.
  • CS_GLOBALCLASS Allows an application to create a window class regardless of the instance parameter. You can also create a global class by writing a DLL that contains the window class.
  • CS_HREDRAW If the size of the window changes as a result of some movement or resizing, redraws the entire window.
  • CS_NOCLOSE Disables the Close option on this window's system menu.
  • CS_OWNDC Enables each window in the class to have a different DC.
  • CS_PARENTDC Passes the parent window's DC to the child windows.
  • CS_SAVEBITS Saves the section of the screen as a bitmap if the screen is covered by another window. This bitmap is later used to recreate the window when it is no longer obscured by another window.
  • CS_VREDRAW If the height of the client area is changed, redraws the entire window.

After the Windows class structure has been filled with default values by the base class, you can override this function to change the values of the Windows class structure. For example, you might want to change the window's colors or the cursor displayed.

Register unique classes for windows that want system background colors so that full-drag erasing uses the right color (NT fails to let window erase itself)

Reimplemented in owl::TDialog, owl::TGlyphButton, owl::TGridPicker, owl::TPopupPicker, owl::TPictureWindow, and owl::TUrlLink.

References GetClassName(), GetModule(), owl::TColor::Index(), InitWndProc(), owl::TColor::IsSysColor(), owl::TColor::None, and owl::TColor::Transparent.

HFONT owl::TWindow::GetWindowFont ( ) [inline]

Gets the font the control uses to draw text. The return value is a handle of the font the control uses. If a system default font is being used, GetWindowFont returns NULL.

Note:
Wrapper for Windows API.

References GetHandle(), and SendMessage().

long owl::TWindow::GetWindowLong ( int  index) const [inline]

Retrieves information about the window depending on the value stored in index. The values returned, which provide information about the window, include the following GWL_Xxxx window style constants:

  • GWL_EXSTYLE The extended window style
  • GWL_STYLE The window style (position, device context creation, size, and so on)
Note:
The constants GWL_WNDPROC, GWL_HINSTANCE, GWL_HWDPARENT, GWL_USERDATA should not be used anymore. They are replaced with GWLP_WNDPROC, GWLP_HINSTANCE, GWLP_HWNDPARENT, GWLP_USERDATA which should be passed to GetWindowLongPtr()/SetWindowLongPtr()

In the case of a dialog box, additional information can be retrieved, such as:

  • DWL_DLGPROC The address of the procedure processed by the dialog box
  • DWL_MSGRESULT The value that a message processed by the dialog box returns
  • DWL_USER Additional information that pertains to the application, such as pointers or handles the application uses.

References GetHandle().

LONG_PTR owl::TWindow::GetWindowLongPtr ( int  index) const [inline]

Retrieves information about the window depending on the value stored in index. The values returned, which provide information about the window, include the following GWLP_Xxxx window style constants:

  • GWLP_WNDPROC The address of the window procedure being processed
  • GWLP_HINSTANCE GWLP_HWNDPARENT GWLP_USERDATA GWLP_ID

References GetHandle().

bool owl::TWindow::GetWindowPlacement ( WINDOWPLACEMENT *  place) const [inline]

Retrieves display and placement information (normal, minimized, and maximized positions) about the window and stores that information in the argument, place.

Note:
Wrapper for Windows API.

References GetHandle().

TWindow * owl::TWindow::GetWindowPtr ( HWND  hWnd) const [inline, protected]

Calls TApplication:GetWindowPtr on the application associated with this window. Then, given the handle to this window (hWnd), GetWindowPtr returns the TWindow pointer associated with this window.

References GetApplication().

void owl::TWindow::GetWindowRect ( TRect rect) const

Gets the screen coordinates of the window's rectangle and copies them into rect.

Note:
Gets the window rectangle whether it has been created or not

References GetHandle(), GetWindowRect(), owl::TWindowAttr::H, owl::TRect::SetWH(), owl::TWindowAttr::W, owl::TWindowAttr::X, and owl::TWindowAttr::Y.

TRect owl::TWindow::GetWindowRect ( ) const [inline]

Gets the screen coordinates of the window's rectangle.

Note:
Wrapper for Windows API.
HTASK owl::TWindow::GetWindowTask ( ) const [inline]

Returns a handle to the task that created the specified window.

Note:
Wrapper for Windows API.

References GetHandle().

tstring owl::TWindow::GetWindowText ( ) const

String-aware overload.

References GetWindowTextLength().

int owl::TWindow::GetWindowText ( TCHAR *  str,
int  maxCount 
) const [inline]

Copies the window's title into a buffer pointed to by string. maxCount indicates the maximum number of characters to copy into the buffer. A string of characters longer than maxCount is truncated. GetWindowText returns the length of the string or 0 if no title exists.

Note:
Wrapper for Windows API.

References GetHandle(), and GetWindowText().

int owl::TWindow::GetWindowTextLength ( ) const [inline]

Returns the length, in characters, of the specified window's title. If the window is a control, returns the length of the text within the control. If the window does not contain any text, GetWindowTextLength returns 0.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::GetWindowTextTitle ( ) [protected]

Updates the TWindow internal caption (Title) from the current window's caption. GetWindowTextTitle is used to keep Title synchronized with the actual window state when there is a possibility that the state might have changed.

References GetWindowText(), and GetWindowTextLength().

uint16 owl::TWindow::GetWindowWord ( int  index) const [inline]

Retrieves information about this window depending on the value of index. GetWindowWord returns one of the following values that indicate information about the window:

  • GWW_HINSTANCE The instance handle of the module owning the window
  • GWW_HWNDPARENT The handle of the parent window
  • GWW_ID The ID number of the child window

References GetHandle().

void owl::TWindow::HideCaret ( ) [inline]

Removes the caret from the specified display screen. The caret is hidden only if the current task's window owns the caret. Although the caret is not visible, it can be displayed again using ShowCaret.

Note:
Wrapper for Windows API.

References GetHandle().

bool owl::TWindow::HiliteMenuItem ( HMENU  hMenu,
uint  idItem,
uint  hilite 
) [inline]

Either highlights or removes highlighting from a top-level item in the menu. idItem indicates the menu item to be processed. hilite (which contains a value that indicates if the idItem is to be highlighted or is to have the highlight removed) can be one or more of the following constants:

  • MF_BYCOMMAND The idItem parameter contains the menu item's identifier.
  • MF_BYPOSITION The idItem parameter contains the zero-based relative position of the menu item.
  • MF_HILITE Highlights the menu item. If this value is not specified, highlighting is removed from the item.
  • MF_UNHILITE Removes the menu item's highlighting. If the menu is set to the specified condition, HiliteMenuItem returns true; otherwise, it returns false.
Note:
Wrapper for Windows API.

References GetHandle().

bool owl::TWindow::HoldFocusHWnd ( HWND  hLose,
HWND  hGain 
) [virtual]

Responds to a request by a child window to hold its HWND when it is losing focus. Stores the child's HWND in HoldFocusHwnd.

Note:
Regular windows never hold focus child handles--just say no.

Reimplemented in owl::TFrameWindow.

bool owl::TWindow::IdleAction ( long  idleCount) [virtual]

Called when no messages are waiting to be processed, IdleAction performs idle processing as long as true is returned. idleCount specifies the number of times idleAction has been called between messages.

Propagate idle action to all children if count==0, and to any children that previously said they wanted more time.

Reimplemented in owl::TDialog, owl::TFrameWindow, owl::TGadgetWindow, owl::TTraceWindow, and ocf::TOleDialog.

References ClearFlag(), GetFirstChild(), IdleAction(), IsFlagSet(), Next(), SetFlag(), and owl::wfPropagateIdle.

void owl::TWindow::Init ( HWND  handle,
TModule module 
) [protected]

Wrapper initialization of a default constructed TWindow. Is ignored if called more than once.

References GetHWndState(), GetParentH(), GetWindowPtr(), GetWindowTextTitle(), SetCaption(), SetFlag(), SetHandle(), SubclassWindowFunction(), owl::wfAlias, and owl::wfFullyCreated.

void owl::TWindow::Init ( TWindow parent,
LPCTSTR  title,
TModule module 
) [protected]

Normal initialization of a default constructed TWindow. Is ignored if called more than once.

Reimplemented in owl::TDialog, and owl::TLayoutWindow.

References EnableAutoCreate(), owl::TWindowAttr::ExStyle, owl::TWindowAttr::H, owl::TWindowAttr::Id, SetCaption(), owl::TWindowAttr::Style, owl::TWindowAttr::W, owl::TWindowAttr::X, and owl::TWindowAttr::Y.

TResult CALLBACK owl::TWindow::InitWndProc ( HWND  hWnd,
uint  msg,
TParam1  param1,
TParam2  param2 
) [static, protected]

Callback process for hooking TWindow to native window.

Initial WndProc called when an OWL window is first created. Subclasses the window function by installing the window proc then calls the window proc to get this first message to the window.

References DefWindowProc(), SetHandle(), and SubclassWindowFunction().

void owl::TWindow::Invalidate ( bool  erase = true) [inline, virtual]

Invalidates (mark for painting) the entire client area of a window. The window then receives a message to redraw the window. By default, the background of the client area is marked for erasing.

Note:
Wrapper for Windows API.

References GetHandle(), and InvalidateRect().

void owl::TWindow::InvalidateRect ( const TRect rect,
bool  erase = true 
) [inline, virtual]

Invalidates a specified client area. By default, the background of the client area to be invalidated is marked for erasing.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::InvalidateRgn ( HRGN  hRgn,
bool  erase = true 
) [inline]

Invalidates a client area within a region specified by the hRgn parameter when the application receives a WM_PAINT message. The region to be invalidated is assumed to have client coordinates. If hRgn is 0, the entire client area is included in the region to be updated. The parameter erase specifies whether the background with the update region needs to be erased when the region to be updated is determined. If erase is true, the background is erased; if erase is false, the background is not erased when the Paint function is called. By default, the background within the region is marked for erasing.

Note:
Wrapper for Windows API.

References GetHandle().

bool owl::TWindow::IsChild ( HWND  hWnd) const [inline]

Returns true if the window is a child window or a descendant window of this window. A window is considered a child window if it is the direct descendant of a given parent window and the parent window is in a chain of windows leading from the original overlapped or pop-up window down to the child window. hWnd identifies the window to be tested.

Note:
Wrapper for Windows API.

References GetHandle().

uint owl::TWindow::IsDlgButtonChecked ( int  buttonId) const [inline]

Indicates if the child button specified in the integer parameter, buttonId, is checked, or if a button is grayed, checked, or neither. If the return value is 0, the button is unchecked. If the return value is 1, the button is checked. If the return value is 3, the button state is undetermined. This function sends a BM_GETCHECK message to the specified button control.

Note:
Wrapper for Windows API.

References GetHandle().

bool owl::TWindow::IsFlagSet ( uint  mask) [inline]

Returns the state of the bit flag in Attr.Flags whose mask is supplied. Returns true if the bit flag is set, and false if not set.

bool owl::TWindow::IsIconic ( ) const [inline]

Returns true if window is iconic or minimized.

Note:
Wrapper for Windows API.

References GetHandle().

bool owl::TWindow::IsWindow ( ) const [inline]

Returns true if an HWND is being used.

References GetHandle().

bool owl::TWindow::IsWindowEnabled ( ) const [inline]

Returns true if the window is enabled. Use the function EnableWindow to enable or disable a window.

Note:
Wrapper for Windows API.

References GetHandle().

bool owl::TWindow::IsWindowVisible ( ) const [inline]

Returns true if the window is visible. By default, TWindow's constructor sets the window style attribute (WS_VISIBLE) so that the window is visible.

Note:
Wrapper for Windows API.

References GetHandle(), and owl::TWindowAttr::Style.

bool owl::TWindow::IsZoomed ( ) const [inline]

Returns true if window is zoomed or maximized.

Note:
Wrapper for Windows API.

References GetHandle().

bool owl::TWindow::KillTimer ( UINT_PTR  timerId) [inline]

Gets rid of the timer and removes any WM_TIMER messages from the message queue. timerId contains the ID number of the timer event to be killed.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::LoadAcceleratorTable ( ) [protected]

Loads a handle to the window's accelerator table specified in the TWindowAttr structure (Attr.AccelTable). If the accelerator does not exist, LoadAcceleratorTable produces an "Unable to load accelerator table" diagnostic message.

References owl::TWindowAttr::AccelTable, and GetModule().

tstring owl::TWindow::LoadString ( uint  id) const [inline]

Convenience functions - forwards the call to the module associated with this window.

References owl::TModule::LoadString().

bool owl::TWindow::LockWindowUpdate ( bool  lock = true) [inline]

Prevents or enables window drawing for one window at a time. If the window is locked, returns true; otherwise, returns false, which indicates either that an error occurred or that some other window is already locked. If any drawing is attempted within a locked window or locked child windows, the extent of the attempted operation is saved within a bounding rectangle. When the window is then unlocked, the area within the rectangle is invalidated, causing a paint message to be sent to this window. If any drawing occurred while the window was locked for updates, the area is invalidated.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::MapWindowPoints ( HWND  hWndTo,
TPoint points,
int  count 
) const [inline]

Maps a set of points in one window to a relative set of points in another window. hWndTo specifies the window to which the points are converted. points points to the array containing the points. If hWndTo is 0, the points are converted to screen coordinates. count specifies the number of points structures in the array.

Note:
Wrapper for Windows API.

References GetHandle().

int owl::TWindow::MessageBox ( LPCTSTR  text,
LPCTSTR  caption = 0,
uint  flags = MB_OK 
)

Creates and displays a message box that contains a message (text), a title (caption), and icons or push buttons (type). If caption is 0, the default title is displayed. Although flags is set to one push button by default, it can contain a combination of the MB_Xxxx message constants. This function returns one of the following constants:

  • IDABORT User selected the abort button.
  • IDCANCEL User selected the cancel button.
  • IDIGNORE User selected the ignore button.
  • IDNO User selected the no button.
  • IDOK User selected the OK button
  • IDRETRY User selected the retry button.
  • IDYES User selected the yes button.

References GetApplication(), and GetHandle().

bool owl::TWindow::ModifyExStyle ( uint32  offBits,
uint32  onBits,
uint  swpFlags = 0 
)

Modifies the style bits of the window.

References GetExStyle(), SetExStyle(), and SetWindowPos().

bool owl::TWindow::ModifyStyle ( uint32  offBits,
uint32  onBits,
uint  swpFlags = 0 
)

Modifies the style bits of the window.

References GetHandle(), GetStyle(), SetStyle(), and SetWindowPos().

bool owl::TWindow::MoveWindow ( int  x,
int  y,
int  w,
int  h,
bool  repaint = false 
) [inline]

Repositions the specified window. x and y specify the new upper left coordinates of the window; w and h specify the new width and height, respectively. If repaint is false, the window is not repainted after it is moved.

Note:
MoveWindow calls thru TWindow::SetWindowPos to allow moving before creation

References SetWindowPos().

bool owl::TWindow::MoveWindow ( const TRect rect,
bool  repaint = false 
) [inline]

Repositions the window. rect references the left and top coordinates and the width and height of the new screen rectangle. If repaint is false, the window is not repainted after it is moved.

References owl::TRect::Height(), MoveWindow(), and owl::TRect::Width().

TWindow * owl::TWindow::Next ( ) [inline]

Returns a pointer to the next sibling window in the window's sibling list.

unsigned owl::TWindow::NumChildren ( ) const

Returns the number of child windows of the window.

owl::TWindow::operator HWND ( ) const [inline]

Allows a TWindow& to be used as an HWND in Windows API calls by providing an implicit conversion from TWindow to HWND.

References GetHandle().

void owl::TWindow::Paint ( TDC dc,
bool  erase,
TRect rect 
) [virtual]

Repaints the client area (the area you can use for drawing) of a window. Called by base classes when responding to a WM_PAINT message, Paint serves as a placeholder for derived types that define Paint member functions. Paint is called by EvPaint and requested automatically by Windows to redisplay the window's contents. dc is the paint display context supplied to text and graphics output functions. The supplied reference to the rect structure is the bounding rectangle of the area that requires painting. erase indicates whether the background needs erasing.

Reimplemented in owl::TGadgetWindow, owl::TGauge, owl::TGlyphButton, owl::TNoteTab, owl::TGridPicker, owl::TPopupPicker, owl::TColorPicker, owl::TPictureWindow, owl::TPreviewPage, owl::TRichEditPagePreview, owl::TSplitter, and owl::TUrlLink.

TWindow::TPerformCreateReturnType owl::TWindow::PerformCreate ( int  arg = 0) [protected, virtual]

Called from Create to perform the final step in creating an Windows interface element to be associated with a TWindow. PerformCreate can be overridden to provide alternate implementations.

In strict mode we ignore the argument passed, and we build the menu-or-id parameter to CreateWindowEx purely based on TWindow data members. In old mode we treat the argument like before and assume that it is already a composed menu-or-id union. In case it represents a menu, we take ownership of the allocated menu (which should have been created by the caller).

Reimplemented in owl::TCommonDialog, owl::TDialog, owl::TFindReplaceDialog, owl::TFindDialog, owl::TReplaceDialog, owl::TMDIFrame, owl::TMDIChild, and owl::TUpDown.

References owl::TWindowAttr::ExStyle, GetClassName(), GetHandle(), GetModule(), owl::TWindowAttr::H, owl::TWindowAttr::Menu, owl::TWindowAttr::Param, owl::TWindowAttr::Style, owl::TWindowAttr::W, owl::TWindowAttr::X, and owl::TWindowAttr::Y.

void owl::TWindow::PerformSetupAndTransfer ( ) [protected]

Ensures that the window is fully set up; then transfers data into the window.

References SetFlag(), SetupWindow(), owl::tdSetData, TransferData(), and owl::wfFullyCreated.

bool owl::TWindow::PostMessage ( uint  msg,
TParam1  p1 = 0,
TParam2  p2 = 0 
) [inline]

Posts a message (msg) to the window in the application's message queue. PostMessage returns without waiting for the corresponding window to process the message.

Note:
Wrapper for Windows API.

References GetHandle().

bool owl::TWindow::PreProcessMsg ( MSG &  msg) [virtual]

Called from TApplication::ProcessAppMsg() to give the window an opportunity to perform preprocessing of the Windows message

If you return true, further processing of the message is halted

Allows preprocessing of queued messages prior to dispatching. If you override this method in a derived class, be sure to call the base class's PreProcessMsg because it handles the translation of accelerator keys.

Reimplemented in owl::TDecoratedFrame, owl::TDialog, owl::TFrameWindow, owl::TGadgetWindow, owl::TMDIClient, owl::TMDIChild, owl::TGridPicker, owl::TPropertySheet, owl::TUrlLink, and ocf::TOleDialog.

References GetHandle(), IsChild(), IsWindow(), and owl::TTooltip::RelayEvent().

TWindow * owl::TWindow::Previous ( )

Returns a pointer to the TWindow's previous sibling (the window previous to the TWindow in its parent's child window list)

If the TWindow was the first child added to the list, returns a pointer to the last child added

References Next().

bool owl::TWindow::RedrawWindow ( TRect update,
HRGN  hUpdateRgn,
uint  redraw = RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE 
) [inline]

Redraws the rectangle specified by update and the region specified by hUpdateRgn. redrawFlags can be a combination of one or more of the following RDW_Xxxx Redraw Window constants used to invalidate or validate a window:

Flags that invalidate a window

  • RDW_ERASE When the window is repainted, it receives a WM_ERASEBKGND message. If
  • RDW_INVALIDATE is not also specified, this flag has no effect.
  • RDW_FRAME Any part of the non-client area of the window receives a WM_NCPAINT message if it intersects the region to be updated.
  • RDW_INTERNALPAINT A WM_PAINT message is posted to the window whether or not it contains an invalid region.
  • RDW_INVALIDATE Invalidates either hUpdateRgn or update. In cases where both are 0, the entire window becomes invalid.

Flags that validate a window

  • RDW_NOERASE The window is prevented from receiving any WM_ERASEBKGND messages.
  • RDW_NOFRAME The window is prevented from receiving any WM_NCPAINT messages. The flag RDW_VALIDATE must also be used with this flag.
  • RDW_NOINTERNALPAINT The window is prevented from receiving internal WM_PAINT messages, but does not prevent the window from receiving WM_PAINT messages from invalid regions.
  • RDW_VALIDATE Validates update and hUpdateRgn. However, if both are 0, the entire window area is validated. The flag does not have any effect on internal WM_PAINT messages.

Flags that control when the window is repainted

  • RDW_ERASENOW Before the function returns, the specified windows will receive WM_NCPAINT and WM_ERASEBKGND messages.
  • RDW_UPDATENOW Before the function returns, the specified windows will receive WM_NCPAINT, WM_ERASEBKGND, as well as WM_PAINT messages.
Note:
Wrapper for Windows API.

References GetHandle().

bool owl::TWindow::Register ( ) [virtual]

Registers the Windows registration class of this window, if this window is not already registered. Calls GetClassName and GetWindowClass to retrieve the Windows registration class name and attributes of this window. Register returns true if this window is registered.

References GetClassName(), GetModule(), and GetWindowClass().

bool owl::TWindow::RegisterHotKey ( int  idHotKey,
uint  modifiers,
uint  virtKey 
) [inline]

Registers a hotkey ID with the current application. modifiers can be a combination of keys that must be pressed to activate the specified hotkey, such as HOTKEYF_SHIFT, HOTKEYF_CONTROL, and HOTKEYF_ALT.

References GetHandle().

void owl::TWindow::ReleaseCapture ( ) [inline, static]

Releases the mouse capture from this window.

Note:
Wrapper for Windows API.
void owl::TWindow::RemoveChild ( TWindow child) [protected, virtual]

Removes a child window. Uses the ObjectWindows list of objects rather the Window's HWND list.

Reimplemented in owl::TDecoratedFrame, owl::TFrameWindow, and owl::TLayoutWindow.

HANDLE owl::TWindow::RemoveProp ( uint16  atom) const [inline]

Removes the property specified by atom from the application's property list. atom indicates the string to be removed. Returns the handle of the given string or NULL if no string exists in the window's property list.

Note:
Wrapper for Windows API.

References GetHandle().

HANDLE owl::TWindow::RemoveProp ( LPCTSTR  str) const [inline]

Removes the property specified by str, a null-terminated string, from the application's property list. Returns the handle of the given string or NULL if no string exists in the window's property list.

Note:
Wrapper for Windows API.

References GetHandle(), and RemoveProp().

void owl::TWindow::RouteCommandEnable ( HWND  hInitCmdTarget,
TCommandEnabler commandEnabler 
)

Walks the chain of windows from the initial target window to this window. If it finds a window to receive the message, RouteCommandEnable dispatches the command enabler to that window. hInitCmdTarget is the handle to the initial command target window, which can be focus window but does not need to be. ce is a reference to the command enabler. Other classes use this function to perform particular command enabling tasks: For example, TFrameWindow calls RouteCommandEnable to perform the majority of its menu command enabling tasks. When it is an embedded window, TOleWindow also uses RouteCommandEnable to perform command enabling.

Don't process for windows out of our window tree (esp. other apps)

References owl::TCommandEnabler::Enable(), EvCommandEnable(), owl::TEventHandler::Find(), GetApplication(), owl::TCommandEnabler::GetHandled(), owl::TCommandEnabler::GetId(), GetParent(), GetWindowPtr(), owl::TCommandEnabler::IsReceiver(), and owl::TCommandEnabler::SendsCommand().

void owl::TWindow::ScreenToClient ( TPoint point) const [inline]

Uses the screen coordinates specified in point to calculate the client window's coordinates and then places the new coordinates into point.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::ScrollWindow ( int  dx,
int  dy,
const TRect scroll = 0,
const TRect clip = 0 
) [inline]

Scrolls a window in the vertical (dx) and horizontal (dy) directions. scroll indicates the area to be scrolled. If 0, the entire client area is scrolled. clip specifies the clipping rectangle to be scrolled. Only the area within clip is scrolled. If clip is 0, the entire window is scrolled.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::ScrollWindowEx ( int  dx,
int  dy,
const TRect scroll = 0,
const TRect clip = 0,
HRGN  hUpdateRgn = 0,
TRect update = 0,
uint  flags = 0 
) [inline]

Scrolls a window in the vertical (dx) and horizontal (dy) directions. scroll indicates the area to be scrolled. If 0, the entire client area is scrolled. clip specifies the clipping rectangle to be scrolled. Only the area within clip is scrolled. If clip is 0, the entire window is scrolled. update indicates the region that will receive the boundaries of the area that becomes invalidated as a result of scrolling. flags, which determines how the window's children are scrolled, can be one of the following SW_Xxxx Scroll Window constants:

  • SW_ERASE Erases the invalidated region after sending an erase background message to the window indicated by the SW_INVALIDATE flag value.
  • SW_INVALIDATE Invalidates the region indicated by the hUpdate parameter.
  • SW_SCROLLCHILDREN Scrolls all the child window intersecting the rectangle pointed to by the scroll parameter.
Note:
Wrapper for Windows API.

References GetHandle().

TResult owl::TWindow::SendDlgItemMessage ( int  childId,
uint  msg,
TParam1  p1 = 0,
TParam2  p2 = 0 
) [inline]

Sends a message (msg) to the control specified in childId.

Note:
Wrapper for Windows API.

References GetHandle().

TResult owl::TWindow::SendMessage ( uint  msg,
TParam1  param1 = 0,
TParam2  param2 = 0 
) const

Sends a message (msg) to a specified window or windows. After it calls the window procedure, it waits until the window procedure has processed the message before returning.

References GetHandle().

void owl::TWindow::SendNotification ( HWND  receiver,
int  id,
int  notifyCode,
HWND  hCtl,
uint  msg = WM_COMMAND 
) [inline]

Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application.

References IsWindow(), and SendMessage().

void owl::TWindow::SendNotification ( int  id,
int  notifyCode,
HWND  hCtl,
uint  msg = WM_COMMAND 
) [inline]

Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application.

References SendMessage().

TResult owl::TWindow::SendNotification ( int  id,
NMHDR &  nmhdr,
uint  msg = WM_NOTIFY 
) [inline]

Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application.

References SendMessage().

TResult owl::TWindow::SendNotification ( HWND  receiver,
uint  id,
NMHDR &  nmhdr,
uint  msg = WM_NOTIFY 
) [inline]

Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regardless of whether this is a WIN16 or WIN32 application.

References SendMessage().

HWND owl::TWindow::SetActiveWindow ( ) [inline]

Activates a top-level window. Returns a handle to the previously active window.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::SetBkgndColor ( const TColor color) [inline]

Sets the background color for the window. You can also get the current color of an element displayed on the screen. For example, layout -> SetBkgndColor(GetSysColor(COLOR_APPWORKSPACE));

Uses one of the Windows COLOR values (in this case, the color of multiple document interface (MDI) applications).

Reimplemented in owl::TGauge, owl::TProgressBar, and owl::TRichEdit.

void owl::TWindow::SetCaption ( LPCTSTR  title)

Copies title to an allocated string pointed to by title. Sets the caption of the interface element to title. Deletes any previous title. If the given title is 0, then the internal caption is initialized to 0, and no update of the interface element is done.

Reimplemented in owl::TPropertySheet.

References GetHandle(), and SetWindowText().

void owl::TWindow::SetCaption ( uint  resourceStringId)

Sets the window title to the resource string identified by the given id.

References LoadString(), and SetCaption().

HWND owl::TWindow::SetCapture ( ) [inline]

Sets the mouse capture to the current window. All mouse input is directed to this window.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::SetCaretBlinkTime ( uint16  milliSecs) [inline, static]

Sets the caret blink rate in milliseconds.

Note:
Wrapper for Windows API.
void owl::TWindow::SetCaretPos ( int  x,
int  y 
) [inline, static]

Sets the position of the caret in the coordinates of the client window. x and y indicate the client coordinates of the caret.

Note:
Wrapper for Windows API.
void owl::TWindow::SetCaretPos ( const TPoint pos) [inline, static]

Sets the position of the caret in the coordinates of the client window. pos indicates the client coordinates of the caret.

Note:
Wrapper for Windows API.

References SetCaretPos().

long owl::TWindow::SetClassLong ( int  index,
long  newLong 
) [inline]

Sets the long value at the specified offset (index). Depending on the value of index, SetClassLong sets a handle to a background brush, cursor, icon, module, menu, window function, or extra class bytes.

References GetHandle().

uint16 owl::TWindow::SetClassWord ( int  index,
uint16  newWord 
) [inline]

Sets the word value at the specified offset (index). Depending on the value of index, SetClassLong sets the number of bytes of class information, of additional window information, or the style bits. Unlike SetClassLong, SetClassWord uses one of the following GCW_xxxx Class Word constants:

  • GCW_HBRBACKGROUND Sets a handle for a background brush.
  • GCW_HCURSOR Sets a handle of a cursor.
  • GCW_HICON Sets a handle of an icon.
  • GCW_STYLE Sets a style bit for a window class.

References GetHandle().

bool owl::TWindow::SetCursor ( TModule module,
TResId  resId 
)

Sets the cursor position for the window using the given module and ResId. If the module parameter is 0, CursorResId can be one of the IDC_xxxx constants that represent different kinds of cursors. See the data member for a list of these cursor values. If the mouse is over the client area, SetCursor changes the cursor that is displayed.

References GetClientRect(), GetCursorPos(), GetHandle(), owl::TModule::LoadCursor(), and ScreenToClient().

void owl::TWindow::SetDlgItemInt ( int  childId,
uint  value,
bool  isSigned = true 
) const [inline]

Sets the child window with the Id (childId) in the window to the integer value specified in value. If isSigned is true, the value is signed.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::SetDlgItemText ( int  childId,
LPCTSTR  text 
) const [inline]

Sets the title or text of a control in a dialog box. childId identifes the control. text points to the text buffer containing the text that is to be copied into the control.

Note:
Wrapper for Windows API.

References GetHandle().

bool owl::TWindow::SetDocTitle ( LPCTSTR  docname,
int  index 
) [virtual]

Default behavior for updating document title is to pass it to parent frame

Stores the title of the document (docname). index is the number of the view displayed in the document's caption bar. In order to determine what the view number should be, SetDocTitle makes two passes: the first pass checks to see if there's more than one view, and the second pass, if there is more than one view, assigns the next number to the view. If there is only one view, index is 0; therefore, the document does not display a view number. When TDocument is checking to see if more than one view exists, index is -1. In such cases, only the document's title is displayed in the caption bar. SetDocTitle returns true if there is more than one view and TDocument displays the number of the view passed in index.

Reimplemented in owl::TTreeViewCtrlView, owl::TListViewCtrlView, owl::TWindowView, owl::TDialogView, owl::TEditView, owl::TFrameWindow, owl::TListBoxView, owl::TPaneSplitterView, owl::TRichEditView, owl::TTabbedView, ocf::TOleView, and ocf::TRemViewBucket.

References SetDocTitle().

uint32 owl::TWindow::SetExStyle ( uint32  style)

Sets the extra style bits of the window.

References owl::TWindowAttr::ExStyle, GetHandle(), and SetWindowLong().

void owl::TWindow::SetFlag ( uint  mask) [inline]

Sets the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer, and so on) in the Flags member.

HWND owl::TWindow::SetFocus ( ) [inline]

Sets the keyboard focus to current window and activates the window that receives the focus by sending a WM_SETFOCUS message to the window. All future keyboard input is directed to this window, and any previous window that had the input focus loses it. If successful, SetFocus returns a handle to the window that has the focus; otherwise, it returns NULL.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::SetHandle ( THandle  handle) [inline, protected]

Sets the window handle in a derived class. Used by derived classes that create their window handle in a class-specific way.

bool owl::TWindow::SetMenu ( HMENU  hMenu) [inline]

Sets the specified window's menu to the menu indicated by hMenu. If hMenu is 0, the window's current menu is removed. SetMenu returns 0 if the menu remains unchanged; otherwise, it returns a nonzero value.

Note:
Wrapper for Windows API.

Reimplemented in owl::TFrameWindow, and owl::TMDIFrame.

References GetHandle().

void owl::TWindow::SetModule ( TModule module) [inline]

Sets the default module for this window.

void owl::TWindow::SetNext ( TWindow next) [inline]

Sets the next window in the sibling list.

TWindow::TPerformCreateReturnType owl::TWindow::SetOrReturnHandle ( THandle  handle) [protected]

Utility function for either setting the passed handle or to just returning it, depending on build mode. See definition of TPerformCreateReturnType. This function is used by implementations of PerformCreate to write uniform code whatever the build mode.

References SetHandle().

void owl::TWindow::SetParent ( TWindow newParent) [virtual]

Sets the parent for the specified window by setting Parent to the specified new Parent window object. Removes this window from the child list of the previous parent window, if any, and adds this window to the new parent's child list.

References GetHandle(), GetParentH(), and RemoveChild().

bool owl::TWindow::SetProp ( uint16  atom,
HANDLE  data 
) const [inline]

Adds an item to the property list of the specified window. atom contains a value that identifies the data entry to be added to the property list.

Note:
Wrapper for Windows API.

References GetHandle().

bool owl::TWindow::SetProp ( LPCTSTR  str,
HANDLE  data 
) const [inline]

Adds an item to the property list of the specified window. str points to the string used to identify the entry data to be added to the property list.

Note:
Wrapper for Windows API.

References GetHandle(), and SetProp().

void owl::TWindow::SetRedraw ( bool  redraw) [inline]

Sends a WM_SETREDRAW message to a window so that changes can be redrawn (redraw = true) or to prevent changes from being redrawn (redraw = false).

Note:
Wrapper for Windows API.

References GetHandle(), and SendMessage().

void owl::TWindow::SetScroller ( TScroller scroller)

Sets the scroller object for this window. This window assumes ownership of the scroller object, and will delete it when done and on subsequent sets.

int owl::TWindow::SetScrollPos ( int  bar,
int  pos,
bool  redraw = true 
)

Sets the thumb position in the scroll bar. bar identifies the position (horizontal, vertical, or scroll bar control) to return and can be one of the SB_Xxxx scroll bar constants.

Note:
Wrapper for Windows API.

References GetHandle(), and GetScrollPos().

void owl::TWindow::SetScrollRange ( int  bar,
int  minPos,
int  maxPos,
bool  redraw = true 
)

Sets the thumb position in the scroll bar. bar identifies the position (horizontal, vertical, or scroll bar control) to set and can be one of the SB_Xxxx scroll bar constants. minPos and maxPos specify the lower and upper range, respectively, of the scroll bar positions.

Note:
Wrapper for Windows API.

References GetHandle().

uint32 owl::TWindow::SetStyle ( uint32  style)

Sets the style bits of the underlying window or the 'Style' member of the attribute structure associated with this TWindow object.

Reimplemented in owl::TTreeViewCtrl.

References GetHandle(), SetWindowLong(), and owl::TWindowAttr::Style.

UINT_PTR owl::TWindow::SetTimer ( UINT_PTR  timerId,
uint  timeout,
TIMERPROC  proc = 0 
) [inline]

Creates a timer object associated with this window. timerID contains the ID number of the timer to be created, timeout specifies the length of time in milliseconds, and proc identifies the address of the function that's to be notified when the timed event occurs. If proc is 0, WM_TIMER messages are placed in the queue of the application that called SetTimer for this window.

Note:
Wrapper for Windows API.

References GetHandle().

template<class TBuffer >
void owl::TWindow::SetTransferBuffer ( TBuffer *  transferBuffer) [inline]

Sets TransferBuffer and TransferBufferSize. The size is inferred from the type of the passed pointer.

Reimplemented in owl::TTransferBufferWindow< TBuffer >.

References SetTransferBuffer().

template<class TElement , uint Count>
void owl::TWindow::SetTransferBuffer ( TElement(&)  transferBuffer[Count]) [inline]

Sets TransferBuffer and TransferBufferSize. The size is inferred from the type of the passed array.

References SetTransferBuffer().

void owl::TWindow::SetTransferBuffer ( void *  transferBuffer,
uint  size 
) [inline]

Sets TransferBuffer and TransferBufferSize.

void owl::TWindow::SetupWindow ( ) [protected, virtual]

Performs setup following creation of an associated MS-Windows window.

The first virtual function called when the HWindow becomes valid. TWindow's implementation performs window setup by iterating through the child list, attempting to create an associated interface element for each child window object for which autocreation is enabled. (By default, autocreation is enabled for windows and controls, and disabled for dialog boxes.) If a child window cannot be created, SetupWindow calls TXWindow with an IDS_CHILDCREATEFAIL message.

If the receiver has a TScroller object, calls the scroller's SetBarRange() method.

SetupWindow can be redefined in derived classes to perform additional special initialization. Note that the HWindow is valid when the overridden SetupWindow is called, and that the children's HWindows are valid after calling the base classes' SetupWindow function.

The following example from the sample program, APPWIN.CPP, illustrates the use of an overridden SetupWindow to setup a window, initialize .INI entries, and tell Windows that we want to accept drag and drop transactions:

 void TAppWindow::SetupWindow()
 { 
   TFloatingFrame::SetupWindow();
   InitEntries();   // Initialize .INI entries.
   RestoreFromINIFile(); // from APPLAUNC.INI in the startup directory
   UpdateAppButtons();
   DragAcceptFiles(true);
 }

Reimplemented in owl::TButton, owl::TCheckList, owl::TTabCheckList, owl::TClipboardViewer, owl::TComboBoxEx, owl::TComboBox, owl::TCommonDialog, owl::TCoolBar, owl::TDecoratedFrame, owl::TDialog, owl::TEdgeSlip, owl::TDragList, owl::TEdit, owl::TEditFile, owl::TEditSearch, owl::TFlatComboBox, owl::TFlatEdit, owl::TFlatListBox, owl::TFrameWindow, owl::TGadgetWindow, owl::TGauge, owl::TGlyphButton, owl::TInputDialog, owl::TMemComboBox, owl::TNoteTab, owl::TPageScroller, owl::TPaneSplitter, owl::TGridPicker, owl::TColorPicker, owl::TPickListDialog, owl::TPreviewWin, owl::TPrinterAbortDlg, owl::TProgressBar, owl::TPropertySheet, owl::TRichEdit, owl::TRichEditView, owl::TRollDialog, owl::TScrollBar, owl::TSlider, owl::TSplashWindow, owl::TTraceWindow, owl::TUrlLink, owl::TFormattedStatic, ocf::TOleDialog, ocf::TOleFrame, and ocf::TOleWindow.

References Create(), CreateChildren(), GetApplication(), GetHandle(), GetParentO(), owl::TApplication::GetTooltip(), IsFlagSet(), ModifyStyle(), SetParent(), owl::TScroller::SetSBarRange(), owl::TScroller::SetWindow(), owl::tdSetData, TransferData(), and owl::wfMainWindow.

void owl::TWindow::SetWindowFont ( HFONT  font,
bool  redraw 
) [inline]

Sets the font that a control uses to draw text. font, which specifies the font being used, is NULL if the default system font is used. If redraw is true, the control redraws itself after the font is set; if false, the control does not redraw itself. See the sample program, FILEBROW.CPP, for an example of how to set the font for a file browser list box.

Note:
Wrapper for Windows API.

References GetHandle(), and SendMessage().

long owl::TWindow::SetWindowLong ( int  index,
long  newLong 
) [inline]

Changes information about the window. Depending on the value of index, SetWindowLong sets a handle to a background brush, cursor, icon, module, menu, or window function. The window style can be one of the GWL_xxxx values that represent styles.

References GetHandle().

LONG_PTR owl::TWindow::SetWindowLongPtr ( int  index,
LONG_PTR  newLong 
) [inline]

Changes information about the window. For a list of constants, see GetWindowLongPtr()

References GetHandle().

bool owl::TWindow::SetWindowPlacement ( const WINDOWPLACEMENT *  place) [inline]

Sets the window to a display mode and screen position. place points to a window placement structure that specifies whether the window is to be hidden, minimized or displayed as an icon, maximized, restored to a previous position, activated in its current form, or activated and displayed in its normal position.

Note:
Wrapper for Windows API.

References GetHandle().

bool owl::TWindow::SetWindowPos ( HWND  hWndInsertAfter,
int  x,
int  y,
int  w,
int  h,
uint  flags 
)

Set the new window position.

Changes the size of the window pointed to by x, y, w, and h. flags contains one of the SWP_Xxxx Set Window Position constants that specify the size and position of the window. If flags is set to SWP_NOZORDER, SetWindowPos ignores the hWndInsertAfter parameter and retains the current ordering of the child, pop-up, or top-level windows.

SWP_Xxxx Set Window Position Constants

  • SWP_DRAWFRAME Draws a frame around the window.
  • SWP_FRAMECHANGED Sends a message to the window to recalculate the window's size. If this flag is not set, a recalculate size message is sent only at the time the window's size is being changed.
  • SWP_HIDEWINDOW Hides the window.
  • SWP_NOACTIVATE Does not activate the window. If this flag is not set, the window is activated and moved to the top of the stack of windows.
  • SWP_NOCOPYBITS Discards the entire content area of the client area of the window. If this flag is not set, the valid contents are saved and copied into the window after the window is resized or positioned.
  • SWP_NOMOVE Remembers the window's current position.
  • SWP_NOSIZE Remembers the window's current size.
  • SWP_NOREDRAW Does not redraw any changes to the window. If this flag is set, no repainting of any window area (including client, nonclient, and any window part uncovered as a result of a move) occurs. When this flag is set, the application must explicitly indicate if any area of the window is invalid and needs to be redrawn.
  • SWP_NOZORDER Remembers the current Z-order (window stacking order).
  • SWP_SHOWWINDOW Displays the window.

References GetHandle(), owl::TWindowAttr::H, SetWindowPos(), owl::TWindowAttr::Style, owl::TWindowAttr::W, owl::TWindowAttr::X, and owl::TWindowAttr::Y.

bool owl::TWindow::SetWindowPos ( HWND  hWndInsertAfter,
const TRect rect,
uint  flags 
) [inline]

Changes the size of the window pointed to by rect. flags contains one of the SWP_Xxxx Set Window Position constants (described below) that specify the size and position of the window. If flags is set to SWP_NOZORDER, SetWindowPos ignores the hWndInsertAfter parameter and retains the current ordering of the child, pop-up, or top-level windows.

References owl::TRect::Height(), and owl::TRect::Width().

void owl::TWindow::SetWindowText ( uint  resourceStringId) [inline]

Sets the window title to the resource string identified by the given id.

References LoadString(), and SetWindowText().

void owl::TWindow::SetWindowText ( LPCTSTR  str) [inline]

Sets the window title to a buffer pointed to by str. maxCount indicates the number of characters to copy into the buffer. Note that this does not update this window's Title member. Use SetCaption if the window's Title member needs to be synchronized with the window's title.

Note:
Wrapper for Windows API.

References GetHandle().

uint16 owl::TWindow::SetWindowWord ( int  index,
uint16  newWord 
) [inline]

Changes information about the window. index specifies a byte offset of the word to be changed to the new value (newWord).

References GetHandle().

void owl::TWindow::ShowCaret ( ) [inline]

Displays the caret in the specified shape in the active window at the current position.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::ShowOwnedPopups ( bool  show) [inline]

Shows or hides all owned pop-up windows according to the value of show.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::ShowScrollBar ( int  bar,
bool  show = true 
) [inline]

Displays or hides the scroll bar. bar specifies whether the bar is a control itself or part of the window's nonclient area. If bar is part of the nonclient area, it can be one of the SB_Xxxx scroll bar constants (specifically, SB_BOTH, SB_HORZ, or SB_VERT). If it is a control, it should be SB_CTRL. If show is true, the scroll bar is displayed; if false, it is hidden.

Note:
Wrapper for Windows API.

References GetHandle().

bool owl::TWindow::ShowWindow ( int  cmdShow) [virtual]

Displays this TWindow in a given state. Can be called either before or after the Window is created. If before, the show state is placed into Attr for use at creation

After ensuring that the TWindow interface element has a valid handle, ShowWindow displays the TWindow on the screen in a manner specified by cmdShow, which can be one of the following SW_Xxxx Show Window constants:

  • SW_SHOWDEFAULT Show the window in its default configuration. Should be used at startup.
  • SW_HIDE Hide the window and activate another window.
  • SW_MINIMIZE Minimize the window and activate the top-level window in the list.
  • SW_RESTORE Same as SW_SHOWNORMAL.
  • SW_SHOW Show the window in the window's current size and position.
  • SW_SHOWMAXIMIZED Activate and maximize the window.
  • SW_SHOWMINIMIZED Activate window as an icon.
  • SW_SHOWNA Display the window as it is currently.
  • SW_SHOWMINNOACTIVE Display the window as an icon.
  • SW_SHOWNORMAL Activate and display the window in its original size and position.
  • SW_SHOWSMOOTH Show the window after updating it in a bitmap.

Reimplemented in owl::TMDIChild.

References GetHandle(), and owl::TWindowAttr::Style.

void owl::TWindow::ShutDownWindow ( TWindow win,
int  retVal = 0 
) [static]

This version of ShutDownWindow unconditionally shuts down a given window, calls Destroy on the interface element, and then deletes the interface object. Instead of using ShutDownWindow, you can call Destroy directly and then delete the interface object.

Note:
This function is static to avoid side effects of deleting 'this'.

References Destroy().

void owl::TWindow::ShutDownWindow ( int  retVal = 0) [inline]

This inline version of ShutDownWindow calls the static version of ShutDownWindow.

References ShutDownWindow().

void owl::TWindow::SubclassWindowFunction ( )

Installs the instance thunk as the WindowProc and saves the old window function in DefaultProc.

References DefWindowProc(), and GetHandle().

void owl::TWindow::TraceWindowPlacement ( )
Todo:
Make protected or private
uint owl::TWindow::Transfer ( void *  buffer,
TTransferDirection  direction 
) [virtual]

Transfers data to or from any window with or without children and returns the total size of the data transferred. Transfer is a general mechanism for data transfer that can be used with or without using TransferData. The direction supplied specifies whether data is to be read from or written to the supplied buffer, or whether the size of the transfer data is simply to be returned. Data is not transferred to or from any child windows whose wfTransfer flag is not set. The return value is the size (in bytes) of the transfer data.

Reimplemented in owl::TCheckBox, owl::TCheckList, owl::TColumnHeader, owl::TComboBoxEx, owl::TComboBox, owl::TDateTimePicker, owl::TEdit, owl::THotKey, owl::TIPAddress, owl::TListBox, owl::TMemComboBox, owl::TMonthCalendar, owl::TNoteTab, owl::TRichEdit, owl::TScrollBar, owl::TStatic, owl::TTabControl, owl::TTransferBufferWindowBase, and owl::TTreeViewCtrl.

References ForEach().

void owl::TWindow::TransferData ( TTransferDirection  direction) [virtual]

Transfers data between the TWindow's data buffer and the child windows in its ChildList (data is not transfered between any child windows whose wfTransfer flag is not set)

A window usually calls TransferData during setup and closing of windows and relies on the constructor to set TransferBuffer to something meaningful. TransferData calls the Transfer member function of each participating child window, passing a pointer to TransferBuffer as well as the direction specified in direction (tdSetData, tdGetData, or tdSizeData).

Reimplemented in owl::TInputDialog, owl::TTransferWindow< TDataSource >, and owl::TTransferBufferWindowBase.

References owl::TXWindow::Raise(), owl::tdSizeData, and Transfer().

bool owl::TWindow::UnregisterHotKey ( int  idHotKey) [inline]

Unregisters a hotkey ID with the current application.

References GetHandle().

void owl::TWindow::UpdateWindow ( ) [inline]

Updates the client area of the specified window by immediately sending a WM_PAINT message.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::Validate ( ) [inline]

Calls the function ValidateRect to validate (that is, remove from the area to be updated) the entire client area (the area you can use for drawing).

Note:
Wrapper for Windows API.

References GetHandle(), and ValidateRect().

void owl::TWindow::ValidateRect ( const TRect rect) [inline]

Validates a portion of the client area indicated by rect.

Note:
Wrapper for Windows API.

References GetHandle().

void owl::TWindow::ValidateRgn ( HRGN  hRgn) [inline]

Validates the client area within a region of the current window. hRgn is a handle to the client area that is to be removed from the region to be updated. If hRgn is NULL, the entire client area is removed from the region to be updated.

Note:
Wrapper for Windows API.

References GetHandle().

HWND owl::TWindow::WindowFromPoint ( const TPoint point) [inline, static]

Returns the handle of the window in which the specified point (point) lies.

Note:
Wrapper for Windows API.
TResult owl::TWindow::WindowProc ( uint  msg,
TParam1  param1,
TParam2  param2 
) [virtual]

First virtual function called to handling incoming messages to a TWindow.

Processes incoming messages by calling EvCommand to handle WM_COMMAND messages, EvCommandEnable to handle WM_COMMAND_ENABLE messages, and dispatching for all other messages.

References DefWindowProc(), owl::TEventHandler::Dispatch(), owl::TEventHandler::TEventInfo::Entry, EvCommand(), EvCommandEnable(), EvNotify(), owl::TEventHandler::Find(), GetApplication(), GetHandle(), IsFlagSet(), owl::TEventHandler::TEventInfo::Object, and owl::wfMainWindow.

bool owl::TWindow::WinHelp ( LPCTSTR  helpFile,
uint  command,
uint32  data 
) [inline]

Invokes a specified help system. helpFile points to a string containing the directory path and name of the help file. command, which indicates the type of help requested, can be one of the Windows Help_xxxx constants such as HELP_CONTEXT, HELP_HELPONHELP, HELP_INDEX, HELP_MULTIKEY, HELP_QUIT, or HELP_SETINDEX. data contains keywords that indicate the help topic items. For example, in the sample ObjectWindows file, HELP.CPP, WinHelp is called with the arguments HELP_CONTEXT and HELP_MENUITEMA if the F1 key is pressed.

 void TOwlHelpWnd::CmMenuItemA()
 { 
    if (F1Pressed) { 
      WinHelp(HelpFile, HELP_CONTEXT, HELP_MENUITEMA);
      F1Pressed = false;
 } else { 
      MessageBox("In Menu Item A command", Title, MB_ICONINFORMATION);
  }
 }

You can also include bitmaps in your Help file by referencing their file names or by copying them from the Clipboard. For more information about how to create Help files, see the online Help documentation.

Note:
Wrapper for Windows API.

References GetHandle().


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