OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TWindow Class Reference

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. More...

#include <owl/window.h>

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

Classes

class  TChildrenIteratorTemplate
 Utility class template used as an iterator type template for TChildrenRangeTemplate. More...
 
class  TChildrenRangeTemplate
 Utility class template used as a return type for TWindow::GetChildren. More...
 

Public Types

typedef HWND THandle
 TWindow encapsulates an HWND.
 
- Public Types inherited from owl::TEventHandler
typedef bool(* TEqualOperator) (const TGenericTableEntry &, const TEventInfo &)
 

Public Member Functions

void TraceWindowPlacement ()
 
 TWindow (TWindow *parent, LPCTSTR title=nullptr, TModule *module=nullptr)
 Adds this to the child list of parent if nonzero, and calls EnableAutoCreate so that this will be created and displayed along with parent.
 
 TWindow (TWindow *parent, const tstring &title, TModule *module=nullptr)
 String-aware overload.
 
 TWindow (HWND handle, TModule *module=nullptr)
 Constructs a TWindow that is used as an alias for a non-ObjectWindows window, and sets wfAlias.
 
virtual ~TWindow ()
 Destroys this window (unless this is an alias) and the children.
 
TApplicationGetApplication () const
 Gets a pointer to the TApplication object associated with this.
 
virtual bool Register ()
 Registers the Windows registration class of this window, if this window is not already registered.
 
TScrollerGetScroller ()
 Returns the associated scroller object for this window.
 
void SetScroller (TScroller *scroller)
 Sets the scroller object for this window.
 
virtual void CloseWindow (int retVal=0)
 Determines if it is okay to close a window before actually closing the window.
 
TWindowAttrGetWindowAttr ()
 Returns the TWindowAttr structure, which contains the window's creation attributes.
 
const TWindowAttrGetWindowAttr () const
 Returns the TWindowAttr structure, which contains the window's creation attributes.
 
LPCTSTR GetCaption () const
 Returns the Title member of TWindow.
 
virtual bool CanClose ()
 Use this function to determine if it is okay to close a window.
 
void ChildBroadcastMessage (TMsgId, TParam1=0, TParam2=0)
 Sends the specified message to all immediate children using SendMessage.
 
TResult HandleMessage (TMsgId, TParam1=0, TParam2=0)
 Dispatches the given message using the response table.
 
virtual TResult EvCommand (uint id, HWND hWndCtl, uint notifyCode)
 WindowProc calls EvCommand to handle WM_COMMAND messages.
 
virtual TResult EvNotify (uint id, TNotify &notifyInfo)
 Handles WM_NOTIFY and subdispatch messages from child controls.
 
TResult DefaultProcessing ()
 Handles default processing of events, which includes continued processing of menu/accelerators commands and enablers, as well as notifications.
 
virtual void Paint (TDC &dc, bool erase, TRect &rect)
 Repaints the client area (the area you can use for drawing) of a window.
 
void SubclassWindowFunction ()
 Installs the instance thunk as the WindowProc and saves the old window function in DefaultProc.
 
Query and set the Owl window flags.

Accepts TWindowFlag args, possibly or'd together.

void SetFlag (uint mask)
 Sets the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer, and so on) in the Flags member.
 
void ClearFlag (uint mask)
 Clears the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer, and so on) in the Flags member.
 
bool IsFlagSet (uint mask)
 Returns the state of the bit flag in Attr.Flags whose mask is supplied.
 
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 ()
 Ensures that an associated child window interface element is created and displayed along with its parent window.
 
void DisableAutoCreate ()
 Disables the feature that allows an associated child window interface element to be created and displayed along with its parent window.
 
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 ()
 Enables the transfer mechanism, which allows state data to be transferred between the window and a transfer buffer.
 
void DisableTransfer ()
 Disables (for the interface object) the transfer mechanism, which allows state data to be transferred to and from a transfer buffer.
 
Window's default module access functions
TModuleGetModule () const
 Returns a pointer to the module object.
 
void SetModule (TModule *module)
 Sets the default module for this window.
 
Convenience functions - forwards the call to the module associated with this window.
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 (TResId id) const
 
std::string LoadHtml (TResId id) const
 
Create/destroy an native window to be associated with this window
virtual bool Create ()
 Creates the window interface element to be associated with this ObjectWindows interface element.
 
bool CreateChildren ()
 Creates the child windows in the child list whose auto-create flags (with wfAutoCreate mask) are set.
 
virtual void Destroy (int retVal=0)
 Destroys an MS-Windows element associated with the TWindow.
 
Create a modal window, and perform actual modal execute call
virtual int Execute ()
 Creates the underlying HWND and makes it modal with the help of TApplication's BeginModal support.
 
virtual int DoExecute ()
 Do actual modal execution using the Begin/End Modal support of TApplication.
 
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)
 Called from TApplication::ProcessAppMsg() to give the window an opportunity to perform preprocessing of the Windows message.
 
virtual bool IdleAction (long idleCount)
 Called when no messages are waiting to be processed, IdleAction performs idle processing as long as true is returned.
 
virtual bool HoldFocusHWnd (HWND hLose, HWND hGain)
 Responds to a request by a child window to hold its HWND when it is losing focus.
 
Child and parenting
int GetId () const
 Returns Attr.Id, the ID used to find the window in a specified parent's child list.
 
auto ChildWithId (int id) const -> const TWindow *
 
auto ChildWithId (int id) -> TWindow *
 Returns a pointer to the window in the child window list that has the supplied id.
 
HWND GetParentH () const
 Return the handle of the parent.
 
TWindowGetParentO () const
 Return the OWL's parent for this window.
 
TWindowGetParent () const
 Retrieves the OWL object of the parent window. If none exists, returns 0.
 
virtual void SetParent (TWindow *newParent)
 Sets the parent for the specified window by setting Parent to the specified new Parent window object.
 
void SetNext (TWindow *next)
 Sets the next window in the sibling list.
 
Other attributes
virtual bool SetDocTitle (LPCTSTR docname, int index)
 Default behavior for updating document title is to pass it to parent frame.
 
bool SetDocTitle (const tstring &docname, int index)
 
void SetCaption (LPCTSTR title)
 Copies title to an allocated string pointed to by title.
 
void SetCaption (const tstring &title)
 
void SetCaption (uint resourceStringId)
 Sets the window title to the resource string identified by the given id.
 
bool SetCursor (TModule *module, TResId resId)
 Sets the mouse cursor for the window, loading the given resId from the given module.
 
auto GetBkgndColor () const -> TColor
 Returns the overriding background color set for the window.
 
void SetBkgndColor (TColor color, bool shouldUpdate=true)
 Sets the background color for the window.
 
auto GetTextColor () const -> TColor
 Returns the overriding text color set for the window.
 
void SetTextColor (TColor color, bool shouldUpdate=true)
 Sets the text color for the window.
 
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)
 Forwards the window's current message.
 
TResult ForwardMessage (bool send=true)
 Forwards the window's current message.
 
Notify a window (parent usually) of a child action.
void SendNotification (int id, int notifyCode, HWND hCtl, TMsgId=WM_COMMAND)
 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.
 
void SendNotification (HWND receiver, int id, int notifyCode, HWND hCtl, TMsgId=WM_COMMAND)
 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.
 
TResult SendNotification (int id, NMHDR &, TMsgId=WM_NOTIFY)
 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.
 
TResult SendNotification (HWND receiver, uint id, NMHDR &, TMsgId=WM_NOTIFY)
 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.
 
Windows message handlers

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

virtual TResult WindowProc (TMsgId, TParam1, TParam2)
 First virtual function called to handling incoming messages to a TWindow.
 
virtual TResult DefWindowProc (TMsgId, TParam1, TParam2)
 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.
 
Called by WindowProc() to handle WM_COMMAND_ENABLE, & helper function
virtual void EvCommandEnable (TCommandEnabler &ce)
 Called by WindowProc to handle WM_COMMAND_ENABLE messages, EvCommandEnable calls the CmXxxx command-handling function or calls DefaultProcessing to handle the incoming message.
 
void RouteCommandEnable (HWND hInitCmdTarget, TCommandEnabler &ce)
 Walks the chain of windows from the initial target window to this window.
 
Transfer buffer functionality
void SetTransferBuffer (void *transferBuffer, uint size)
 Sets TransferBuffer and TransferBufferSize.
 
template<class TBuffer >
void SetTransferBuffer (TBuffer *transferBuffer)
 Sets TransferBuffer and TransferBufferSize.
 
template<class TElement , uint Count>
void SetTransferBuffer (TElement(&transferBuffer)[Count])
 Sets TransferBuffer and TransferBufferSize.
 
voidGetTransferBuffer () const
 
uint GetTransferBufferSize () const
 
virtual uint Transfer (void *buffer, TTransferDirection direction)
 Transfers data to or from any window with or without children and returns the total size of the data transferred.
 
virtual void TransferData (TTransferDirection direction)
 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)
 
Allow a TWindow& to be used as an HWND in Windows API calls
HWND GetHandle () const
 Returns the handle of the window.
 
 operator HWND () const
 Allows a TWindow& to be used as an HWND in Windows API calls by providing an implicit conversion from TWindow to HWND.
 
bool IsWindow () const
 Returns true if an HWND is being used.
 
Window and class Words and Longs, window properties
auto GetClassName (TCHAR *className, int maxCount) const -> int
 Returns the Windows class name for this object's window handle.
 
long GetClassLong (int index) const
 Retrieves the 32-bit value containing information about the window class.
 
long SetClassLong (int index, long newLong)
 Sets the long value at the specified offset (index).
 
uint16 GetClassWord (int index) const
 Gets a 16-bit value containing information about the class or style of the window.
 
uint16 SetClassWord (int index, uint16 newWord)
 Sets the word value at the specified offset (index).
 
LONG_PTR GetWindowLongPtr (int index) const
 Retrieves information about the window depending on the value stored in index.
 
LONG_PTR SetWindowLongPtr (int index, LONG_PTR newLong)
 Changes information about the window. For a list of constants, see GetWindowLongPtr()
 
long GetWindowLong (int index) const
 Retrieves information about the window depending on the value stored in index.
 
long SetWindowLong (int index, long newLong)
 Changes information about the window.
 
uint16 GetWindowWord (int index) const
 Retrieves information about this window depending on the value of index.
 
uint16 SetWindowWord (int index, uint16 newWord)
 Changes information about the window.
 
WNDPROC GetWindowProc () const
 
WNDPROC SetWindowProc (WNDPROC wndProc)
 
int EnumProps (PROPENUMPROC proc)
 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.
 
HANDLE GetProp (uint16 atom) const
 Returns a handle to the property list of the specified window.
 
HANDLE RemoveProp (uint16 atom) const
 Removes the property specified by atom from the application's property list.
 
bool SetProp (uint16 atom, HANDLE data) const
 Adds an item to the property list of the specified window.
 
HANDLE GetProp (LPCTSTR str) const
 Returns a handle to the property list of the specified window.
 
HANDLE GetProp (const tstring &str) const
 
HANDLE RemoveProp (LPCTSTR str) const
 Removes the property specified by str, a null-terminated string, from the application's property list.
 
HANDLE RemoveProp (const tstring &str) const
 
bool SetProp (LPCTSTR str, HANDLE data) const
 Adds an item to the property list of the specified window.
 
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
 Gets the style bits of the underlying window or the 'Style' member of the attribute structure associated with this TWindow object.
 
uint32 SetStyle (uint32 style)
 Sets the style bits of the underlying window or the 'Style' member of the attribute structure associated with this TWindow object.
 
uint32 GetExStyle () const
 Gets the extra style bits of the window.
 
uint32 SetExStyle (uint32 style)
 Sets the extra style bits of the window.
 
bool ModifyStyle (uint32 offBits, uint32 onBits, uint swpFlags=0)
 Modifies the style bits of the window.
 
bool ModifyExStyle (uint32 offBits, uint32 onBits, uint swpFlags=0)
 Modifies the style bits of the window.
 
Window placement(X,Y) and display
bool MoveWindow (int x, int y, int w, int h, bool repaint=false)
 Repositions the specified window.
 
bool MoveWindow (const TRect &rect, bool repaint=false)
 Repositions the window.
 
virtual bool ShowWindow (int cmdShow)
 Displays this TWindow in a given state.
 
void ShowOwnedPopups (bool show)
 Shows or hides all owned pop-up windows according to the value of show.
 
bool IsWindowVisible () const
 Returns true if the window is visible.
 
bool IsZoomed () const
 Returns true if window is zoomed or maximized.
 
bool IsIconic () const
 Returns true if window is iconic or minimized.
 
int GetWindowTextLength () const
 Returns the length, in characters, of the specified window's title.
 
int GetWindowText (TCHAR *str, int maxCount) const
 Copies the window's title into a buffer pointed to by string.
 
tstring GetWindowText () const
 String-aware overload.
 
void SetWindowText (LPCTSTR str)
 Sets the window's text to the given string (by copying).
 
void SetWindowText (const tstring &str)
 
void SetWindowText (uint resourceStringId)
 Sets the window title to the resource string identified by the given id.
 
WINDOWPLACEMENT GetWindowPlacement () const
 Wrapper for Windows API.
 
void SetWindowPlacement (const WINDOWPLACEMENT &place)
 Wrapper for Windows API.
 
Window painting: invalidating, validating & updating
virtual void Invalidate (bool erase=true)
 Invalidates (mark for painting) the entire client area of a window.
 
virtual void InvalidateRect (const TRect &rect, bool erase=true)
 Invalidates a specified client area.
 
void InvalidateRgn (HRGN hRgn, bool erase=true)
 Invalidates a client area within a region specified by the hRgn parameter when the application receives a WM_PAINT message.
 
void Validate ()
 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).
 
void ValidateRect (const TRect &rect)
 Validates a portion of the client area indicated by rect.
 
void ValidateRgn (HRGN hRgn)
 Validates the client area within a region of the current window.
 
void UpdateWindow ()
 Updates the client area of the specified window by immediately sending a WM_PAINT message.
 
bool FlashWindow (bool invert)
 Changes the window from active to inactive or vice versa.
 
bool GetUpdateRect (TRect &rect, bool erase=true) const
 Retrieves the screen coordinates of the rectangle that encloses the updated region of the specified window.
 
int GetUpdateRgn (TRegion &rgn, bool erase=true) const
 Copies a window's update region into a region specified by region.
 
bool LockWindowUpdate (bool lock=true)
 Prevents or enables window drawing for one window at a time.
 
bool RedrawWindow (TRect *update, HRGN hUpdateRgn, uint redrawFlags=RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE)
 Redraws the rectangle specified by update and the region specified by hUpdateRgn.
 
auto GetWindowRgn (TRegion &) const -> int
 Obtains a copy of the region of the window within which the system permits drawing.
 
void ResetWindowRgn (bool repaint=false)
 Calls SetWindowRgn(nullptr, repaint).
 
auto SetWindowRgn (HRGN, bool repaint=false) -> bool
 Sets the area within the window where the system permits drawing.
 
auto SetWindowRgn (const TRegion &, bool repaint=false) -> bool=delete
 
auto SetWindowRgn (TRegion &&r, bool repaint=false) -> bool
 Overload for TRegion.
 
Parent/child with Ids
int GetDlgCtrlID () const
 Returns the ID of the control.
 
HWND GetDlgItem (int childId) const
 Retrieves the handle of a control specified by childId.
 
uint GetDlgItemInt (int childId, bool *translated=0, bool isSigned=true) const
 Translates the text of a specified control into an integer value and returns it.
 
void SetDlgItemInt (int childId, uint value, bool isSigned=true) const
 Sets the child window with the Id (childId) in the window to the integer value specified in value.
 
int GetDlgItemText (int childId, TCHAR *text, int maxValue) const
 Retrieves the text of a control specified by childId.
 
tstring GetDlgItemText (int childId) const
 String-aware overload.
 
void SetDlgItemText (int childId, LPCTSTR text) const
 Sets the title or text of a control in a dialog box.
 
void SetDlgItemText (int childId, const tstring &text) const
 
void SetDlgItemText (int childId, uint resourceStringId) const
 
uint IsDlgButtonChecked (int buttonId) const
 Indicates if the child button specified in the integer parameter, buttonId, is checked, or if a button is grayed, checked, or neither.
 
bool IsChild (HWND hWnd) const
 Returns true if the window is a child window or a descendant window of this window.
 
HWND GetNextDlgGroupItem (HWND hWndCtrl, bool previous=false) const
 Returns either the next or the previous control in the dialog box.
 
HWND GetNextDlgTabItem (HWND hWndCtrl, bool previous=false) const
 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).
 
void CheckDlgButton (int buttonId, uint check)
 Places a check mark in (or removes a check mark from) the button specified in buttonId.
 
void CheckRadioButton (int firstButtonId, int lastButtonId, int checkButtonId)
 Checks the radio button specified by checkButtonId and removes the check mark from the other radio buttons in the group.
 
void SetDlgItemFont (int childId, HFONT f, bool redraw=false) const
 
HFONT GetDlgItemFont (int childId) const
 
TRect GetDlgItemRect (int childId) const
 Returns the window rectangle of the given child, specified in this window's client coordinates.
 
Menus and menubar
HMENU GetMenu () const
 Returns the handle to the menu of the indicated window.
 
HMENU GetSystemMenu (bool revert=false) const
 Returns a handle to the system menu so that an application can access the system menu.
 
bool SetMenu (HMENU hMenu)
 Sets the specified window's menu to the menu indicated by hMenu.
 
bool HiliteMenuItem (HMENU hMenu, uint idItem, uint hilite)
 Either highlights or removes highlighting from a top-level item in the menu.
 
void DrawMenuBar ()
 DrawMenuBar redraws the menu bar.
 
Timer
bool KillTimer (UINT_PTR timerId)
 Gets rid of the timer and removes any WM_TIMER messages from the message queue.
 
UINT_PTR SetTimer (UINT_PTR timerId, uint timeout, TIMERPROC proc=0)
 Creates a timer object associated with this window.
 
Hot keys
bool RegisterHotKey (int idHotKey, uint modifiers, uint virtKey)
 Registers a hotkey ID with the current application.
 
bool UnregisterHotKey (int idHotKey)
 Unregisters a hotkey ID with the current application.
 
Misc
bool WinHelp (LPCTSTR helpFile, uint command, ULONG_PTR data) const
 Invokes a specified help system.
 
bool WinHelp (const tstring &helpFile, uint command, ULONG_PTR data) const
 
void AssignContextMenu (TPopupMenu *menu)
 Associates a pop-up menu with the window so that it can automatically handle a WM_CONTEXTMENU message.
 
TPopupMenuGetContextMenu () const
 Returns the associated popup menu used by the window.
 
int MessageBox (LPCTSTR text, LPCTSTR caption=0, uint flags=MB_OK) const
 Creates and displays a message box that contains a message (text), a title (caption), and icons or push buttons (type).
 
int MessageBox (const tstring &text, const tstring &caption=tstring(), uint flags=MB_OK) const
 
int MessageBox (uint resId, LPCTSTR caption=0, uint flags=MB_OK) const
 
int MessageBox (uint resId, const tstring &caption, uint flags=MB_OK) const
 
auto MessageBoxIndirect (HINSTANCE resourceModule, TResId text, TResId caption, uint flags, TResId icon, DWORD_PTR contextHelpId, MSGBOXCALLBACK, DWORD languageId) const -> int
 Displays a standard message box.
 
auto MessageBoxIndirect (TResId icon, const tstring &text, const tstring &caption, uint flags=MB_OK) const -> int
 Displays a standard message box using the given icon.
 
auto FormatMessageBox (const tstring &formatStr, const tstring &caption, uint flags,...) const -> int
 
auto FormatMessageBox (const tstring &, std::nullptr_t, uint,...) const -> int=delete
 
HTASK GetWindowTask () const
 Returns a handle to the task that created the specified window.
 
void DragAcceptFiles (bool accept)
 If a window can process dropped files, DragAcceptFiles sets accept to true.
 
TCurrentEventGetCurrentEvent ()
 Returns the current event to be processed in the message queue.
 
void SethAccel (HACCEL)
 
- Public Member Functions inherited from owl::TEventHandler
virtual bool Find (TEventInfo &info, TEqualOperator op=0)
 Searches the list of response table entries looking for a match.
 
TResult Dispatch (TEventInfo &info, TParam1, TParam2=0)
 Takes the message data from TEventInfo's Msg data member and dispatches it to the correct event-handling function.
 
TResult DispatchMsg (TMsgId, uint id, TParam1, TParam2)
 Search for the event given the message and it and dispatch to the event handler if found.
 
- Public Member Functions inherited from owl::TStreamableBase
virtual ~TStreamableBase ()
 

Protected Member Functions

 TWindow ()
 Protected constructor for use by immediate virtually derived classes.
 
void Init (TWindow *parent, LPCTSTR title, TModule *module)
 Normal initialization of a default constructed TWindow.
 
void Init (TWindow *parent, const tstring &title, TModule *module)
 
void Init (HWND hWnd, TModule *module)
 Wrapper initialization of a default constructed TWindow.
 
virtual THandle PerformCreate ()
 Called from Create to perform the final step in creating an Windows interface element to be associated with a TWindow.
 
void SetHandle (THandle)
 Sets the window handle in a derived class.
 
void GetHWndState (bool forceStyleSync=false)
 Copies the style, coordinate, and the resource id (but not the title) from the existing HWnd into the TWindow members.
 
void GetWindowTextTitle ()
 Updates the TWindow internal caption (Title) from the current window's caption.
 
virtual void GetWindowClass (WNDCLASS &wndClass)
 Redefined by derived classes, GetWindowClass fills the supplied MS-Windows registration class structure with registration attributes, thus, allowing instances of TWindow to be registered.
 
virtual auto GetWindowClassName () -> TWindowClassName
 
void PerformSetupAndTransfer ()
 Ensures that the window is fully set up; then transfers data into the window.
 
virtual void SetupWindow ()
 Performs setup following creation of an associated MS-Windows window.
 
virtual void CleanupWindow ()
 Always called immediately before the HWindow becomes invalid, CleanupWindow gives derived classes an opportunity to clean up HWND related resources.
 
void DispatchScroll (uint scrollCode, uint thumbPos, HWND hWndCtrl)
 Called by EvHScroll and EvVScroll to dispatch messages from scroll bars.
 
void LoadAcceleratorTable ()
 Loads a handle to the window's accelerator table specified in the TWindowAttr structure (Attr.AccelTable).
 
virtual void RemoveChild (TWindow *child)
 Removes a child window.
 
TWindowGetWindowPtr (HWND hWnd) const
 Calls TApplication:GetWindowPtr on the application associated with this window.
 
These events are processed by TWindow
void EvClose ()
 The default response to a WM_CLOSE message is to call CloseWindow() and then have the window deleted if the Handle was really destroyed.
 
bool EvCreate (CREATESTRUCT &)
 Response method for an incoming WM_CREATE message.
 
void EvDestroy ()
 Responds to an incoming WM_DESTROY message.
 
int EvCompareItem (uint ctrlId, const COMPAREITEMSTRUCT &compareInfo)
 Handles WM_COMPAREITEM message (for owner draw controls) by forwarding message to control itself.
 
void EvDeleteItem (uint ctrlId, const DELETEITEMSTRUCT &deleteInfo)
 Handles WM_DELETEITEM message (for owner draw controls) by forwarding message to control itself.
 
void EvDrawItem (uint ctrlId, const DRAWITEMSTRUCT &drawInfo)
 
void EvMeasureItem (uint ctrlId, MEASUREITEMSTRUCT &measureInfo)
 Handles WM_MEASUREITEM message (for owner draw controls & menus) by forwarding message to control itself.
 
void EvHScroll (uint scrollCode, uint thumbPos, HWND hWndCtl)
 Response method for an incoming WM_HSCROLL message.
 
void EvVScroll (uint scrollCode, uint thumbPos, HWND hWndCtl)
 Response method for an incoming WM_VSCROLL message.
 
void EvMove (const TPoint &clientOrigin)
 Save the normal position of the window.
 
void EvNCDestroy ()
 Responds to an incoming WM_NCDESTROY message, the last message sent to an MS-Windows interface element.
 
bool EvQueryEndSession (uint flags)
 Respond to Windows attempt to close down.
 
void EvSize (uint sizeType, const TSize &size)
 Response method for an incoming WM_SIZE message.
 
void EvLButtonDown (uint modKeys, const TPoint &point)
 Response method for an incoming WM_LBUTTONDOWN message.
 
bool EvEraseBkgnd (HDC)
 Handler for WM_ERASEBKGND.
 
void EvPaint ()
 Response method for an incoming WM_PAINT message.
 
void EvSysColorChange ()
 Respond to WM_SYSCOLORCHANGE by broadcasting it to all children.
 
Input validation message handler
void EvChildInvalid (HWND hWnd)
 Handle message posted to us by a control needing assistance in dealing with invalid inputs.
 
System messages
void EvCompacting (uint compactRatio)
 The default message handler for WM_COMPACTING.
 
void EvDevModeChange (LPCTSTR devName)
 The default message handler for WM_DEVMODECHANGE.
 
void EvEnable (bool enabled)
 The default message handler for WM_ENABLE.
 
void EvEndSession (bool endSession, uint flags)
 Provides default handling for WM_ENDSESSION.
 
void EvFontChange ()
 The default message handler for WM_FONTCHANGE.
 
void EvSysCommand (uint cmdType, const TPoint &point)
 Responds to a user-selected command from the System menu or when the user selects the maximize or minimize box.
 
void EvTimeChange ()
 The default message handler for WM_TIMECHANGE.
 
void EvTimer (uint timerId)
 The default message handler for WM_TIMER.
 
void EvSettingChange (uint flags, LPCTSTR section)
 
Window manager messages
void EvActivate (uint active, bool minimized, HWND hWndOther)
 Default message handler for WM_ACTIVATE.
 
void EvActivateApp (bool active, DWORD threadId)
 The default message handler for WM_ACTIVATEAPP.
 
void EvCancelMode ()
 The default message handler for WM_CANCELMODE.
 
void EvGetMinMaxInfo (MINMAXINFO &minmaxinfo)
 The default message handler for WM_GETMINMAXINFO.
 
int EvGetText (int bufSize, TCHAR *buf)
 The default message handler for WM_GETTEXT.
 
int EvGetTextLength ()
 The default message handler for WM_GETTEXTLENGTH.
 
void EvKillFocus (HWND hWndGetFocus)
 Handle WM_KILLFOCUS so that we can have a parent window hold onto our Handle and possibly restore focus later.
 
uint EvMouseActivate (HWND hTopLevel, uint hitCode, TMsgId)
 The default message handler for WM_MOUSEACTIVATE.
 
The following are called under Win32 only
void EvHotKey (int idHotKey, uint modifiers, uint vk)
 
bool EvCopyData (HWND hwnd, const COPYDATASTRUCT &)
 
void EvNextDlgCtl (TParam1 handleOrDirectionFlag, bool isHandle)
 
void EvParentNotify (const TParentNotify &)
 The default message handler for WM_PARENTNOTIFY.
 
HICON EvQueryDragIcon ()
 The default message handler for WM_QUERYDRAGICON.
 
bool EvQueryOpen ()
 The default message handler for WM_QUERYOPEN.
 
void EvQueueSync ()
 The default message handler for WM_QUEUESYNC.
 
bool EvSetCursor (HWND hWndCursor, uint codeHitTest, TMsgId mouseMsg)
 Response method for an incoming WM_SETCURSOR message.
 
void EvSetFocus (HWND hWndLostFocus)
 The default message handler for WM_SETFOCUS.
 
HFONT EvGetFont ()
 The default message handler for WM_GETFONT.
 
void EvSetFont (HFONT hFont, bool redraw)
 The default message handler for WM_SETFONT.
 
void EvSetRedraw (bool redraw)
 The default message handler for WM_SETREDRAW.
 
void EvSetText (LPCTSTR text)
 The default message handler for WM_SETTEXT.
 
void EvShowWindow (bool show, uint status)
 The default message handler for WM_SHOWWINDOW.
 
void EvWindowPosChanged (const WINDOWPOS &windowPos)
 The default message handler for WM_WINDOWPOSCHANGED.
 
bool EvWindowPosChanging (WINDOWPOS &)
 The default message handler for WM_WINDOWPOSCHANGING.
 
Controls
HBRUSH EvCtlColor (HDC hDC, HWND hWndChild, uint ctlType)
 Handler for control color messages (WM_CTLCOLOR family).
 
Keyboard input
void EvChar (uint key, uint repeatCount, uint flags)
 The default message handler for WM_CHAR.
 
void EvDeadChar (uint deadKey, uint repeatCount, uint flags)
 The default message handler for WM_DEADCHAR.
 
void EvKeyDown (uint key, uint repeatCount, uint flags)
 The default message handler for WM_KEYDOWN.
 
void EvKeyUp (uint key, uint repeatCount, uint flags)
 The default message handler for WM_KEYUP.
 
void EvSysChar (uint key, uint repeatCount, uint flags)
 The default message handler for WM_SYSCHAR.
 
void EvSysDeadChar (uint key, uint repeatCount, uint flags)
 The default message handler for WM_SYSDEADCHAR.
 
void EvSysKeyDown (uint key, uint repeatCount, uint flags)
 The default message handler for WM_SYSKEYDOWN.
 
void EvSysKeyUp (uint key, uint repeatCount, uint flags)
 The default message handler for WM_SYSKEYUP.
 
Mouse input
void EvLButtonDblClk (uint modKeys, const TPoint &point)
 The default message handler for WM_LBUTTONDBLCLK.
 
void EvLButtonUp (uint modKeys, const TPoint &point)
 The default message handler for WM_LBUTTONUP.
 
void EvMButtonDblClk (uint modKeys, const TPoint &point)
 The default message handler for WM_MBUTTONDBLCLK.
 
void EvMButtonDown (uint modKeys, const TPoint &point)
 The default message handler for WM_MBUTTONDOWN.
 
void EvMButtonUp (uint modKeys, const TPoint &point)
 The default message handler for WM_MBUTTONUP.
 
void EvMouseMove (uint modKeys, const TPoint &point)
 The default message handler for WM_MOUSEMOVE.
 
void EvMouseHWheel (uint modKeys, int zDelta, const TPoint &point)
 Event handler for WM_MOUSEHWHEEL.
 
void EvMouseWheel (uint modKeys, int zDelta, const TPoint &point)
 Event handler for WM_MOUSEWHEEL.
 
void EvRButtonDblClk (uint modKeys, const TPoint &point)
 The default message handler for WM_RBUTTONDBLCLK.
 
void EvRButtonDown (uint modKeys, const TPoint &point)
 The default message handler for WM_RBUTTONDOWN.
 
void EvRButtonUp (uint modKeys, const TPoint &point)
 The default message handler for WM_RBUTTONUP.
 
Menu related messages
void EvInitMenu (HMENU hMenu)
 The default message handler for WM_INITMENU.
 
void EvInitMenuPopup (HMENU hPopupMenu, uint index, bool isSysMenu)
 Handle WM_INITMENUPOPUP while embeded to generate command enable messages for our server menu items.
 
int32 EvMenuChar (uint nChar, uint menuType, HMENU hMenu)
 The default message handler for WM_MENUCHAR.
 
void EvMenuSelect (uint menuItemId, uint flags, HMENU hMenu)
 The default message handler for WM_MENUSELECT.
 
void EvContextMenu (HWND childHwnd, int x, int y)
 The default message handler for WM_CONTEXTMENU.
 
Dialog [Menu] messages
uint EvGetDlgCode (const MSG *msg)
 The default message handler for WM_GETDLGCODE.
 
void EvEnterIdle (uint source, HWND hWndDlg)
 The default message handler for WM_ENTERIDLE.
 
Print manager messages
void EvSpoolerStatus (uint jobStatus, uint jobsLeft)
 The default message handler for WM_SPOOLERSTATUS.
 
Clipboard messages
void EvAskCBFormatName (uint bufLen, TCHAR *buffer)
 The default message handler for WM_ASKCBFORMATNAME.
 
void EvChangeCBChain (HWND hWndRemoved, HWND hWndNext)
 The default message handler for WM_CHANGECBCHAIN.
 
void EvDrawClipboard ()
 The default message handler for WM_DRAWCLIPBOARD.
 
void EvDestroyClipboard ()
 The default message handler for WM_DESTROYCLIPBOARD.
 
void EvHScrollClipboard (HWND hCBViewer, uint scrollCode, uint pos)
 The default message handler for WM_HSCROLLCLIPBOARD.
 
void EvPaintClipboard (HWND hWnd, const PAINTSTRUCT &)
 The default message handler for WM_PAINTCLIPBOARD.
 
void EvRenderAllFormats ()
 The default message handler for WM_RENDERALLFORMATS.
 
void EvRenderFormat (uint dataFormat)
 The default message handler for WM_RENDERFORMAT.
 
void EvSizeClipboard (HWND hWndViewer, const TRect &)
 The default message handler for WM_SIZECLIPBOARD.
 
void EvVScrollClipboard (HWND hCBViewer, uint scrollCode, uint pos)
 The default message handler for WM_VSCROLLCLIPBOARD.
 
Palette manager messages
void EvPaletteChanged (HWND hWndPalChg)
 The default message handler for WM_PALETTECHANGED.
 
void EvPaletteIsChanging (HWND hWndPalChg)
 The default message handler for WM_PALETTEISCHANGING.
 
bool EvQueryNewPalette ()
 The default message handler for WM_QUERYNEWPALETTE.
 
Drag-n-drop messages
void EvDropFiles (TDropInfo dropInfo)
 The default message handler for WM_DROPFILES.
 
List box messages
int EvCharToItem (uint ch, HWND hWndListBox, int caretIndex)
 The default message handler for WM_CHARTOITEM.
 
int EvVKeyToItem (uint key, HWND hWndListBox, int caretIndex)
 The default message handler for WM_VKEYTOITEM.
 
Non-client messages
bool EvNCActivate (bool active)
 The default message handler for WM_NCACTIVATE.
 
uint EvNCCalcSize (bool calcValidRects, NCCALCSIZE_PARAMS &)
 The default message handler for WM_NCCALCSIZE.
 
bool EvNCCreate (CREATESTRUCT &)
 The default message handler for WM_NCCREATE.
 
uint EvNCHitTest (const TPoint &)
 The default message handler for WM_NCHITTEST.
 
void EvNCLButtonDblClk (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCLBUTTONDBLCLK.
 
void EvNCLButtonDown (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCLBUTTONDOWN.
 
void EvNCLButtonUp (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCLBUTTONUP.
 
void EvNCMButtonDblClk (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCMBUTTONDBLCLK.
 
void EvNCMButtonDown (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCMBUTTONDOWN.
 
void EvNCMButtonUp (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCMBUTTONUP.
 
void EvNCMouseMove (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCMOUSEMOVE.
 
void EvNCPaint (HRGN)
 The default message handler for WM_NCPAINT.
 
void EvNCRButtonDblClk (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCRBUTTONDBLCLK.
 
void EvNCRButtonDown (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCRBUTTONDOWN.
 
void EvNCRButtonUp (uint codeHitTest, const TPoint &)
 The default message handler for WM_NCRBUTTONUP.
 
Icon messages
HICON EvGetIcon (bool isBigIcon)
 
HICON EvSetIcon (bool isBigIcon, HICON)
 
- Protected Member Functions inherited from owl::TEventHandler
bool SearchEntries (const TGenericTableEntry *entries, TEventInfo &info, TEqualOperator op)
 Low-level response table search function.
 

Static Protected Member Functions

Callback procs for hooking TWindow to native window
static LRESULT CALLBACK InitWndProc (HWND, UINT msg, WPARAM, LPARAM)
 Callback process for hooking TWindow to native window.
 

Friends

voidGetMessageReceiverMemberFunctionAddress ()
 
TResult CALLBACK DispatchWindowMessage (TWindow *w, TMsgId msg, TParam1 param1, TParam2 param2)
 

Children iteration functions

using TChildrenIterator = TChildrenIteratorTemplate<TWindow>
 
using TConstChildrenIterator = TChildrenIteratorTemplate<const TWindow>
 
using TChildrenRange = TChildrenRangeTemplate<TWindow>
 
using TConstChildrenRange = TChildrenRangeTemplate<const TWindow>
 
auto GetChildren ()
 Returns a TWindow::TChildrenRange that can be iterated by standard means.
 
auto GetChildren () const
 Const overload of TWindow::GetChildren.
 
TWindowNext ()
 Returns a pointer to the next sibling window in the window's sibling list.
 
auto Next () const -> const TWindow *
 
TWindowPrevious ()
 Returns a pointer to the TWindow's previous sibling (the window previous to the TWindow in its parent's child window list)
 
auto Previous () const -> const TWindow *
 
TWindowGetFirstChild ()
 Returns a pointer to the first child window, which is the first window created in the interface object's child list.
 
auto GetFirstChild () const -> const TWindow *
 
TWindowGetLastChild ()
 Returns a pointer to the last child window in the interface object's child list.
 
auto GetLastChild () const -> const TWindow *
 
uint NumChildren () const
 Returns the number of child windows of the window.
 

Scrolling and scrollbars

typedef std::pair< int, intTScrollRange
 
bool GetScrollInfo (int bar, SCROLLINFO *scrollInfo) const
 Retrieves the properties of the given scroll bar.
 
SCROLLINFO GetScrollInfo (int bar, uint mask=SIF_ALL) const
 Function-style overload Returns selected properties of the given scroll bar.
 
int SetScrollInfo (int bar, SCROLLINFO *scrollInfo, bool redraw=true)
 Sets the properties of the given scroll bar.
 
int GetScrollPos (int bar) const
 Returns the thumb position in the scroll bar.
 
int SetScrollPos (int bar, int pos, bool redraw=true)
 Sets the thumb position in the scroll bar.
 
int GetScrollTrackPos (int bar) const
 Returns the thumb track position in the scroll bar.
 
void GetScrollRange (int bar, int &minPos, int &maxPos) const
 Returns the minimum and maximum positions in the scroll bar.
 
TScrollRange GetScrollRange (int bar) const
 Function-style overload.
 
void SetScrollRange (int bar, int minPos, int maxPos, bool redraw=true)
 Sets the thumb position in the scroll bar.
 
void SetScrollRange (int bar, const TScrollRange &, bool redraw=true)
 Overload taking the range as a pair.
 
int GetScrollPage (int bar) const
 Returns the page property (SCROLLINFO::nPage) of the given scroll bar.
 
void SetScrollPage (int bar, int page, bool redraw=true)
 Sets the page property (SCROLLINFO::nPage) of the given scroll bar.
 
bool EnableScrollBar (uint sbFlags=SB_BOTH, uint arrowFlags=ESB_ENABLE_BOTH)
 Disables or enables one or both of the scroll bar arrows on the scroll bars associated with this window.
 
void ShowScrollBar (int bar, bool show=true)
 Displays or hides the scroll bar.
 
void ScrollWindow (int dx, int dy, const TRect *scroll=nullptr, const TRect *clip=nullptr)
 Scrolls a window in the vertical (dx) and horizontal (dy) directions.
 
void ScrollWindowEx (int dx, int dy, const TRect *scroll=0, const TRect *clip=0, HRGN hUpdateRgn=0, TRect *update=0, uint flags=0)
 Scrolls a window in the vertical (dx) and horizontal (dy) directions.
 

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)
 This inline version of ShutDownWindow calls the static version of ShutDownWindow.
 
static void ShutDownWindow (TWindow *win, int retVal=0)
 This version of ShutDownWindow unconditionally shuts down a given window, calls Destroy on the interface element, and then deletes the interface object.
 

Messages

TResult SendMessage (TMsgId, TParam1=0, TParam2=0) const
 Sends a message (msg) to a specified window or windows.
 
TResult SendDlgItemMessage (int childId, TMsgId, TParam1=0, TParam2=0)
 Sends a message (msg) to the control specified in childId.
 
bool PostMessage (TMsgId, TParam1=0, TParam2=0)
 Posts a message (msg) to the window in the application's message queue.
 
HWND SetCapture ()
 Sets the mouse capture to the current window.
 
HWND SetFocus ()
 Sets the keyboard focus to current window and activates the window that receives the focus by sending a WM_SETFOCUS message to the window.
 
bool IsWindowEnabled () const
 Returns true if the window is enabled.
 
virtual bool EnableWindow (bool enable)
 Allows the given window to receive input from the keyboard of mouse.
 
void SetRedraw (bool redraw)
 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).
 
bool TrackMouseEvent (uint flags=TME_HOVER|TME_LEAVE, int hoverTime=HOVER_DEFAULT)
 Posts messages when the mouse pointer leaves a window or hovers over a window for a specified amount of time.
 
bool CancelMouseEvent (uint flags=TME_HOVER|TME_LEAVE)
 Encapsulates a call to TrackMouseEvent, passing the TME_CANCEL flag.
 
TRACKMOUSEEVENT QueryMouseEventTracking () const
 Returns the current state of mouse event tracking initiated by TrackMouseEvent.
 
static HWND GetCapture ()
 Returns the handle of the window that has captured the mouse.
 
static void ReleaseCapture ()
 Releases the mouse capture from this window.
 
static HWND GetFocus ()
 Gets a handle to the window that has the focus.
 

Window coordinates, dimensions...

void ClientToScreen (TPoint &point) const
 Converts the client coordinates specified in point to screen coordinates for the new window.
 
TPoint MapClientToScreen (const TPoint &p) const
 Function-style version of ClientToScreen.
 
void MapClientToScreen (TPoint *p, int count) const
 Maps the given points, specified in client coordinates in this window, to screen coordinates.
 
template<size_t Count>
void MapClientToScreen (TPoint(&p)[Count]) const
 Overload for array See MapClientToScreen(TPoint*, int).
 
TRect MapClientToScreen (const TRect &r) const
 Functional-style overload for TRect; converts the given rectangle coordinates and returns the result.
 
void ScreenToClient (TPoint &point) const
 Uses the screen coordinates specified in point to calculate the client window's coordinates and then places the new coordinates into point.
 
TPoint MapScreenToClient (const TPoint &p) const
 Functional-style version of ScreenToClient.
 
void MapScreenToClient (TPoint *p, int count) const
 Maps the given points, specified in screen coordinates, to client coordinates in this window.
 
template<size_t Count>
void MapScreenToClient (TPoint(&p)[Count]) const
 Overload for array See MapScreenToClient(TPoint*, int).
 
TRect MapScreenToClient (const TRect &r) const
 Functional-style overload for TRect; converts the given rectangle coordinates and returns the result.
 
void MapWindowPoints (HWND hWndTo, TPoint *pts, int count) const
 Maps a set of points in one window to a relative set of points in another window.
 
void MapWindowPoints (const TWindow &wndTo, TPoint *p, int n) const
 Overload for TWindow See MapWindowPoints(HWND, TPoint*, int).
 
template<size_t Count>
void MapWindowPoints (HWND hWndTo, TPoint(&p)[Count]) const
 Overload for array See MapWindowPoints(HWND, TPoint*, int).
 
template<size_t Count>
void MapWindowPoints (const TWindow &wndTo, TPoint(&p)[Count]) const
 Overload for TWindow and array See MapWindowPoints(HWND, TPoint*, int).
 
TPoint MapWindowPoints (HWND hWndTo, const TPoint &p) const
 Functional-style overload for TPoint; converts the given point coordinates and returns the result.
 
TPoint MapWindowPoints (const TWindow &wndTo, const TPoint &p) const
 Overload for TWindow and TPoint See MapWindowPoints(HWND, const TPoint&).
 
TRect MapWindowPoints (HWND hWndTo, const TRect &r) const
 Functional-style overload for TRect; converts the given rectangle coordinates and returns the result.
 
TRect MapWindowPoints (const TWindow &wndTo, const TRect &r) const
 Overload for TWindow and TRect See MapWindowPoints(HWND, const TRect&).
 
TRect MapWindowRect (HWND hWndTo) const
 Maps the window's rectangle (GetWindowRect) to client coordinates in the given destination window.
 
TRect MapWindowRect (const TWindow &wndTo) const
 Overload for TWindow See MapWindowRect(HWND).
 
TRect MapClientRect (HWND hWndTo) const
 Maps the window's client rectangle (GetClientRect) to client coordinates in the given destination window.
 
TRect MapClientRect (const TWindow &wndTo) const
 Overload for TWindow See MapClientRect(HWND).
 
void GetClientRect (TRect &rect) const
 Gets the coordinates of the window's client area and then copies them into the object referred to by TRect.
 
TRect GetClientRect () const
 Gets the coordinates of the window's client area (the area in a window you can use for drawing).
 
HWND ChildWindowFromPoint (const TPoint &point) const
 Determines which of the child windows contains the point specified in TPoint.
 
void GetWindowRect (TRect &rect) const
 Gets the screen coordinates of the window's rectangle and copies them into rect.
 
TRect GetWindowRect () const
 Gets the screen coordinates of the window's rectangle.
 
TRect GetChildRect (HWND hWnd) const
 Returns the window rectangle of the given window, specified in this window's client coordinates.
 
TRect GetChildRect (const TWindow &wnd) const
 Overload for TWindow See GetChildRect(HWND).
 
static HWND WindowFromPoint (const TPoint &point)
 Returns the handle of the window in which the specified point (point) lies.
 
static void AdjustWindowRect (TRect &rect, uint32 style, bool menu)
 Calculates the size of the window rectangle according to the indicated client-rectangle size.
 
static void AdjustWindowRectEx (TRect &rect, uint32 style, bool menu, uint32 exStyle)
 Calculates the size of a window rectangle that has an extended style.
 

Window positioning(Z), sibling relationships

void BringWindowToTop ()
 Brings a pop-up or child window to the top of the stack of overlapping windows and activates it.
 
HWND SetActiveWindow ()
 Activates a top-level window.
 
HWND GetLastActivePopup () const
 Returns the last active pop-up window in the list.
 
HWND GetNextWindow (uint dirFlag) const
 Finds the handle associated with either the next or previous window in the window manager's list.
 
HWND GetTopWindow () const
 Returns a handle to the top window currently owned by this parent window.
 
HWND GetWindow (uint cmd) const
 Returns the handle of the window that has the indicated relationship to this window.
 
bool SetWindowPos (HWND hWndInsertAfter, const TRect &rect, uint flags)
 Changes the size of the window pointed to by rect.
 
bool SetWindowPos (HWND hWndInsertAfter, int x, int y, int w, int h, uint flags)
 Set the new window position.
 
static HWND GetActiveWindow ()
 Retrieves the handle of the active window.
 
static HWND GetDesktopWindow ()
 Returns a handle to the desktop window.
 

Caret, cursor, font

void CreateCaret (HBITMAP hBitmap)
 Creates a new caret for the system.
 
void CreateCaret (bool isGray, int width, int height)
 Create a new caret for the system with the specified shape, bitmap shade, width, and height.
 
void HideCaret ()
 Removes the caret from the specified display screen.
 
void ShowCaret ()
 Displays the caret in the specified shape in the active window at the current position.
 
void SetWindowFont (HFONT font, bool redraw=true)
 Sets the font that a control uses to draw text.
 
void SetWindowFont (const TFont &font, bool redraw=true)
 Sets the font that a control uses to draw text.
 
HFONT GetWindowFont ()
 Gets the font the control uses to draw text.
 
static uint GetCaretBlinkTime ()
 Retrieves the caret blink rate in milliseconds.
 
static void GetCaretPos (TPoint &point)
 Gets the position of the caret in the coordinates of the client window.
 
static TPoint GetCaretPos ()
 
static void SetCaretBlinkTime (uint16 milliSecs)
 Sets the caret blink rate in milliseconds.
 
static void SetCaretPos (int x, int y)
 Sets the position of the caret in the coordinates of the client window.
 
static void SetCaretPos (const TPoint &pos)
 Sets the position of the caret in the coordinates of the client window.
 
static void DestroyCaret ()
 DestroyCaret first checks the ownership of the caret.
 
static void GetCursorPos (TPoint &pos)
 Retrieves the cursor's current position (in window screen coordinates) and copies the values into the structure pointed to by pos.
 
static TPoint GetCursorPos ()
 
static TPoint GetMessagePos ()
 

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:

  • 1. Construct an instance of a TWindow.
  • 2. Call Create or Execute, which creates the interface element (HWND) and then calls SetupWindow, which calls the base SetupWindow for normal processing, which in turn involves
  • Creating the HWindow and any child HWindows.
  • Calling TransferData to setup the transfer of data between the parent and child windows.
  • 3. To destroy the interface element, choose one of the following actions, depending on your application:
  • Call Destroy to destroy the interface element unconditionally.
  • Call CloseWindow, which calls CanClose to test if it is OK to destroy the interface element.
  • 4. There are two ways to destroy the interface object:
  • If the object has been new'd, use delete.
  • If the object has not been new'd, the compiler automatically destructs the object.

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.

Definition at line 410 of file window.h.

Member Typedef Documentation

◆ TChildrenIterator

◆ TChildrenRange

◆ TConstChildrenIterator

◆ TConstChildrenRange

◆ THandle

TWindow encapsulates an HWND.

Definition at line 415 of file window.h.

◆ TScrollRange

Definition at line 1120 of file window.h.

Constructor & Destructor Documentation

◆ TWindow() [1/4]

owl::TWindow::TWindow ( TWindow * parent,
LPCTSTR title = nullptr,
TModule * module = nullptr )
explicit

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.

Definition at line 341 of file window.cpp.

References Init().

◆ TWindow() [2/4]

owl::TWindow::TWindow ( TWindow * parent,
const tstring & title,
TModule * module = nullptr )
explicit

String-aware overload.

Definition at line 350 of file window.cpp.

References Init().

◆ TWindow() [3/4]

owl::TWindow::TWindow ( HWND handle,
TModule * module = nullptr )
explicit

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.

Definition at line 381 of file window.cpp.

References Init(), and PRECONDITION.

◆ ~TWindow()

owl::TWindow::~TWindow ( )
virtual

Destroys this window (unless this is an alias) and the children.

First, restores the underlying window's WindowProc (i.e. reverts the subclassing). Then, destroys the children and, in turn, the underlying window (unless aliased). Finally, dissociates this from the parent and application, and deallocates acquired resources.

Definition at line 545 of file window.cpp.

References _T, DefWindowProc(), Destroy(), GetChildren(), GetHandle(), owl::TResIdT< T >::GetString(), GetWindowProc(), IsFlagSet(), owl::TResIdT< T >::IsString(), owl::TWindowAttr::Menu, RemoveChild(), SetCaption(), SetCursor(), SetScroller(), SetWindowProc(), TRACEX, owl::TApplication::Uncondemn(), WARNX, and owl::wfAlias.

◆ TWindow() [4/4]

owl::TWindow::TWindow ( )
protected

Protected constructor for use by immediate virtually derived classes.

Immediate derivitives must call an Init() before constructions are done.

Definition at line 392 of file window.cpp.

Member Function Documentation

◆ AdjustWindowRect()

void owl::TWindow::AdjustWindowRect ( TRect & rect,
uint32 style,
bool menu )
inlinestatic

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.

Definition at line 2268 of file window.h.

References AdjustWindowRect().

◆ AdjustWindowRectEx()

void owl::TWindow::AdjustWindowRectEx ( TRect & rect,
uint32 style,
bool menu,
uint32 exStyle )
inlinestatic

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.

Definition at line 2293 of file window.h.

References AdjustWindowRectEx().

◆ AssignContextMenu()

void owl::TWindow::AssignContextMenu ( TPopupMenu * menu)

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

Definition at line 3880 of file window.cpp.

◆ AttachHandle()

void owl::TWindow::AttachHandle ( HWND handle)

Definition at line 2930 of file window.cpp.

References ClearFlag(), GetModule(), Init(), and owl::wfDetached.

◆ BringWindowToTop()

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.

Definition at line 2687 of file window.h.

References BringWindowToTop(), GetHandle(), and PRECONDITION.

◆ CancelMouseEvent()

bool owl::TWindow::CancelMouseEvent ( uint flags = TME_HOVER | TME_LEAVE)

Encapsulates a call to TrackMouseEvent, passing the TME_CANCEL flag.

See TrackMouseEvent.

Definition at line 3369 of file window.cpp.

References TrackMouseEvent().

◆ CanClose()

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.",
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;
}
int MessageBox(LPCTSTR text, LPCTSTR caption=0, uint flags=MB_OK) const
Creates and displays a message box that contains a message (text), a title (caption),...
Definition window.cpp:4285

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

Definition at line 2796 of file window.cpp.

References GetChildren().

◆ CheckDlgButton()

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.

Definition at line 3216 of file window.h.

References CheckDlgButton(), GetHandle(), and PRECONDITION.

◆ CheckRadioButton()

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.

Definition at line 3229 of file window.h.

References CheckRadioButton(), GetHandle(), and PRECONDITION.

◆ ChildBroadcastMessage()

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

Sends the specified message to all immediate children using SendMessage.

Note
Includes non-object windows

Definition at line 3341 of file window.cpp.

References GetApplication(), GetWindow(), owl::TApplication::ResumeThrow(), and SendMessage().

◆ ChildWindowFromPoint()

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.

Definition at line 2235 of file window.h.

References GetHandle(), and PRECONDITION.

◆ ChildWithId() [1/2]

auto owl::TWindow::ChildWithId ( int id) -> TWindow*

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.

Definition at line 3276 of file window.cpp.

◆ ChildWithId() [2/2]

auto owl::TWindow::ChildWithId ( int id) const -> const TWindow*
inline

Definition at line 678 of file window.h.

References ChildWithId().

◆ CleanupWindow()

void owl::TWindow::CleanupWindow ( )
protectedvirtual

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()
{
}
virtual void CleanupWindow()
Always called immediately before the HWindow becomes invalid, CleanupWindow gives derived classes an ...
Definition window.cpp:2641
void DragAcceptFiles(bool accept)
If a window can process dropped files, DragAcceptFiles sets accept to true.
Definition window.cpp:4264

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

Definition at line 2641 of file window.cpp.

References _T, and TRACEX.

◆ ClearFlag()

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.

Definition at line 1787 of file window.h.

◆ ClientToScreen()

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.

Definition at line 2245 of file window.h.

References ClientToScreen(), GetHandle(), and PRECONDITION.

◆ CloseWindow()

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.

Definition at line 2810 of file window.cpp.

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

◆ Create()

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.

Definition at line 2400 of file window.cpp.

References _T, CHECK, DisableAutoCreate(), GetApplication(), owl::GetCreationWindow(), GetDlgItem(), GetHandle(), GetHWndState(), GetWindowProc(), GetWindowPtr(), GetWindowTextTitle(), owl::TWindowAttr::Id, InitWndProc(), IsFlagSet(), LoadAcceleratorTable(), ModifyExStyle(), PerformCreate(), PerformSetupAndTransfer(), owl::TXWindow::Raise(), Register(), owl::TApplication::ResumeThrow(), SendMessage(), SetCaption(), owl::SetCreationWindow(), SetFlag(), SetHandle(), SubclassWindowFunction(), WARNX, owl::wfFromResource, owl::wfMainWindow, owl::wfPredefinedClass, and WS_EX_APPWINDOW.

◆ CreateCaret() [1/2]

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.

Definition at line 3360 of file window.h.

References CreateCaret(), GetHandle(), and PRECONDITION.

◆ CreateCaret() [2/2]

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.

Definition at line 3347 of file window.h.

References CreateCaret(), GetHandle(), and PRECONDITION.

◆ CreateChildren()

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.

Definition at line 2996 of file window.cpp.

References _T, GetChildren(), NumChildren(), WARNX, and owl::wfAutoCreate.

◆ DefaultProcessing()

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, SubclassWindowFunction is used to install a thunk 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 GetWindowProc to get the window's thunk (created by the constructor by calling CreateInstanceProc). InitWndProc then switches the the window procedure to the thunk.
  • After this point, the thunk responds to incoming messages by calling ReceiveMessage which calls the virtual function WindowProc to process the message. ObjectWindows uses the special registered message GetWindowPtrMsgId to get the this-pointer of an HWND. ReceiveMessage 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:

Definition at line 853 of file window.cpp.

References _T, DefWindowProc(), GetApplication(), GetCurrentEvent(), GetDlgCtrlID(), owl::HiUint16(), owl::LoUint16(), WARNX, owl::wfAlias, and WM_COMMAND_ENABLE.

◆ DefWindowProc()

TResult owl::TWindow::DefWindowProc ( TMsgId 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 ocf::TOleMDIFrame, owl::TDecoratedMDIFrame, owl::TMDIFrame, and owl::TMDIChild.

Definition at line 1238 of file window.cpp.

References GetApplication(), GetHandle(), owl::TApplication::HasSuspendedException(), PRECONDITION, and owl::TApplication::ResumeThrow().

◆ Destroy()

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 ocf::TOleFrame, owl::TMDIChild, and owl::TDialog.

Definition at line 2161 of file window.cpp.

References _T, ClearFlag(), owl::TApplication::EndModal(), GetApplication(), GetChildren(), GetHandle(), IsFlagSet(), owl::TApplication::ResumeThrow(), SetFocus(), SetHandle(), WARNX, owl::wfAlias, and owl::wfModalWindow.

◆ DestroyCaret()

void owl::TWindow::DestroyCaret ( )
inlinestatic

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.

Definition at line 3373 of file window.h.

References DestroyCaret().

◆ DetachHandle()

void owl::TWindow::DetachHandle ( )

Definition at line 2940 of file window.cpp.

References ClearFlag(), SetFlag(), SetHandle(), owl::wfDetached, and owl::wfFullyCreated.

◆ DisableAutoCreate()

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.

Definition at line 1811 of file window.h.

References ClearFlag(), and owl::wfAutoCreate.

◆ DisableTransfer()

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.

Definition at line 1832 of file window.h.

References ClearFlag(), and owl::wfTransfer.

◆ DispatchScroll()

void owl::TWindow::DispatchScroll ( uint scrollCode,
uint thumbPos,
HWND hWndCtrl )
protected

Called by EvHScroll and EvVScroll to dispatch messages from scroll bars.

Definition at line 1796 of file window.cpp.

References DefaultProcessing(), EvCommand(), ForwardMessage(), GetCurrentEvent(), GetDlgCtrlID(), GetWindowPtr(), and owl::MkParam1().

◆ DoExecute()

int owl::TWindow::DoExecute ( )
virtual

Do actual modal execution using the Begin/End Modal support of TApplication.

Note
Defaults to 'TASKMODAL'.

Reimplemented in owl::TFileOpenDialog, owl::TFileSaveDialog, owl::TChooseColorDialog, owl::TChooseFontDialog, owl::TCommonDialog, owl::TDialog, owl::TPrintDialog, and owl::TOpenSaveDialog.

Definition at line 2509 of file window.cpp.

References owl::TApplication::BeginModal(), Create(), GetApplication(), GetStyle(), PRECONDITION, SetFlag(), and owl::wfModalWindow.

◆ DragAcceptFiles()

void owl::TWindow::DragAcceptFiles ( bool accept)

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

Note
Wrapper for Windows API.

Definition at line 4264 of file window.cpp.

References owl::TShell::DragAcceptFiles(), GetHandle(), and PRECONDITION.

◆ DrawMenuBar()

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.

Definition at line 3310 of file window.h.

References DrawMenuBar(), GetHandle(), and PRECONDITION.

◆ EnableAutoCreate()

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.

Definition at line 1802 of file window.h.

References SetFlag(), and owl::wfAutoCreate.

◆ EnableScrollBar()

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.

Definition at line 3026 of file window.h.

References GetHandle(), and PRECONDITION.

◆ EnableTooltip()

void owl::TWindow::EnableTooltip ( bool enable = true)
virtual

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

Definition at line 4181 of file window.cpp.

References owl::TTooltip::Activate(), GetHandle(), and SetTooltip().

◆ EnableTransfer()

void owl::TWindow::EnableTransfer ( )
inline

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

Definition at line 1825 of file window.h.

References SetFlag(), and owl::wfTransfer.

◆ EnableWindow()

bool owl::TWindow::EnableWindow ( bool enable)
inlinevirtual

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.

Definition at line 2169 of file window.h.

References GetHandle(), and PRECONDITION.

◆ EnumProps()

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.

Definition at line 2478 of file window.h.

References GetHandle(), and PRECONDITION.

◆ EvActivate()

void owl::TWindow::EvActivate ( uint active,
bool minimized,
HWND hWndOther )
inlineprotected

Default message handler for WM_ACTIVATE.

Definition at line 3575 of file window.h.

References DefaultProcessing().

◆ EvActivateApp()

void owl::TWindow::EvActivateApp ( bool active,
DWORD threadId )
inlineprotected

The default message handler for WM_ACTIVATEAPP.

Definition at line 3584 of file window.h.

References DefaultProcessing().

◆ EvAskCBFormatName()

void owl::TWindow::EvAskCBFormatName ( uint bufLen,
TCHAR * buffer )
inlineprotected

The default message handler for WM_ASKCBFORMATNAME.

Definition at line 3591 of file window.h.

References DefaultProcessing().

◆ EvCancelMode()

void owl::TWindow::EvCancelMode ( )
inlineprotected

The default message handler for WM_CANCELMODE.

Definition at line 3598 of file window.h.

References DefaultProcessing().

◆ EvChangeCBChain()

void owl::TWindow::EvChangeCBChain ( HWND hWndRemoved,
HWND hWndNext )
inlineprotected

The default message handler for WM_CHANGECBCHAIN.

Definition at line 3605 of file window.h.

References DefaultProcessing().

◆ EvChar()

void owl::TWindow::EvChar ( uint key,
uint repeatCount,
uint flags )
inlineprotected

The default message handler for WM_CHAR.

Definition at line 3612 of file window.h.

References DefaultProcessing().

◆ EvCharToItem()

int owl::TWindow::EvCharToItem ( uint ch,
HWND hWndListBox,
int caretIndex )
inlineprotected

The default message handler for WM_CHARTOITEM.

Definition at line 3619 of file window.h.

References DefaultProcessing().

◆ EvChildInvalid()

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.

Definition at line 2918 of file window.cpp.

References PRECONDITION, SendMessage(), and WM_CHILDINVALID.

◆ EvClose()

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.

Definition at line 2829 of file window.cpp.

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

◆ EvCommand()

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 ocf::TOleWindow, owl::TDecoratedFrame, owl::TFloatingFrame, owl::TFrameWindow, owl::TGadgetWindow, owl::TTinyCaption, owl::TPickListPopup, and owl::TEdgeSlip.

Definition at line 1000 of file window.cpp.

References _T, DefaultProcessing(), GetWindowPtr(), and TRACEX.

◆ EvCommandEnable()

void owl::TWindow::EvCommandEnable ( TCommandEnabler & ce)
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 ocf::TOleWindow, owl::TDecoratedFrame, owl::TFloatingFrame, owl::TFrameWindow, owl::TGadgetWindow, and owl::TEdgeSlip.

Definition at line 1136 of file window.cpp.

References owl::TEventHandler::Dispatch(), owl::TEventHandler::Find(), and WM_COMMAND_ENABLE.

◆ EvCompacting()

void owl::TWindow::EvCompacting ( uint compactRatio)
inlineprotected

The default message handler for WM_COMPACTING.

Definition at line 3633 of file window.h.

References DefaultProcessing().

◆ EvCompareItem()

int owl::TWindow::EvCompareItem ( uint ctrlId,
const COMPAREITEMSTRUCT & compareInfo )
protected

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

Definition at line 1690 of file window.cpp.

References DefaultProcessing(), and GetWindowPtr().

◆ EvContextMenu()

void owl::TWindow::EvContextMenu ( HWND child,
int x,
int y )
protected

The default message handler for WM_CONTEXTMENU.

Respond to a right button click or VK_APPS key press in the window. If a context menu is set, display it.

Definition at line 3892 of file window.cpp.

References ClientToScreen(), DefaultProcessing(), GetApplication(), GetContextMenu(), GetHandle(), owl::TApplication::GetMainWindow(), HandleMessage(), and WM_OWLHELPHIT.

◆ EvCopyData()

bool owl::TWindow::EvCopyData ( HWND hwnd,
const COPYDATASTRUCT &  )
inlineprotected

Definition at line 3639 of file window.h.

References DefaultProcessing().

◆ EvCreate()

bool owl::TWindow::EvCreate ( CREATESTRUCT & )
protected

Response method for an incoming WM_CREATE message.

Performs setup and data transfer now that we are created & have a Handle. Should return true if the

Definition at line 1588 of file window.cpp.

References DefaultProcessing(), and PerformSetupAndTransfer().

◆ EvCtlColor()

HBRUSH owl::TWindow::EvCtlColor ( HDC hDC,
HWND ctl,
uint ctlType )
protected

Handler for control color messages (WM_CTLCOLOR family).

If the passed control ctl is a child encapsulated by OWL, then the text and background color of the control is used. If the control is not encapsulated by OWL, or the control does not specify a color (TColor::None), then colors are assigned by the parent (dialog). If the parent has no colors set, default colors will be used.

If the background color is set to TColor::Transparent, then the background mode of the device context hDC is set to TRANSPARENT and NULL_BRUSH is returned. Otherwise a solid brush of the background color is returned.

Note
Parent colors will not override defaults for Edit and List Box controls. For these control types, the colors can only be set by the controls themselves. To set the colors for an Edit or List Box control, encapsulate the control using the corresponding OWL class, and call SetTextColor and SetBkgndColor on the object. For other controls, such as the Static control, the parent will set the control's colors to match the parent's colors, unless explicitly set by the control itself. This ensures that a dialog box is drawn properly. For example, a dialog with labels and fields is drawn with the parent's colors for the labels, but with the system default colors for the fields, unless colors are explicitly set by the controls. Also, setting colors for a Combo Box control has no effect, since this control uses subcontrols for the Edit field and List Box components. Hence, combo boxes need to be treated specially by the parent by handling WM_CTLCOLOREDIT and WM_CTLCOLORLISTBOX, and testing the passed ctl window handle for a match against the subcontrols. To determine the handles of the subcontrols, use TComboBox::GetEditHandle and TComboBox::GetListHandle (or TComboBox::GetInfo to get both). These functions are encapsulations of the Windows API function GetComboBoxInfo.
// TComboBox ComboBox;
//...
auto TMyDlg::EvCtlColor(HDC hdc, HWND ctl, uint ctlType) -> HBRUSH
{
const auto i = ComboBox.GetInfo();
const auto w = (ctl == i.hwndItem || ctl == i.hwndList) ? ComboBox.GetHandle() : ctl;
}
Typically used to obtain information from a user, a dialog box is a window inside of which other cont...
Definition dialog.h:85
HBRUSH EvCtlColor(HDC hDC, HWND hWndChild, uint ctlType)
Handler for control color messages (WM_CTLCOLOR family).
Definition window.cpp:1984
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
Definition eventhan.h:492
END_RESPONSE_TABLE
Definition button.cpp:26
unsigned int uint
Definition number.h:21
#define EV_WM_CTLCOLORLISTBOX(method)
Definition windowev.h:261
#define EV_WM_CTLCOLOREDIT(method)
Definition windowev.h:259
See also
SetBkgndColor, SetTextColor

Definition at line 1984 of file window.cpp.

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

◆ EvDeadChar()

void owl::TWindow::EvDeadChar ( uint deadKey,
uint repeatCount,
uint flags )
inlineprotected

The default message handler for WM_DEADCHAR.

Definition at line 3646 of file window.h.

References DefaultProcessing().

◆ EvDeleteItem()

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

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

Definition at line 1702 of file window.cpp.

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

◆ EvDestroy()

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)

Definition at line 2851 of file window.cpp.

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

◆ EvDestroyClipboard()

void owl::TWindow::EvDestroyClipboard ( )
inlineprotected

The default message handler for WM_DESTROYCLIPBOARD.

Definition at line 3653 of file window.h.

References DefaultProcessing().

◆ EvDevModeChange()

void owl::TWindow::EvDevModeChange ( LPCTSTR devName)
inlineprotected

The default message handler for WM_DEVMODECHANGE.

Definition at line 3660 of file window.h.

References DefaultProcessing().

◆ EvDrawClipboard()

void owl::TWindow::EvDrawClipboard ( )
inlineprotected

The default message handler for WM_DRAWCLIPBOARD.

Definition at line 3674 of file window.h.

References DefaultProcessing().

◆ EvDrawItem()

void owl::TWindow::EvDrawItem ( uint ctrlId,
const DRAWITEMSTRUCT & drawInfo )
protected

◆ EvDropFiles()

void owl::TWindow::EvDropFiles ( TDropInfo dropInfo)
inlineprotected

The default message handler for WM_DROPFILES.

Definition at line 3667 of file window.h.

References DefaultProcessing().

◆ EvEnable()

void owl::TWindow::EvEnable ( bool enabled)
inlineprotected

The default message handler for WM_ENABLE.

Definition at line 3681 of file window.h.

References DefaultProcessing().

◆ EvEndSession()

void owl::TWindow::EvEndSession ( bool endSession,
uint flags )
protected

Provides default handling for WM_ENDSESSION.

If the session is ending, throws the exception TXEndSession, thus shutting down the entire applicaton.

Definition at line 2901 of file window.cpp.

References DefaultProcessing().

◆ EvEnterIdle()

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

The default message handler for WM_ENTERIDLE.

Definition at line 3927 of file window.cpp.

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

◆ EvEraseBkgnd()

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

Handler for WM_ERASEBKGND.

If the background color (see TWindow::SetBkgndColor) is not set, or it has been set to TColor::None, then this function simply forwards the message to DefaultProcessing. The default processing uses the brush specified in the window class (WNDCLASS:hbrBackground) to clear the client area. If the background color is set to TColor::Transparent, no clearing is done, and the function simply returns true. Otherwise, the current background color is used to clear the client area, and true is returned, indicating no further erasing is required.

If you want to handle erasure in your Paint override, then override this handler and return false. Paint will then receive true in its erase parameter, and you must ensure that all of the background is painted within the invalidated region.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms648055.aspx

Definition at line 1925 of file window.cpp.

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

◆ EvFontChange()

void owl::TWindow::EvFontChange ( )
inlineprotected

The default message handler for WM_FONTCHANGE.

Definition at line 3688 of file window.h.

References DefaultProcessing().

◆ EvGetDlgCode()

uint owl::TWindow::EvGetDlgCode ( const MSG * msg)
inlineprotected

The default message handler for WM_GETDLGCODE.

Definition at line 3695 of file window.h.

References DefaultProcessing().

◆ EvGetFont()

HFONT owl::TWindow::EvGetFont ( )
inlineprotected

The default message handler for WM_GETFONT.

Definition at line 3702 of file window.h.

References DefaultProcessing().

◆ EvGetIcon()

HICON owl::TWindow::EvGetIcon ( bool isBigIcon)
inlineprotected

Definition at line 1456 of file window.h.

References owl::InUse().

◆ EvGetMinMaxInfo()

void owl::TWindow::EvGetMinMaxInfo ( MINMAXINFO & minmaxinfo)
inlineprotected

The default message handler for WM_GETMINMAXINFO.

Definition at line 3709 of file window.h.

References DefaultProcessing().

◆ EvGetText()

int owl::TWindow::EvGetText ( int bufSize,
TCHAR * buf )
inlineprotected

The default message handler for WM_GETTEXT.

Definition at line 3735 of file window.h.

References DefaultProcessing().

◆ EvGetTextLength()

int owl::TWindow::EvGetTextLength ( )
inlineprotected

The default message handler for WM_GETTEXTLENGTH.

Definition at line 3743 of file window.h.

References DefaultProcessing().

◆ EvHotKey()

void owl::TWindow::EvHotKey ( int idHotKey,
uint modifiers,
uint vk )
inlineprotected

Definition at line 1328 of file window.h.

References owl::InUse().

◆ EvHScroll()

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

Definition at line 1866 of file window.cpp.

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

◆ EvHScrollClipboard()

void owl::TWindow::EvHScrollClipboard ( HWND hCBViewer,
uint scrollCode,
uint pos )
inlineprotected

The default message handler for WM_HSCROLLCLIPBOARD.

Definition at line 3752 of file window.h.

References DefaultProcessing().

◆ EvInitMenu()

void owl::TWindow::EvInitMenu ( HMENU hMenu)
inlineprotected

The default message handler for WM_INITMENU.

Definition at line 3761 of file window.h.

References DefaultProcessing().

◆ EvInitMenuPopup()

void owl::TWindow::EvInitMenuPopup ( HMENU hPopupMenu,
uint index,
bool isSysMenu )
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.

Definition at line 3810 of file window.cpp.

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

◆ EvKeyDown()

void owl::TWindow::EvKeyDown ( uint key,
uint repeatCount,
uint flags )
inlineprotected

The default message handler for WM_KEYDOWN.

Definition at line 3768 of file window.h.

References DefaultProcessing().

◆ EvKeyUp()

void owl::TWindow::EvKeyUp ( uint key,
uint repeatCount,
uint flags )
inlineprotected

The default message handler for WM_KEYUP.

Definition at line 3775 of file window.h.

References DefaultProcessing().

◆ EvKillFocus()

void owl::TWindow::EvKillFocus ( HWND hWndGetFocus)
protected

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

Definition at line 1612 of file window.cpp.

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

◆ EvLButtonDblClk()

void owl::TWindow::EvLButtonDblClk ( uint modKeys,
const TPoint & point )
inlineprotected

The default message handler for WM_LBUTTONDBLCLK.

Definition at line 3782 of file window.h.

References DefaultProcessing().

◆ EvLButtonDown()

void owl::TWindow::EvLButtonDown ( uint modKeys,
const 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

Definition at line 2102 of file window.cpp.

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

◆ EvLButtonUp()

void owl::TWindow::EvLButtonUp ( uint modKeys,
const TPoint & point )
inlineprotected

The default message handler for WM_LBUTTONUP.

Definition at line 3789 of file window.h.

References DefaultProcessing().

◆ EvMButtonDblClk()

void owl::TWindow::EvMButtonDblClk ( uint modKeys,
const TPoint & point )
inlineprotected

The default message handler for WM_MBUTTONDBLCLK.

Definition at line 3796 of file window.h.

References DefaultProcessing().

◆ EvMButtonDown()

void owl::TWindow::EvMButtonDown ( uint modKeys,
const TPoint & point )
inlineprotected

The default message handler for WM_MBUTTONDOWN.

Definition at line 3803 of file window.h.

References DefaultProcessing().

◆ EvMButtonUp()

void owl::TWindow::EvMButtonUp ( uint modKeys,
const TPoint & point )
inlineprotected

The default message handler for WM_MBUTTONUP.

Definition at line 3810 of file window.h.

References DefaultProcessing().

◆ EvMeasureItem()

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();

Definition at line 1741 of file window.cpp.

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

◆ EvMenuChar()

int32 owl::TWindow::EvMenuChar ( uint nChar,
uint menuType,
HMENU hMenu )
inlineprotected

The default message handler for WM_MENUCHAR.

Definition at line 3817 of file window.h.

References DefaultProcessing().

◆ EvMenuSelect()

void owl::TWindow::EvMenuSelect ( uint menuItemId,
uint flags,
HMENU hMenu )
inlineprotected

The default message handler for WM_MENUSELECT.

Definition at line 3824 of file window.h.

References DefaultProcessing().

◆ EvMouseActivate()

uint owl::TWindow::EvMouseActivate ( HWND hTopLevel,
uint hitCode,
TMsgId  )
inlineprotected

The default message handler for WM_MOUSEACTIVATE.

Definition at line 3831 of file window.h.

References DefaultProcessing().

◆ EvMouseHWheel()

void owl::TWindow::EvMouseHWheel ( uint modKeys,
int zDelta,
const TPoint & point )
protected

Event handler for WM_MOUSEHWHEEL.

Responds to horizontal mouse wheel event if Scroller exists.

Definition at line 1822 of file window.cpp.

References DefaultProcessing(), owl::TScroller::ScrollBy(), owl::TScroller::XLine, and owl::TScroller::XPage.

◆ EvMouseMove()

void owl::TWindow::EvMouseMove ( uint modKeys,
const TPoint & point )
inlineprotected

The default message handler for WM_MOUSEMOVE.

Definition at line 3838 of file window.h.

References DefaultProcessing().

◆ EvMouseWheel()

void owl::TWindow::EvMouseWheel ( uint modKeys,
int zDelta,
const TPoint & point )
protected

Event handler for WM_MOUSEWHEEL.

Responds to vertical mouse wheel event if Scroller exists.

Definition at line 1841 of file window.cpp.

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

◆ EvMove()

void owl::TWindow::EvMove ( const 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

Definition at line 1667 of file window.cpp.

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

◆ EvNCActivate()

bool owl::TWindow::EvNCActivate ( bool active)
inlineprotected

The default message handler for WM_NCACTIVATE.

Definition at line 3845 of file window.h.

References DefaultProcessing().

◆ EvNCCalcSize()

uint owl::TWindow::EvNCCalcSize ( bool calcValidRects,
NCCALCSIZE_PARAMS &  )
inlineprotected

The default message handler for WM_NCCALCSIZE.

Definition at line 3852 of file window.h.

References DefaultProcessing().

◆ EvNCCreate()

bool owl::TWindow::EvNCCreate ( CREATESTRUCT & )
inlineprotected

The default message handler for WM_NCCREATE.

Definition at line 3859 of file window.h.

References DefaultProcessing().

◆ EvNCDestroy()

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

Definition at line 2872 of file window.cpp.

References DefaultProcessing(), and SetHandle().

◆ EvNCHitTest()

uint owl::TWindow::EvNCHitTest ( const TPoint & )
inlineprotected

The default message handler for WM_NCHITTEST.

Definition at line 3866 of file window.h.

References DefaultProcessing().

◆ EvNCLButtonDblClk()

void owl::TWindow::EvNCLButtonDblClk ( uint codeHitTest,
const TPoint &  )
inlineprotected

The default message handler for WM_NCLBUTTONDBLCLK.

Definition at line 3873 of file window.h.

References DefaultProcessing().

◆ EvNCLButtonDown()

void owl::TWindow::EvNCLButtonDown ( uint codeHitTest,
const TPoint &  )
inlineprotected

The default message handler for WM_NCLBUTTONDOWN.

Definition at line 3880 of file window.h.

References DefaultProcessing().

◆ EvNCLButtonUp()

void owl::TWindow::EvNCLButtonUp ( uint codeHitTest,
const TPoint &  )
inlineprotected

The default message handler for WM_NCLBUTTONUP.

Definition at line 3887 of file window.h.

References DefaultProcessing().

◆ EvNCMButtonDblClk()

void owl::TWindow::EvNCMButtonDblClk ( uint codeHitTest,
const TPoint &  )
inlineprotected

The default message handler for WM_NCMBUTTONDBLCLK.

Definition at line 3894 of file window.h.

References DefaultProcessing().

◆ EvNCMButtonDown()

void owl::TWindow::EvNCMButtonDown ( uint codeHitTest,
const TPoint &  )
inlineprotected

The default message handler for WM_NCMBUTTONDOWN.

Definition at line 3901 of file window.h.

References DefaultProcessing().

◆ EvNCMButtonUp()

void owl::TWindow::EvNCMButtonUp ( uint codeHitTest,
const TPoint &  )
inlineprotected

The default message handler for WM_NCMBUTTONUP.

Definition at line 3908 of file window.h.

References DefaultProcessing().

◆ EvNCMouseMove()

void owl::TWindow::EvNCMouseMove ( uint codeHitTest,
const TPoint &  )
inlineprotected

The default message handler for WM_NCMOUSEMOVE.

Definition at line 3915 of file window.h.

References DefaultProcessing().

◆ EvNCPaint()

void owl::TWindow::EvNCPaint ( HRGN )
inlineprotected

The default message handler for WM_NCPAINT.

Definition at line 3922 of file window.h.

References DefaultProcessing().

◆ EvNCRButtonDblClk()

void owl::TWindow::EvNCRButtonDblClk ( uint codeHitTest,
const TPoint &  )
inlineprotected

The default message handler for WM_NCRBUTTONDBLCLK.

Definition at line 3929 of file window.h.

References DefaultProcessing().

◆ EvNCRButtonDown()

void owl::TWindow::EvNCRButtonDown ( uint codeHitTest,
const TPoint &  )
inlineprotected

The default message handler for WM_NCRBUTTONDOWN.

Definition at line 3936 of file window.h.

References DefaultProcessing().

◆ EvNCRButtonUp()

void owl::TWindow::EvNCRButtonUp ( uint codeHitTest,
const TPoint &  )
inlineprotected

The default message handler for WM_NCRBUTTONUP.

Definition at line 3943 of file window.h.

References DefaultProcessing().

◆ EvNextDlgCtl()

void owl::TWindow::EvNextDlgCtl ( TParam1 handleOrDirectionFlag,
bool isHandle )
inlineprotected

Definition at line 1334 of file window.h.

References owl::InUse().

◆ EvNotify()

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.

Definition at line 1076 of file window.cpp.

References _T, DefaultProcessing(), GetHandle(), GetParent(), GetWindowPtr(), RouteCommandEnable(), and WARNX.

◆ EvPaint()

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()

Definition at line 2042 of file window.cpp.

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

◆ EvPaintClipboard()

void owl::TWindow::EvPaintClipboard ( HWND hWnd,
const PAINTSTRUCT &  )
inlineprotected

The default message handler for WM_PAINTCLIPBOARD.

Definition at line 3950 of file window.h.

References DefaultProcessing().

◆ EvPaletteChanged()

void owl::TWindow::EvPaletteChanged ( HWND hWndPalChg)
inlineprotected

The default message handler for WM_PALETTECHANGED.

Definition at line 3957 of file window.h.

References DefaultProcessing().

◆ EvPaletteIsChanging()

void owl::TWindow::EvPaletteIsChanging ( HWND hWndPalChg)
inlineprotected

The default message handler for WM_PALETTEISCHANGING.

Definition at line 3964 of file window.h.

References DefaultProcessing().

◆ EvParentNotify()

void owl::TWindow::EvParentNotify ( const TParentNotify & )
inlineprotected

The default message handler for WM_PARENTNOTIFY.

Definition at line 3971 of file window.h.

References DefaultProcessing().

◆ EvQueryDragIcon()

HICON owl::TWindow::EvQueryDragIcon ( )
inlineprotected

The default message handler for WM_QUERYDRAGICON.

Definition at line 4018 of file window.h.

References DefaultProcessing().

◆ EvQueryEndSession()

bool owl::TWindow::EvQueryEndSession ( uint flags)
protected

Respond to Windows attempt to close down.

Determines if this app or window is ready to close.

Definition at line 2883 of file window.cpp.

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

◆ EvQueryNewPalette()

bool owl::TWindow::EvQueryNewPalette ( )
inlineprotected

The default message handler for WM_QUERYNEWPALETTE.

Definition at line 4025 of file window.h.

References DefaultProcessing().

◆ EvQueryOpen()

bool owl::TWindow::EvQueryOpen ( )
inlineprotected

The default message handler for WM_QUERYOPEN.

Definition at line 4032 of file window.h.

References DefaultProcessing().

◆ EvQueueSync()

void owl::TWindow::EvQueueSync ( )
inlineprotected

The default message handler for WM_QUEUESYNC.

Definition at line 4039 of file window.h.

References DefaultProcessing().

◆ EvRButtonDblClk()

void owl::TWindow::EvRButtonDblClk ( uint modKeys,
const TPoint & point )
inlineprotected

The default message handler for WM_RBUTTONDBLCLK.

Definition at line 4060 of file window.h.

References DefaultProcessing().

◆ EvRButtonDown()

void owl::TWindow::EvRButtonDown ( uint modKeys,
const TPoint & point )
inlineprotected

The default message handler for WM_RBUTTONDOWN.

Definition at line 4067 of file window.h.

References DefaultProcessing().

◆ EvRButtonUp()

void owl::TWindow::EvRButtonUp ( uint modKeys,
const TPoint & point )
inlineprotected

The default message handler for WM_RBUTTONUP.

Definition at line 4074 of file window.h.

References DefaultProcessing().

◆ EvRenderAllFormats()

void owl::TWindow::EvRenderAllFormats ( )
inlineprotected

The default message handler for WM_RENDERALLFORMATS.

Definition at line 4046 of file window.h.

References DefaultProcessing().

◆ EvRenderFormat()

void owl::TWindow::EvRenderFormat ( uint dataFormat)
inlineprotected

The default message handler for WM_RENDERFORMAT.

Definition at line 4053 of file window.h.

References DefaultProcessing().

◆ EvSetCursor()

bool owl::TWindow::EvSetCursor ( HWND hWndCursor,
uint codeHitTest,
TMsgId mouseMsg )
protected

Response method for an incoming WM_SETCURSOR message.

If a cursor has been set for this window using TWindow::SetCursor, and the mouse is over the client area, the cursor is used. Otherwise, the cursor for the window class is used (default).

Definition at line 2082 of file window.cpp.

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

◆ EvSetFocus()

void owl::TWindow::EvSetFocus ( HWND hWndLostFocus)
inlineprotected

The default message handler for WM_SETFOCUS.

Definition at line 4081 of file window.h.

References DefaultProcessing().

◆ EvSetFont()

void owl::TWindow::EvSetFont ( HFONT f,
bool redraw )
inlineprotected

The default message handler for WM_SETFONT.

Manages the lifetime of the private font.

See also
SetWindowFont

Definition at line 4091 of file window.h.

References DefaultProcessing().

◆ EvSetIcon()

HICON owl::TWindow::EvSetIcon ( bool isBigIcon,
HICON  )
inlineprotected

Definition at line 1457 of file window.h.

References owl::InUse().

◆ EvSetRedraw()

void owl::TWindow::EvSetRedraw ( bool redraw)
inlineprotected

The default message handler for WM_SETREDRAW.

Definition at line 4105 of file window.h.

References DefaultProcessing().

◆ EvSetText()

void owl::TWindow::EvSetText ( LPCTSTR text)
inlineprotected

The default message handler for WM_SETTEXT.

Definition at line 4112 of file window.h.

References DefaultProcessing().

◆ EvSettingChange()

void owl::TWindow::EvSettingChange ( uint flags,
LPCTSTR section )
inlineprotected

Definition at line 1284 of file window.h.

References owl::InUse().

◆ EvShowWindow()

void owl::TWindow::EvShowWindow ( bool show,
uint status )
inlineprotected

The default message handler for WM_SHOWWINDOW.

Definition at line 4119 of file window.h.

References DefaultProcessing().

◆ EvSize()

void owl::TWindow::EvSize ( uint sizeType,
const 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.

Definition at line 1633 of file window.cpp.

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

◆ EvSizeClipboard()

void owl::TWindow::EvSizeClipboard ( HWND hWndViewer,
const TRect &  )
inlineprotected

The default message handler for WM_SIZECLIPBOARD.

Definition at line 4126 of file window.h.

References DefaultProcessing().

◆ EvSpoolerStatus()

void owl::TWindow::EvSpoolerStatus ( uint jobStatus,
uint jobsLeft )
inlineprotected

The default message handler for WM_SPOOLERSTATUS.

Definition at line 4133 of file window.h.

References DefaultProcessing().

◆ EvSysChar()

void owl::TWindow::EvSysChar ( uint key,
uint repeatCount,
uint flags )
inlineprotected

The default message handler for WM_SYSCHAR.

Definition at line 4140 of file window.h.

References DefaultProcessing().

◆ EvSysColorChange()

void owl::TWindow::EvSysColorChange ( )
protected

Respond to WM_SYSCOLORCHANGE by broadcasting it to all children.

Definition at line 697 of file window.cpp.

References ChildBroadcastMessage(), and DefaultProcessing().

◆ EvSysCommand()

void owl::TWindow::EvSysCommand ( uint cmdType,
const TPoint & point )
inlineprotected

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_KEYMENU:
break;
default:
}
}
TPoint is a support class, derived from tagPOINT.
Definition geometry.h:87
TResult DefaultProcessing()
Handles default processing of events, which includes continued processing of menu/accelerators comman...
Definition window.cpp:853

Definition at line 4011 of file window.h.

References DefaultProcessing().

◆ EvSysDeadChar()

void owl::TWindow::EvSysDeadChar ( uint key,
uint repeatCount,
uint flags )
inlineprotected

The default message handler for WM_SYSDEADCHAR.

Definition at line 4147 of file window.h.

References DefaultProcessing().

◆ EvSysKeyDown()

void owl::TWindow::EvSysKeyDown ( uint key,
uint repeatCount,
uint flags )
inlineprotected

The default message handler for WM_SYSKEYDOWN.

Definition at line 4154 of file window.h.

References DefaultProcessing().

◆ EvSysKeyUp()

void owl::TWindow::EvSysKeyUp ( uint key,
uint repeatCount,
uint flags )
inlineprotected

The default message handler for WM_SYSKEYUP.

Definition at line 4161 of file window.h.

References DefaultProcessing().

◆ EvTimeChange()

void owl::TWindow::EvTimeChange ( )
inlineprotected

The default message handler for WM_TIMECHANGE.

Definition at line 4168 of file window.h.

References DefaultProcessing().

◆ EvTimer()

void owl::TWindow::EvTimer ( uint timerId)
inlineprotected

The default message handler for WM_TIMER.

Definition at line 4175 of file window.h.

References DefaultProcessing().

◆ EvVKeyToItem()

int owl::TWindow::EvVKeyToItem ( uint key,
HWND hWndListBox,
int caretIndex )
inlineprotected

The default message handler for WM_VKEYTOITEM.

Definition at line 3626 of file window.h.

References DefaultProcessing().

◆ EvVScroll()

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

Definition at line 1893 of file window.cpp.

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

◆ EvVScrollClipboard()

void owl::TWindow::EvVScrollClipboard ( HWND hCBViewer,
uint scrollCode,
uint pos )
inlineprotected

The default message handler for WM_VSCROLLCLIPBOARD.

Definition at line 4193 of file window.h.

References DefaultProcessing().

◆ EvWindowPosChanged()

void owl::TWindow::EvWindowPosChanged ( const WINDOWPOS & windowPos)
inlineprotected

The default message handler for WM_WINDOWPOSCHANGED.

Definition at line 4202 of file window.h.

References DefaultProcessing().

◆ EvWindowPosChanging()

bool owl::TWindow::EvWindowPosChanging ( WINDOWPOS & )
inlineprotected

The default message handler for WM_WINDOWPOSCHANGING.

Definition at line 4209 of file window.h.

References DefaultProcessing().

◆ Execute()

int owl::TWindow::Execute ( )
virtual

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

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

Definition at line 2499 of file window.cpp.

References DoExecute().

◆ FlashWindow()

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.

Definition at line 2911 of file window.h.

References GetHandle(), and PRECONDITION.

◆ FormatMessageBox() [1/2]

auto owl::TWindow::FormatMessageBox ( const tstring & ,
std::nullptr_t ,
uint ,
... ) const -> int=delete
delete

◆ FormatMessageBox() [2/2]

auto owl::TWindow::FormatMessageBox ( const tstring & formatStr,
const tstring & caption,
uint flags,
... ) const -> int

Definition at line 4362 of file window.cpp.

References _T, MessageBox(), and WARNX.

◆ ForwardMessage() [1/2]

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

Forwards the window's current message.

Calls SendMessage if send is true; otherwise calls PostMessage.

Definition at line 3327 of file window.cpp.

References ForwardMessage(), GetCurrentEvent(), GetHandle(), and HandleMessage().

◆ ForwardMessage() [2/2]

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

Forwards the window's current message.

Calls SendMessage if send is true; otherwise calls PostMessage.

Definition at line 3303 of file window.cpp.

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

◆ GetActiveWindow()

HWND owl::TWindow::GetActiveWindow ( )
inlinestatic

Retrieves the handle of the active window.

Returns 0 if no window is associated with the calling thread.

Note
Wrapper for Windows API.

Definition at line 2699 of file window.h.

◆ GetApplication()

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.

Definition at line 1852 of file window.h.

◆ GetBkgndColor()

auto owl::TWindow::GetBkgndColor ( ) const -> TColor
inline

Returns the overriding background color set for the window.

If the window has no overriding background color, then TColor::None is returned. In this case the WNDCLASS::hbrBackground setting will determine the background color. If the window performs no background erasing, then TColor::Transparent is returned. See TWindow::SetBkgndColor, TWindow::EvEraseBkgnd and TWindow::EvCtlColor.

Definition at line 1910 of file window.h.

◆ GetCaption()

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.

Definition at line 1897 of file window.h.

◆ GetCapture()

HWND owl::TWindow::GetCapture ( )
inlinestatic

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

Note
Wrapper for Windows API.

Definition at line 2109 of file window.h.

◆ GetCaretBlinkTime()

uint owl::TWindow::GetCaretBlinkTime ( )
inlinestatic

Retrieves the caret blink rate in milliseconds.

Note
Wrapper for Windows API.

Definition at line 3383 of file window.h.

◆ GetCaretPos() [1/2]

static TPoint owl::TWindow::GetCaretPos ( )
inlinestatic

Definition at line 1201 of file window.h.

References GetCaretPos().

◆ GetCaretPos() [2/2]

void owl::TWindow::GetCaretPos ( TPoint & point)
inlinestatic

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.

Definition at line 3394 of file window.h.

References GetCaretPos().

◆ GetChildRect() [1/2]

TRect owl::TWindow::GetChildRect ( const TWindow & wnd) const
inline

Overload for TWindow See GetChildRect(HWND).

Definition at line 997 of file window.h.

◆ GetChildRect() [2/2]

TRect owl::TWindow::GetChildRect ( HWND hWnd) const
inline

Returns the window rectangle of the given window, specified in this window's client coordinates.

Definition at line 985 of file window.h.

◆ GetChildren() [1/2]

auto owl::TWindow::GetChildren ( )
inline

Returns a TWindow::TChildrenRange that can be iterated by standard means.

This function allows iteration over the children using range-based for-loops or algorithms based on ranges and iterators, such as those in the C++ standard library. For example:

for (auto& w : parent.GetChildren())
const auto c = GetChildren();
const auto grandChildrenCount = std::accumulate(c.cbegin(), c.cend(), 0,
[](int n, const TWindow& w)
{
return n + w.NumChildren();
});
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:411
auto GetChildren()
Returns a TWindow::TChildrenRange that can be iterated by standard means.
Definition window.h:547
void SetWindowFont(HFONT font, bool redraw=true)
Sets the font that a control uses to draw text.
Definition window.h:3473
HFONT GetWindowFont()
Gets the font the control uses to draw text.
Definition window.h:3486

Definition at line 547 of file window.h.

◆ GetChildren() [2/2]

auto owl::TWindow::GetChildren ( ) const
inline

Const overload of TWindow::GetChildren.

Definition at line 552 of file window.h.

◆ GetClassLong()

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

Definition at line 2323 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetClassName()

auto owl::TWindow::GetClassName ( TCHAR * className,
int maxCount ) const -> int
inline

Returns the Windows class name for this object's window handle.

This function is a wrapper for the Windows API function GetClassName. http://msdn.microsoft.com/en-us/library/windows/desktop/ms633582.aspx

Definition at line 2304 of file window.h.

References PRECONDITION.

◆ GetClassWord()

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

Definition at line 2348 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetClientRect() [1/2]

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.

Definition at line 2214 of file window.h.

References GetClientRect().

◆ GetClientRect() [2/2]

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

Definition at line 3625 of file window.cpp.

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

◆ GetContextMenu()

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

Returns the associated popup menu used by the window.

Definition at line 3263 of file window.h.

◆ GetCurrentEvent()

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

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

Definition at line 2044 of file window.h.

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

◆ GetCursorPos() [1/2]

static TPoint owl::TWindow::GetCursorPos ( )
inlinestatic

Definition at line 1209 of file window.h.

References GetCursorPos().

◆ GetCursorPos() [2/2]

void owl::TWindow::GetCursorPos ( TPoint & pos)
inlinestatic

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.

Definition at line 3462 of file window.h.

References GetCursorPos().

◆ GetDesktopWindow()

HWND owl::TWindow::GetDesktopWindow ( )
inlinestatic

Returns a handle to the desktop window.

Note
Wrapper for Windows API.

Definition at line 2720 of file window.h.

◆ GetDlgCtrlID()

int owl::TWindow::GetDlgCtrlID ( ) const
inline

Returns the ID of the control.

Note
Wrapper for Windows API.

Definition at line 3094 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetDlgItem()

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

Retrieves the handle of a control specified by childId.

Note
Wrapper for Windows API.

Definition at line 3105 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetDlgItemFont()

HFONT owl::TWindow::GetDlgItemFont ( int childId) const
inline

Definition at line 1169 of file window.h.

References GetWindowFont().

◆ GetDlgItemInt()

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

Translates the text of a specified control into an integer value and returns it.

The parameter 'translated' points to a variable that is set to 'true' on success, 'false' otherwise. The parameter 'isSigned' indicates that the retrieved value is signed (the default).

Note
Wraps the corresponding function in the Windows API.

Definition at line 3505 of file window.cpp.

References GetDlgItemInt(), GetHandle(), and PRECONDITION.

◆ GetDlgItemRect()

TRect owl::TWindow::GetDlgItemRect ( int childId) const
inline

Returns the window rectangle of the given child, specified in this window's client coordinates.

Definition at line 1175 of file window.h.

◆ GetDlgItemText() [1/2]

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

String-aware overload.

Definition at line 4438 of file window.cpp.

References owl::CopyText(), GetDlgItem(), and GetWindowTextLength().

◆ GetDlgItemText() [2/2]

int owl::TWindow::GetDlgItemText ( int childId,
TCHAR * text,
int maxLen ) const
inline

Retrieves the text of a control specified by childId.

text points to the text buffer to receive the text. maxLen specifies the maximum length of the caption, which is truncated if it exceeds this length.

Note
Wrapper for Windows API.

Definition at line 3130 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetExStyle()

auto owl::TWindow::GetExStyle ( ) const

Gets the extra style bits of the window.

Definition at line 3576 of file window.cpp.

◆ GetFirstChild() [1/2]

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.

Definition at line 1767 of file window.h.

◆ GetFirstChild() [2/2]

auto owl::TWindow::GetFirstChild ( ) const -> const TWindow*
inline

Definition at line 559 of file window.h.

References GetFirstChild().

◆ GetFocus()

HWND owl::TWindow::GetFocus ( )
inlinestatic

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.

Definition at line 2136 of file window.h.

◆ GetHandle()

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

Returns the handle of the window.

Definition at line 2017 of file window.h.

◆ GetHWndState()

void owl::TWindow::GetHWndState ( bool forceStyleSync = false)
protected

Copies the style, coordinate, and the resource id (but not the title) from the existing HWnd into the TWindow members.

Note
The title is not copied here, but in GetWindowTextTitle()

Definition at line 3464 of file window.cpp.

References owl::TWindowAttr::ExStyle, GetParentH(), GetWindowLong(), GetWindowRect(), owl::TWindowAttr::H, owl::TWindowAttr::Id, IsFlagSet(), ScreenToClient(), owl::TWindowAttr::Style, owl::TWindowAttr::W, owl::wfFromResource, owl::TWindowAttr::X, and owl::TWindowAttr::Y.

◆ GetId()

int owl::TWindow::GetId ( ) const
inline

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

Definition at line 1878 of file window.h.

References owl::TWindowAttr::Id.

◆ GetLastActivePopup()

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

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

Note
Wrapper for Windows API.

Definition at line 2746 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetLastChild() [1/2]

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

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

Definition at line 1773 of file window.h.

◆ GetLastChild() [2/2]

auto owl::TWindow::GetLastChild ( ) const -> const TWindow*
inline

Definition at line 561 of file window.h.

References GetLastChild().

◆ GetMenu()

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.

Definition at line 3241 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetMessagePos()

static TPoint owl::TWindow::GetMessagePos ( )
inlinestatic

Definition at line 1210 of file window.h.

◆ GetModule()

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

Returns a pointer to the module object.

Definition at line 1838 of file window.h.

References owl::Module.

◆ GetNextDlgGroupItem()

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.

Definition at line 3187 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetNextDlgTabItem()

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.

Definition at line 3202 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetNextWindow()

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.

Definition at line 2735 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetParent()

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

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

Definition at line 2010 of file window.h.

References GetParentO().

◆ GetParentH()

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

Return the handle of the parent.

Definition at line 1996 of file window.h.

References GetHandle(), and GetParent().

◆ GetParentO()

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

Return the OWL's parent for this window.

Definition at line 2003 of file window.h.

◆ GetProp() [1/3]

HANDLE owl::TWindow::GetProp ( const tstring & str) const
inline

Definition at line 1022 of file window.h.

References GetProp().

◆ GetProp() [2/3]

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.

Definition at line 2530 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetProp() [3/3]

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.

Definition at line 2492 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetScroller()

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

Returns the associated scroller object for this window.

Definition at line 1864 of file window.h.

◆ GetScrollInfo() [1/2]

bool owl::TWindow::GetScrollInfo ( int bar,
SCROLLINFO * scrollInfo ) const

Retrieves the properties of the given scroll bar.

The 'scrollInfo' parameter must be properly initialized according to the Windows API documentation for SCROLLINFO. Returns true on success.

Note
Wrapper for Windows API.

Definition at line 4039 of file window.cpp.

References GetHandle(), and PRECONDITION.

◆ GetScrollInfo() [2/2]

SCROLLINFO owl::TWindow::GetScrollInfo ( int bar,
uint mask = SIF_ALL ) const

Function-style overload Returns selected properties of the given scroll bar.

Valid values for the 'mask' parameter are the same as for the SCROLLINFO::fMask member documented by the Windows API.

Note
On failure, SCROLLINFO::nMin, nMax, nPage, nPos and nTrackPos are all left value-initialized (0).

Definition at line 4054 of file window.cpp.

References _T, GetScrollInfo(), owl::InUse(), and WARNX.

◆ GetScrollPage()

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

Returns the page property (SCROLLINFO::nPage) of the given scroll bar.

Definition at line 4162 of file window.cpp.

References GetScrollInfo().

◆ GetScrollPos()

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.

Definition at line 4081 of file window.cpp.

References GetScrollInfo().

◆ GetScrollRange() [1/2]

TWindow::TScrollRange owl::TWindow::GetScrollRange ( int bar) const

Function-style overload.

Definition at line 4130 of file window.cpp.

References GetScrollInfo().

◆ GetScrollRange() [2/2]

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.

Definition at line 4119 of file window.cpp.

References GetScrollInfo().

◆ GetScrollTrackPos()

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

Returns the thumb track position in the scroll bar.

Call this function only during the processing of a scroll message with the SB_THUMBTRACK or SB_THUMBPOSITION code. See GetScrollPos for valid values for the 'bar' parameter.

Definition at line 4105 of file window.cpp.

References GetScrollInfo().

◆ GetStyle()

auto 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.

Definition at line 3559 of file window.cpp.

◆ GetSystemMenu()

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.

Definition at line 3253 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetTextColor()

auto owl::TWindow::GetTextColor ( ) const -> TColor
inline

Returns the overriding text color set for the window.

If the window has no overriding text color, then TColor::None is returned. In this case the system setting will determine the text color.

See also
TWindow::EvCtlColor

Definition at line 1936 of file window.h.

◆ GetTooltip()

TTooltip * owl::TWindow::GetTooltip ( ) const
inlinevirtual

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

Definition at line 1818 of file window.h.

◆ GetTopWindow()

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.

Definition at line 2793 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetTransferBuffer()

void * owl::TWindow::GetTransferBuffer ( ) const
inline

Definition at line 782 of file window.h.

◆ GetTransferBufferSize()

uint owl::TWindow::GetTransferBufferSize ( ) const
inline

Definition at line 783 of file window.h.

◆ GetUpdateRect()

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.

Definition at line 2924 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetUpdateRgn()

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

Definition at line 4251 of file window.cpp.

References GetHandle(), and PRECONDITION.

◆ GetWindow()

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.

Definition at line 2781 of file window.h.

References GetHandle().

◆ GetWindowAttr() [1/2]

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

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

Definition at line 1883 of file window.h.

◆ GetWindowAttr() [2/2]

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

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

Definition at line 1889 of file window.h.

◆ GetWindowClass()

void owl::TWindow::GetWindowClass ( WNDCLASS & wndClass)
protectedvirtual

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 GetWindowClassName, 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, and owl::TPictureWindow.

Definition at line 2248 of file window.cpp.

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

◆ GetWindowClassName()

◆ GetWindowFont()

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.

Definition at line 3486 of file window.h.

References GetHandle(), PRECONDITION, and SendMessage().

◆ GetWindowLong()

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.

Definition at line 2385 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetWindowLongPtr()

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

Definition at line 2415 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetWindowPlacement()

auto owl::TWindow::GetWindowPlacement ( ) const

Wrapper for Windows API.

Returns display and placement information (normal, minimized, and maximized) about the window. Throws TXOwl on failure. To get extended error information, call GetLastError.

Definition at line 3951 of file window.cpp.

References _T, GetHandle(), GetWindowPlacement(), and PRECONDITION.

◆ GetWindowProc()

WNDPROC owl::TWindow::GetWindowProc ( ) const
inline

Definition at line 2456 of file window.h.

References GetHandle(), GetWindowLongPtr(), and PRECONDITION.

◆ GetWindowPtr()

TWindow * owl::TWindow::GetWindowPtr ( HWND hWnd) const
inlineprotected

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.

Definition at line 3564 of file window.h.

References GetApplication(), and owl::GetWindowPtr().

◆ GetWindowRect() [1/2]

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

Gets the screen coordinates of the window's rectangle.

Note
Wrapper for Windows API.

Definition at line 2254 of file window.h.

References GetWindowRect().

◆ GetWindowRect() [2/2]

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

Definition at line 3610 of file window.cpp.

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

◆ GetWindowRgn()

auto owl::TWindow::GetWindowRgn ( TRegion & r) const -> int
inline

Obtains a copy of the region of the window within which the system permits drawing.

Returns the type of region.

Note
Wrapper for Windows API.
See also
http://msdn.microsoft.com/en-us/library/dd144950.aspx

Definition at line 2995 of file window.h.

References PRECONDITION.

◆ GetWindowTask()

HTASK owl::TWindow::GetWindowTask ( ) const
inline

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

Note
Wrapper for Windows API.

Definition at line 3554 of file window.h.

References GetHandle(), HTASK, and PRECONDITION.

◆ GetWindowText() [1/2]

tstring owl::TWindow::GetWindowText ( ) const

String-aware overload.

Definition at line 4416 of file window.cpp.

References owl::CopyText(), and GetWindowTextLength().

◆ GetWindowText() [2/2]

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.

Definition at line 2652 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetWindowTextLength()

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.

Definition at line 2638 of file window.h.

References GetHandle(), and PRECONDITION.

◆ GetWindowTextTitle()

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.

Definition at line 3438 of file window.cpp.

References _T, GetWindowText(), GetWindowTextLength(), and strnewdup().

◆ GetWindowWord()

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

Definition at line 2439 of file window.h.

References GetHandle(), and PRECONDITION.

◆ HandleMessage()

TResult owl::TWindow::HandleMessage ( TMsgId msg,
TParam1 p1 = 0,
TParam2 p2 = 0 )

Dispatches the given message using the response table.

Similar to SendMessage but goes directly to the OWL window, bypassing the Windows message queue.

Definition at line 1393 of file window.cpp.

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

◆ HideCaret()

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.

Definition at line 3406 of file window.h.

References GetHandle(), HideCaret(), and PRECONDITION.

◆ HiliteMenuItem()

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.

Definition at line 3298 of file window.h.

References GetHandle(), and PRECONDITION.

◆ HoldFocusHWnd()

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.

Definition at line 1602 of file window.cpp.

◆ IdleAction()

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 ocf::TOleDialog, owl::TDialog, owl::TFlatComboBox, owl::TFlatEdit, owl::TFlatListBox, owl::TFrameWindow, owl::TGadgetWindow, and owl::TTraceWindow.

Definition at line 672 of file window.cpp.

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

◆ Init() [1/3]

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

Wrapper initialization of a default constructed TWindow.

Is ignored if called more than once.

Definition at line 423 of file window.cpp.

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

◆ Init() [2/3]

void owl::TWindow::Init ( TWindow * parent,
const tstring & title,
TModule * module )
inlineprotected

Definition at line 1471 of file window.h.

References Init().

◆ Init() [3/3]

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.

Definition at line 402 of file window.cpp.

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.

◆ InitWndProc()

LRESULT CALLBACK owl::TWindow::InitWndProc ( HWND hWnd,
UINT msg,
WPARAM param1,
LPARAM param2 )
staticprotected

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.

Definition at line 189 of file owl.cpp.

References owl::GetCreationWindow(), owl::GetDefWindowProc(), and owl::SetCreationWindow().

◆ Invalidate()

void owl::TWindow::Invalidate ( bool erase = true)
inlinevirtual

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.

Definition at line 2819 of file window.h.

References GetHandle(), InvalidateRect(), and PRECONDITION.

◆ InvalidateRect()

void owl::TWindow::InvalidateRect ( const TRect & rect,
bool erase = true )
inlinevirtual

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.

Definition at line 2831 of file window.h.

References GetHandle(), InvalidateRect(), and PRECONDITION.

◆ InvalidateRgn()

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.

Definition at line 2849 of file window.h.

References GetHandle(), InvalidateRgn(), and PRECONDITION.

◆ IsChild()

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.

Definition at line 3173 of file window.h.

References GetHandle(), and PRECONDITION.

◆ IsDlgButtonChecked()

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.

Definition at line 3158 of file window.h.

References GetHandle(), and PRECONDITION.

◆ IsFlagSet()

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.

Definition at line 1794 of file window.h.

◆ IsIconic()

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

Returns true if window is iconic or minimized.

Note
Wrapper for Windows API.

Definition at line 2625 of file window.h.

References GetHandle(), and PRECONDITION.

◆ IsWindow()

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

Returns true if an HWND is being used.

Definition at line 2037 of file window.h.

References GetHandle().

◆ IsWindowEnabled()

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.

Definition at line 2158 of file window.h.

References GetHandle(), and PRECONDITION.

◆ IsWindowVisible()

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.

Definition at line 2602 of file window.h.

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

◆ IsZoomed()

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

Returns true if window is zoomed or maximized.

Note
Wrapper for Windows API.

Definition at line 2614 of file window.h.

References GetHandle(), and PRECONDITION.

◆ KillTimer()

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.

Definition at line 3322 of file window.h.

References GetHandle().

◆ LoadAccelerators()

HACCEL owl::TWindow::LoadAccelerators ( TResId id) const
inline

Definition at line 607 of file window.h.

References owl::TModule::LoadAccelerators(), owl::Module, and PRECONDITION.

◆ LoadAcceleratorTable()

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.

Definition at line 2308 of file window.cpp.

References _T, owl::TWindowAttr::AccelTable, GetModule(), LoadAccelerators(), and WARNX.

◆ LoadBitmap()

HBITMAP owl::TWindow::LoadBitmap ( TResId id) const
inline

Definition at line 606 of file window.h.

References owl::TModule::LoadBitmap(), owl::Module, and PRECONDITION.

◆ LoadCursor()

HCURSOR owl::TWindow::LoadCursor ( TResId id) const
inline

Definition at line 609 of file window.h.

References owl::TModule::LoadCursor(), owl::Module, and PRECONDITION.

◆ LoadHtml()

std::string owl::TWindow::LoadHtml ( TResId id) const
inline

Definition at line 611 of file window.h.

References owl::TModule::LoadHtml(), owl::Module, and PRECONDITION.

◆ LoadIcon()

HICON owl::TWindow::LoadIcon ( TResId id) const
inline

Definition at line 610 of file window.h.

References owl::TModule::LoadIcon(), owl::Module, and PRECONDITION.

◆ LoadMenu()

HMENU owl::TWindow::LoadMenu ( TResId id) const
inline

Definition at line 608 of file window.h.

References owl::TModule::LoadMenu(), owl::Module, and PRECONDITION.

◆ LoadString()

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

Definition at line 605 of file window.h.

References owl::TModule::LoadString(), owl::Module, and PRECONDITION.

◆ LockWindowUpdate()

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.

Definition at line 2942 of file window.h.

References GetHandle(), and PRECONDITION.

◆ MapClientRect() [1/2]

TRect owl::TWindow::MapClientRect ( const TWindow & wndTo) const
inline

Overload for TWindow See MapClientRect(HWND).

Definition at line 970 of file window.h.

◆ MapClientRect() [2/2]

TRect owl::TWindow::MapClientRect ( HWND hWndTo) const
inline

Maps the window's client rectangle (GetClientRect) to client coordinates in the given destination window.

Definition at line 963 of file window.h.

◆ MapClientToScreen() [1/4]

TPoint owl::TWindow::MapClientToScreen ( const TPoint & p) const
inline

Function-style version of ClientToScreen.

Definition at line 835 of file window.h.

◆ MapClientToScreen() [2/4]

TRect owl::TWindow::MapClientToScreen ( const TRect & r) const
inline

Functional-style overload for TRect; converts the given rectangle coordinates and returns the result.

See MapClientToScreen(TPoint*, int).

Definition at line 856 of file window.h.

◆ MapClientToScreen() [3/4]

void owl::TWindow::MapClientToScreen ( TPoint * p,
int count ) const
inline

Maps the given points, specified in client coordinates in this window, to screen coordinates.

Definition at line 841 of file window.h.

◆ MapClientToScreen() [4/4]

template<size_t Count>
void owl::TWindow::MapClientToScreen ( TPoint(&) p[Count]) const
inline

Overload for array See MapClientToScreen(TPoint*, int).

Definition at line 849 of file window.h.

◆ MapScreenToClient() [1/4]

TPoint owl::TWindow::MapScreenToClient ( const TPoint & p) const
inline

Functional-style version of ScreenToClient.

Definition at line 867 of file window.h.

◆ MapScreenToClient() [2/4]

TRect owl::TWindow::MapScreenToClient ( const TRect & r) const
inline

Functional-style overload for TRect; converts the given rectangle coordinates and returns the result.

See MapScreenToClient(TPoint*, int).

Definition at line 888 of file window.h.

◆ MapScreenToClient() [3/4]

void owl::TWindow::MapScreenToClient ( TPoint * p,
int count ) const
inline

Maps the given points, specified in screen coordinates, to client coordinates in this window.

Definition at line 873 of file window.h.

◆ MapScreenToClient() [4/4]

template<size_t Count>
void owl::TWindow::MapScreenToClient ( TPoint(&) p[Count]) const
inline

Overload for array See MapScreenToClient(TPoint*, int).

Definition at line 881 of file window.h.

◆ MapWindowPoints() [1/8]

TPoint owl::TWindow::MapWindowPoints ( const TWindow & wndTo,
const TPoint & p ) const
inline

Overload for TWindow and TPoint See MapWindowPoints(HWND, const TPoint&).

Definition at line 930 of file window.h.

◆ MapWindowPoints() [2/8]

TRect owl::TWindow::MapWindowPoints ( const TWindow & wndTo,
const TRect & r ) const
inline

Overload for TWindow and TRect See MapWindowPoints(HWND, const TRect&).

Definition at line 944 of file window.h.

◆ MapWindowPoints() [3/8]

void owl::TWindow::MapWindowPoints ( const TWindow & wndTo,
TPoint * p,
int n ) const
inline

Overload for TWindow See MapWindowPoints(HWND, TPoint*, int).

Definition at line 900 of file window.h.

◆ MapWindowPoints() [4/8]

template<size_t Count>
void owl::TWindow::MapWindowPoints ( const TWindow & wndTo,
TPoint(&) p[Count] ) const
inline

Overload for TWindow and array See MapWindowPoints(HWND, TPoint*, int).

Definition at line 916 of file window.h.

◆ MapWindowPoints() [5/8]

TPoint owl::TWindow::MapWindowPoints ( HWND hWndTo,
const TPoint & p ) const
inline

Functional-style overload for TPoint; converts the given point coordinates and returns the result.

See MapWindowPoints(HWND, TPoint*, int).

Definition at line 923 of file window.h.

◆ MapWindowPoints() [6/8]

TRect owl::TWindow::MapWindowPoints ( HWND hWndTo,
const TRect & r ) const
inline

Functional-style overload for TRect; converts the given rectangle coordinates and returns the result.

See MapWindowPoints(HWND, TPoint*, int).

Definition at line 937 of file window.h.

◆ MapWindowPoints() [7/8]

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.

Definition at line 2203 of file window.h.

References GetHandle(), MapWindowPoints(), and PRECONDITION.

◆ MapWindowPoints() [8/8]

template<size_t Count>
void owl::TWindow::MapWindowPoints ( HWND hWndTo,
TPoint(&) p[Count] ) const
inline

Overload for array See MapWindowPoints(HWND, TPoint*, int).

Definition at line 908 of file window.h.

◆ MapWindowRect() [1/2]

TRect owl::TWindow::MapWindowRect ( const TWindow & wndTo) const
inline

Overload for TWindow See MapWindowRect(HWND).

Definition at line 957 of file window.h.

◆ MapWindowRect() [2/2]

TRect owl::TWindow::MapWindowRect ( HWND hWndTo) const
inline

Maps the window's rectangle (GetWindowRect) to client coordinates in the given destination window.

Definition at line 950 of file window.h.

◆ MessageBox() [1/4]

int owl::TWindow::MessageBox ( const tstring & text,
const tstring & caption = tstring(),
uint flags = MB_OK ) const
inline

Definition at line 3544 of file window.h.

References MessageBox().

◆ MessageBox() [2/4]

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

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.

Definition at line 4285 of file window.cpp.

References GetApplication(), GetHandle(), owl::TApplication::MessageBox(), and PRECONDITION.

◆ MessageBox() [3/4]

int owl::TWindow::MessageBox ( uint resId,
const tstring & caption,
uint flags = MB_OK ) const

Definition at line 4304 of file window.cpp.

References GetApplication(), GetHandle(), LoadString(), MessageBox(), and PRECONDITION.

◆ MessageBox() [4/4]

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

Definition at line 4293 of file window.cpp.

References GetApplication(), GetHandle(), LoadString(), MessageBox(), and PRECONDITION.

◆ MessageBoxIndirect() [1/2]

auto owl::TWindow::MessageBoxIndirect ( HINSTANCE resourceModule,
TResId text,
TResId caption,
uint styleFlags,
TResId icon,
DWORD_PTR contextHelpId,
MSGBOXCALLBACK callback,
DWORD languageId ) const -> int

Displays a standard message box.

Wrapper for Windows API.

See also
http://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-messageboxindirecta

Definition at line 4319 of file window.cpp.

◆ MessageBoxIndirect() [2/2]

auto owl::TWindow::MessageBoxIndirect ( TResId icon,
const tstring & text,
const tstring & caption,
uint flags = MB_OK ) const -> int

Displays a standard message box using the given icon.

The flag MB_USERICON is automatically combined with the given flags, so there is no need to specify it. Wrapper for Windows API.

Note
The specified icon resource is assumed to reside in the same module as the window, i.e. the HINSTANCE handle passed to MessageBoxIndirect is the value returned by this->GetModule()->GetHandle().
See also
http://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-messageboxindirecta

Definition at line 4347 of file window.cpp.

References PRECONDITION.

◆ ModifyExStyle()

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

Modifies the style bits of the window.

Definition at line 3600 of file window.cpp.

◆ ModifyStyle()

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

Modifies the style bits of the window.

Definition at line 3592 of file window.cpp.

◆ MoveWindow() [1/2]

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.

Definition at line 2580 of file window.h.

References MoveWindow().

◆ MoveWindow() [2/2]

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

Definition at line 2568 of file window.h.

References SetWindowPos().

◆ Next() [1/2]

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

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

Definition at line 1752 of file window.h.

◆ Next() [2/2]

auto owl::TWindow::Next ( ) const -> const TWindow*
inline

Definition at line 555 of file window.h.

References Next().

◆ NumChildren()

unsigned owl::TWindow::NumChildren ( ) const

Returns the number of child windows of the window.

Definition at line 2955 of file window.cpp.

◆ operator HWND()

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.

Definition at line 2024 of file window.h.

◆ Paint()

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::TSplitter, owl::TPreviewPage, owl::TPictureWindow, and owl::TRichEditPagePreview.

Definition at line 2072 of file window.cpp.

◆ PerformCreate()

TWindow::THandle owl::TWindow::PerformCreate ( )
protectedvirtual

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::TMDIFrame, owl::TMDIChild, owl::TUpDown, owl::TFindDialog, and owl::TReplaceDialog.

Definition at line 2346 of file window.cpp.

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

◆ PerformSetupAndTransfer()

void owl::TWindow::PerformSetupAndTransfer ( )
protected

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

Definition at line 2529 of file window.cpp.

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

◆ PostMessage()

bool owl::TWindow::PostMessage ( TMsgId 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.

Definition at line 2100 of file window.h.

References GetHandle(), and PRECONDITION.

◆ PreProcessMsg()

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 ocf::TOleDialog, owl::TDecoratedFrame, owl::TDialog, owl::TFrameWindow, owl::TMDIClient, owl::TMDIChild, owl::TGridPicker, owl::TPropertySheet, and owl::TGadgetWindow.

Definition at line 645 of file window.cpp.

References GetHandle(), GetTooltip(), IsChild(), and PRECONDITION.

◆ Previous() [1/2]

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

Definition at line 3070 of file window.cpp.

◆ Previous() [2/2]

auto owl::TWindow::Previous ( ) const -> const TWindow*
inline

Definition at line 557 of file window.h.

References Previous().

◆ QueryMouseEventTracking()

TRACKMOUSEEVENT owl::TWindow::QueryMouseEventTracking ( ) const

Returns the current state of mouse event tracking initiated by TrackMouseEvent.

Encapsulates a call to TrackMouseEvent, passing the TME_QUERY flag. See TrackMouseEvent and Windows API structure TRACKMOUSEEVENT. http://msdn.microsoft.com/en-gb/library/windows/desktop/ms645604.aspx

Definition at line 3381 of file window.cpp.

References CHECK, GetHandle(), owl::InUse(), and TrackMouseEvent().

◆ RedrawWindow()

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.

Definition at line 2983 of file window.h.

References GetHandle(), and PRECONDITION.

◆ Register()

bool owl::TWindow::Register ( )
virtual

Registers the Windows registration class of this window, if this window is not already registered.

Calls GetWindowClassName and GetWindowClass to retrieve the Windows registration class name and attributes of this window. Register returns true if this window is registered.

Definition at line 2750 of file window.cpp.

References CHECK, GetModule(), GetWindowClass(), and GetWindowClassName().

◆ RegisterHotKey()

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.

Definition at line 3497 of file window.h.

References GetHandle(), and PRECONDITION.

◆ ReleaseCapture()

void owl::TWindow::ReleaseCapture ( )
inlinestatic

Releases the mouse capture from this window.

Note
Wrapper for Windows API.

Definition at line 2127 of file window.h.

References ReleaseCapture().

◆ RemoveChild()

void owl::TWindow::RemoveChild ( TWindow * child)
protectedvirtual

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.

Definition at line 708 of file window.cpp.

◆ RemoveProp() [1/3]

HANDLE owl::TWindow::RemoveProp ( const tstring & str) const
inline

Definition at line 1024 of file window.h.

References RemoveProp().

◆ RemoveProp() [2/3]

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.

Definition at line 2543 of file window.h.

References GetHandle(), and PRECONDITION.

◆ RemoveProp() [3/3]

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.

Definition at line 2505 of file window.h.

References GetHandle(), and PRECONDITION.

◆ ResetWindowRgn()

void owl::TWindow::ResetWindowRgn ( bool repaint = false)
inline

Calls SetWindowRgn(nullptr, repaint).

See also
TWindow::SetWindowRgn(HRGN, bool)

Definition at line 1104 of file window.h.

◆ RouteCommandEnable()

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)

Definition at line 1162 of file window.cpp.

References EvCommandEnable(), GetApplication(), GetParent(), GetWindowPtr(), and WM_COMMAND_ENABLE.

◆ ScreenToClient()

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.

Definition at line 2189 of file window.h.

References GetHandle(), PRECONDITION, and ScreenToClient().

◆ ScrollWindow()

void owl::TWindow::ScrollWindow ( int dx,
int dy,
const TRect * scroll = nullptr,
const TRect * clip = nullptr )
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.

Definition at line 3054 of file window.h.

References GetHandle(), PRECONDITION, and ScrollWindow().

◆ ScrollWindowEx()

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.

Definition at line 3076 of file window.h.

References GetHandle(), PRECONDITION, and ScrollWindowEx().

◆ SendDlgItemMessage()

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

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

Note
Wrapper for Windows API.

Definition at line 2089 of file window.h.

References GetHandle(), and PRECONDITION.

◆ SendMessage()

TResult owl::TWindow::SendMessage ( TMsgId 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.

Definition at line 3289 of file window.cpp.

References GetApplication(), GetHandle(), PRECONDITION, owl::TApplication::ResumeThrow(), and SendMessage().

◆ SendNotification() [1/4]

void owl::TWindow::SendNotification ( HWND receiver,
int id,
int notifyCode,
HWND hCtl,
TMsgId 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.

Definition at line 2060 of file window.h.

References IsWindow(), owl::MkParam1(), PRECONDITION, and SendMessage().

◆ SendNotification() [2/4]

TResult owl::TWindow::SendNotification ( HWND receiver,
uint id,
NMHDR & nmhdr,
TMsgId 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.

Definition at line 2080 of file window.h.

◆ SendNotification() [3/4]

void owl::TWindow::SendNotification ( int id,
int notifyCode,
HWND hCtl,
TMsgId 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.

Definition at line 2052 of file window.h.

References owl::MkParam1(), and SendMessage().

◆ SendNotification() [4/4]

TResult owl::TWindow::SendNotification ( int id,
NMHDR & nmhdr,
TMsgId 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.

Definition at line 2071 of file window.h.

References SendMessage().

◆ SetAcceleratorTable()

void owl::TWindow::SetAcceleratorTable ( TResId resId)

Definition at line 2292 of file window.cpp.

References owl::TWindowAttr::AccelTable, GetHandle(), and LoadAcceleratorTable().

◆ SetActiveWindow()

HWND owl::TWindow::SetActiveWindow ( )
inline

Activates a top-level window.

Returns a handle to the previously active window.

Note
Wrapper for Windows API.

Definition at line 2709 of file window.h.

References GetHandle(), and PRECONDITION.

◆ SetBkgndColor()

void owl::TWindow::SetBkgndColor ( TColor color,
bool shouldUpdate = true )
inline

Sets the background color for the window.

If the given color is TColor::None, the WNDCLASS::hbrBackground setting will determine the background color. If the given color is TColor::Transparent, no background erasing will be performed. Otherwise, the given color will override WNDCLASS::hbrBackground. See TWindow::EvEraseBkgnd and TWindow::EvCtlColor.

Definition at line 1922 of file window.h.

References GetHandle(), and Invalidate().

◆ SetCaption() [1/3]

void owl::TWindow::SetCaption ( const tstring & title)
inline

Definition at line 692 of file window.h.

References SetCaption().

◆ SetCaption() [2/3]

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.

Definition at line 3411 of file window.cpp.

References GetHandle(), SetWindowText(), and strnewdup().

◆ SetCaption() [3/3]

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

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

Definition at line 3427 of file window.cpp.

References LoadString(), and SetCaption().

◆ SetCapture()

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.

Definition at line 2118 of file window.h.

References GetHandle(), and PRECONDITION.

◆ SetCaretBlinkTime()

void owl::TWindow::SetCaretBlinkTime ( uint16 milliSecs)
inlinestatic

Sets the caret blink rate in milliseconds.

Note
Wrapper for Windows API.

Definition at line 3417 of file window.h.

References SetCaretBlinkTime().

◆ SetCaretPos() [1/2]

void owl::TWindow::SetCaretPos ( const TPoint & pos)
inlinestatic

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.

Definition at line 3439 of file window.h.

References SetCaretPos().

◆ SetCaretPos() [2/2]

void owl::TWindow::SetCaretPos ( int x,
int y )
inlinestatic

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.

Definition at line 3428 of file window.h.

References SetCaretPos().

◆ SetClassLong()

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.

Definition at line 2332 of file window.h.

References GetHandle(), and PRECONDITION.

◆ SetClassWord()

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.

Definition at line 2362 of file window.h.

References GetHandle(), and PRECONDITION.

◆ SetCursor()

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

Sets the mouse cursor for the window, loading the given resId from the given module.

If module is nullptr, then resId can be one of the IDC_xxxx constants that represent different kinds of cursors. See the Windows documentation for a list of valid values. If the mouse is over the client area, the function immediately updates the cursor. If resId is 0, then the cursor for the window class is used, according to the default processing for the WM_SETCURSOR message (see EvSetCursor).

Definition at line 3767 of file window.cpp.

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

◆ SetDlgItemFont()

void owl::TWindow::SetDlgItemFont ( int childId,
HFONT f,
bool redraw = false ) const
inline

Definition at line 1166 of file window.h.

References SetWindowFont().

◆ SetDlgItemInt()

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.

Definition at line 3117 of file window.h.

References GetHandle(), PRECONDITION, and SetDlgItemInt().

◆ SetDlgItemText() [1/3]

void owl::TWindow::SetDlgItemText ( int childId,
const tstring & text ) const
inline

Definition at line 1153 of file window.h.

References SetDlgItemText().

◆ SetDlgItemText() [2/3]

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.

Definition at line 3143 of file window.h.

References GetHandle(), PRECONDITION, and SetDlgItemText().

◆ SetDlgItemText() [3/3]

void owl::TWindow::SetDlgItemText ( int childId,
uint resourceStringId ) const
inline

Definition at line 1154 of file window.h.

References SetDlgItemText().

◆ SetDocTitle() [1/2]

bool owl::TWindow::SetDocTitle ( const tstring & docname,
int index )
inline

Definition at line 690 of file window.h.

References SetDocTitle().

◆ SetDocTitle() [2/2]

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::TWindowView, owl::TDialogView, owl::TEditView, owl::TFrameWindow, owl::TListBoxView, owl::TPaneSplitterView, owl::TRichEditView, ocf::TOleView, owl::TTreeViewCtrlView, owl::TListViewCtrlView, owl::TWindowView, owl::TDialogView, owl::TEditView, owl::TFrameWindow, owl::TListBoxView, owl::TPaneSplitterView, owl::TRichEditView, and owl::TTabbedView.

Definition at line 779 of file window.cpp.

References SetDocTitle().

◆ SetExStyle()

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

Sets the extra style bits of the window.

Definition at line 3584 of file window.cpp.

◆ SetFlag()

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.

Definition at line 1780 of file window.h.

◆ SetFocus()

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.

Definition at line 2148 of file window.h.

References GetHandle(), and PRECONDITION.

◆ SethAccel()

void owl::TWindow::SethAccel ( HACCEL _hAccel)

Definition at line 4395 of file window.cpp.

◆ SetHandle()

void owl::TWindow::SetHandle ( THandle handle)
inlineprotected

Sets the window handle in a derived class.

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

Definition at line 2031 of file window.h.

◆ SetMenu()

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.

Definition at line 3275 of file window.h.

References GetHandle(), and PRECONDITION.

◆ SetModule()

void owl::TWindow::SetModule ( TModule * module)
inline

Sets the default module for this window.

Definition at line 1844 of file window.h.

References owl::Module.

◆ SetNext()

void owl::TWindow::SetNext ( TWindow * next)
inline

Sets the next window in the sibling list.

Definition at line 1759 of file window.h.

◆ SetParent()

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.

Definition at line 739 of file window.cpp.

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

◆ SetProp() [1/3]

bool owl::TWindow::SetProp ( const tstring & str,
HANDLE data ) const
inline

Definition at line 1026 of file window.h.

References SetProp().

◆ SetProp() [2/3]

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.

Definition at line 2555 of file window.h.

References GetHandle(), and PRECONDITION.

◆ SetProp() [3/3]

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.

Definition at line 2516 of file window.h.

References GetHandle(), and PRECONDITION.

◆ SetRedraw()

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.

Definition at line 2179 of file window.h.

References GetHandle(), PRECONDITION, and SendMessage().

◆ SetScroller()

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.

Definition at line 789 of file window.cpp.

◆ SetScrollInfo()

int owl::TWindow::SetScrollInfo ( int bar,
SCROLLINFO * scrollInfo,
bool redraw = true )

Sets the properties of the given scroll bar.

Returns the current position of the scroll bar thumb.

Note
Wrapper for Windows API.

Definition at line 4068 of file window.cpp.

References GetHandle(), and PRECONDITION.

◆ SetScrollPage()

void owl::TWindow::SetScrollPage ( int bar,
int page,
bool redraw = true )

Sets the page property (SCROLLINFO::nPage) of the given scroll bar.

Definition at line 4171 of file window.cpp.

References SetScrollInfo().

◆ SetScrollPos()

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

Sets the thumb position in the scroll bar.

Parameter 'bar' identifies the position (horizontal, vertical, or scroll bar control) to return and can be one of the SB_Xxxx scroll bar constants. Returns the current position of the scroll bar thumb.

Definition at line 4093 of file window.cpp.

References SetScrollInfo().

◆ SetScrollRange() [1/2]

void owl::TWindow::SetScrollRange ( int bar,
const TScrollRange & r,
bool redraw = true )

Overload taking the range as a pair.

Definition at line 4153 of file window.cpp.

References SetScrollRange().

◆ SetScrollRange() [2/2]

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.

Definition at line 4143 of file window.cpp.

References SetScrollInfo().

◆ SetStyle()

auto 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.

Definition at line 3568 of file window.cpp.

◆ SetTextColor()

void owl::TWindow::SetTextColor ( TColor color,
bool shouldUpdate = true )
inline

Sets the text color for the window.

If the given color is TColor::None, the system setting will determine the text color.

Note
TColor::Transparent is not supported. If true (default) is passed for shouldUpdate, then the whole window is invalidated.
See also
TWindow::EvCtlColor

Definition at line 1948 of file window.h.

References GetHandle(), Invalidate(), PRECONDITION, and owl::TColor::Transparent.

◆ SetTimer()

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.

Definition at line 3336 of file window.h.

References GetHandle().

◆ SetTooltip()

void owl::TWindow::SetTooltip ( TTooltip * tooltip)

Definition at line 4213 of file window.cpp.

References Create(), GetHandle(), and SendMessage().

◆ SetTransferBuffer() [1/3]

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.

Definition at line 1977 of file window.h.

References SetTransferBuffer().

◆ SetTransferBuffer() [2/3]

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.

Definition at line 1985 of file window.h.

References SetTransferBuffer().

◆ SetTransferBuffer() [3/3]

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

Sets TransferBuffer and TransferBufferSize.

Definition at line 1968 of file window.h.

◆ SetupWindow()

void owl::TWindow::SetupWindow ( )
protectedvirtual

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()
{
InitEntries(); // Initialize .INI entries.
RestoreFromINIFile(); // from APPLAUNC.INI in the startup directory
}
void SetupWindow() override
Calls TWindow::SetUpWindow to create windows in a child list.

Reimplemented in owl::TTabCheckList, owl::TComboBox, owl::TCoolBar, owl::TInputDialog, owl::TPageScroller, owl::TProgressBar, ocf::TOleDialog, ocf::TOleFrame, ocf::TOleWindow, owl::TButton, owl::TCheckList, owl::TClipboardViewer, owl::TComboBoxEx, owl::TCommonDialog, 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::TMemComboBox, owl::TNoteTab, owl::TPaneSplitter, owl::TGridPicker, owl::TColorPicker, owl::TPickListDialog, owl::TPreviewWin, owl::TPrinterAbortDlg, owl::TPropertySheet, owl::TRichEdit, owl::TRichEditView, owl::TRollDialog, owl::TScrollBar, owl::TSlider, owl::TSplashWindow, and owl::TTraceWindow.

Definition at line 2576 of file window.cpp.

References _T, CreateChildren(), GetApplication(), owl::TApplication::GetTooltip(), IsFlagSet(), owl::TScroller::SetSBarRange(), owl::TScroller::SetWindow(), owl::tdSetData, TRACEX, TransferData(), and owl::wfMainWindow.

◆ SetWindowFont() [1/2]

void owl::TWindow::SetWindowFont ( const TFont & font,
bool redraw = true )

Sets the font that a control uses to draw text.

If the given font owns the underlying font handle (HFONT), the window will share ownership. If the given font does not own the handle, neither will the window. In any case, the given TFont object does not need to outlive the window. However, if the underlying font handle is not owned, the caller must make sure that the font handle outlives the window. In this last case, the call is equivalent to SetWindowFont (font.GetHandle(), redraw).

Note
Wrapper for Windows API.

Definition at line 3860 of file window.cpp.

References _T, SetWindowFont(), and WARN.

◆ SetWindowFont() [2/2]

void owl::TWindow::SetWindowFont ( HFONT font,
bool redraw = true )
inline

Sets the font that a control uses to draw text.

The caller must make sure the font handle outlives the window.

Note
Wrapper for Windows API.

Definition at line 3473 of file window.h.

References GetHandle(), PRECONDITION, and SendMessage().

◆ SetWindowLong()

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.

Definition at line 2397 of file window.h.

References GetHandle(), and PRECONDITION.

◆ SetWindowLongPtr()

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

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

Definition at line 2425 of file window.h.

References GetHandle(), and PRECONDITION.

◆ SetWindowPlacement()

void owl::TWindow::SetWindowPlacement ( const WINDOWPLACEMENT & place)

Wrapper for Windows API.

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. Throws TXOwl on failure. To get extended error information, call GetLastError.

Definition at line 3968 of file window.cpp.

References _T, GetHandle(), PRECONDITION, and SetWindowPlacement().

◆ SetWindowPos() [1/2]

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.

Definition at line 2806 of file window.h.

References SetWindowPos().

◆ SetWindowPos() [2/2]

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.

Definition at line 3666 of file window.cpp.

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

◆ SetWindowProc()

WNDPROC owl::TWindow::SetWindowProc ( WNDPROC wndProc)
inline

Definition at line 2464 of file window.h.

References GetHandle(), PRECONDITION, and SetWindowLongPtr().

◆ SetWindowRgn() [1/3]

auto owl::TWindow::SetWindowRgn ( const TRegion & ,
bool repaint = false ) -> bool=delete
delete

◆ SetWindowRgn() [2/3]

auto owl::TWindow::SetWindowRgn ( HRGN r,
bool repaint = false ) -> bool
inline

Sets the area within the window where the system permits drawing.

If the call is successful the system takes ownership of the given region. You must then not make any further function calls with this region handle.

Note
Wrapper for Windows API.
See also
https://msdn.microsoft.com/en-us/library/dd145102.aspx

Definition at line 3008 of file window.h.

References PRECONDITION.

◆ SetWindowRgn() [3/3]

auto owl::TWindow::SetWindowRgn ( TRegion && r,
bool repaint = false ) -> bool

Overload for TRegion.

Note
The system takes ownership of the region handle, hence you must pass a moveable argument. For example, SetWindowRgn(TRegion{...}) or SetWindowRegion(std::move(rgn)).
See also
TWindow::SetWindowRgn(HRGN, bool)

Definition at line 4025 of file window.cpp.

References PRECONDITION.

◆ SetWindowText() [1/3]

void owl::TWindow::SetWindowText ( const tstring & str)
inline

Definition at line 1055 of file window.h.

References SetWindowText().

◆ SetWindowText() [2/3]

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

Sets the window's text to the given string (by copying).

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 text.

Note
Wrapper for Windows API.

Definition at line 2666 of file window.h.

References GetHandle(), PRECONDITION, and SetWindowText().

◆ SetWindowText() [3/3]

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

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

Definition at line 2676 of file window.h.

References LoadString(), and SetWindowText().

◆ SetWindowWord()

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).

Definition at line 2449 of file window.h.

References GetHandle(), and PRECONDITION.

◆ ShowCaret()

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.

Definition at line 3450 of file window.h.

References GetHandle(), PRECONDITION, and ShowCaret().

◆ ShowOwnedPopups()

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.

Definition at line 2590 of file window.h.

References GetHandle(), PRECONDITION, and ShowOwnedPopups().

◆ ShowScrollBar()

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.

Definition at line 3040 of file window.h.

References GetHandle(), PRECONDITION, and ShowScrollBar().

◆ ShowWindow()

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.

Definition at line 3714 of file window.cpp.

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

◆ ShutDownWindow() [1/2]

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

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

Definition at line 1871 of file window.h.

References ShutDownWindow().

◆ ShutDownWindow() [2/2]

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'.

Definition at line 3398 of file window.cpp.

References Destroy().

◆ SubclassWindowFunction()

void owl::TWindow::SubclassWindowFunction ( )

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

Definition at line 2721 of file window.cpp.

References DefWindowProc(), GetHandle(), GetWindowProc(), PRECONDITION, and SetWindowProc().

◆ TraceWindowPlacement()

void owl::TWindow::TraceWindowPlacement ( )
Todo
Make protected or private

Definition at line 306 of file window.cpp.

References GetHandle(), GetWindowPlacement(), and TRACEX.

◆ TrackMouseEvent()

bool owl::TWindow::TrackMouseEvent ( uint flags = TME_HOVER | TME_LEAVE,
int hoverTime = HOVER_DEFAULT )

Posts messages when the mouse pointer leaves a window or hovers over a window for a specified amount of time.

Encapsulates the eponymous Windows API function. http://msdn.microsoft.com/en-gb/library/windows/desktop/ms646265.aspx

Definition at line 3358 of file window.cpp.

References GetHandle().

◆ Transfer()

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::TColumnHeader, owl::TComboBox, owl::TDateTimePicker, owl::THotKey, owl::TIPAddress, owl::TListBox, owl::TMonthCalendar, owl::TTransferBufferWindowBase, owl::TCheckBox, owl::TCheckList, owl::TComboBoxEx, owl::TEdit, owl::TMemComboBox, owl::TNoteTab, owl::TRichEdit, owl::TScrollBar, owl::TStatic, owl::TTabControl, and owl::TTreeViewCtrl.

Definition at line 2656 of file window.cpp.

References GetChildren(), owl::tdSizeData, and owl::wfTransfer.

◆ TransferData()

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::TTransferWindow< TDataSource >, owl::TDelegatedTransferWindow, owl::TTransferBufferWindowBase, and owl::TInputDialog.

Definition at line 2692 of file window.cpp.

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

◆ UnregisterHotKey()

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

Unregisters a hotkey ID with the current application.

Definition at line 3506 of file window.h.

References GetHandle(), and PRECONDITION.

◆ UpdateWindow()

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.

Definition at line 2898 of file window.h.

References GetHandle(), PRECONDITION, and UpdateWindow().

◆ Validate()

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.

Definition at line 2861 of file window.h.

References GetHandle(), PRECONDITION, and ValidateRect().

◆ ValidateRect()

void owl::TWindow::ValidateRect ( const TRect & rect)
inline

Validates a portion of the client area indicated by rect.

Note
Wrapper for Windows API.

Definition at line 2872 of file window.h.

References GetHandle(), PRECONDITION, and ValidateRect().

◆ ValidateRgn()

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.

Definition at line 2886 of file window.h.

References GetHandle(), PRECONDITION, and ValidateRgn().

◆ WindowFromPoint()

HWND owl::TWindow::WindowFromPoint ( const TPoint & point)
inlinestatic

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

Note
Wrapper for Windows API.

Definition at line 2224 of file window.h.

◆ WindowProc()

TResult owl::TWindow::WindowProc ( TMsgId 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.

Definition at line 1410 of file window.cpp.

References _T, DefWindowProc(), owl::TEventHandler::Dispatch(), EvCommand(), EvCommandEnable(), EvNotify(), owl::TEventHandler::Find(), GetApplication(), GetHandle(), owl::HiUint16(), IsFlagSet(), owl::LoUint16(), PRECONDITION, TRACEX, TYPE_UNIQUE_ID, owl::wfMainWindow, and WM_COMMAND_ENABLE.

◆ WinHelp() [1/2]

bool owl::TWindow::WinHelp ( const tstring & helpFile,
uint command,
ULONG_PTR data ) const
inline

Definition at line 1226 of file window.h.

References WinHelp().

◆ WinHelp() [2/2]

bool owl::TWindow::WinHelp ( LPCTSTR helpFile,
uint command,
ULONG_PTR data ) const
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) {
F1Pressed = false;
} else {
MessageBox("In Menu Item A command", Title, MB_ICONINFORMATION);
}
}
bool WinHelp(LPCTSTR helpFile, uint command, ULONG_PTR data) const
Invokes a specified help system.
Definition window.h:3537

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.

Definition at line 3537 of file window.h.

References GetHandle(), and PRECONDITION.

Friends And Related Symbol Documentation

◆ DispatchWindowMessage

TResult CALLBACK DispatchWindowMessage ( TWindow * w,
TMsgId msg,
TParam1 param1,
TParam2 param2 )
friend

Definition at line 506 of file owl.cpp.

◆ GetMessageReceiverMemberFunctionAddress

void * GetMessageReceiverMemberFunctionAddress ( )
friend

Definition at line 543 of file owl.cpp.


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