Macros | Typedefs | Functions
msnativewindow.h File Reference
#include <Mstn\MdlApi\mdl.h>
#include <Mstn\MdlApi\global.h>
#include <Mstn\MdlApi\dlogitem.h>
#include <Mstn\MdlApi\mstypes.h>
#include <UI\Core\BSize.h>

Go to the source code of this file.

Macros

#define __msnativewindowH__
 
#define winNT
 
#define NO_BOOLEAN_TYPE
 

Typedefs

typedef void * PVOID
 
typedef PVOID HANDLE
 
typedef HANDLE HWND
 
typedef HANDLE HICON
 
typedef HANDLE HINSTANCE
 
typedef HANDLE HACCEL
 
typedef long LONG_PTR
 
typedef unsigned int UINT_PTR
 
typedef LONG_PTR LPARAM
 
typedef UINT_PTR WPARAM
 
typedef LONG_PTR LRESULT
 

Functions

StatusInt mdlNativeWindow_initialize (char *pAppId)
 Initializes the support system for native windows. More...
 
bool mdlNativeWindow_isBentleyProductEnv ()
 Determines whether MicroStation, or another core Bentley product, is running. More...
 
HINSTANCE mdlNativeWindow_getInstance ()
 Gets the HINSTANCE of MicroStation. More...
 
HWND mdlNativeWindow_getMainHandle (int iScreen)
 Gets the HWND of MicroStation's main window. More...
 
HICON mdlNativeWindow_getMainIcon ()
 Gets the HICON of MicroStation's main icon. More...
 
HWND mdlNativeWindow_getWindowHandle (MSWindowP windowP)
 Gets the HWND associated with a given MicroStation's window. More...
 
StatusInt mdlNativeWindow_createMSWindow (MSWindow **windowPP, HWND hAppWin, bool bModal, bool bResizeable, int resourceId)
 Creates an instance of an MSWindow to reflect the application's native window. More...
 
StatusInt mdlNativeWindow_createMSWindowEx (MSWindow **windowPP, HWND hAppWin, bool bModal, bool bResizeable, bool bAbsolutePos, RscId resourceId, WCharCP alias, GuiWAttributes *pAttributes)
 Extended version of mdlNativeWindow_createMSWindow with additional parameters. More...
 
StatusInt mdlNativeWindow_closeMSWindow (MSWindowP windowP, bool removeHooksFirst, HideReasonCode reasonCode, bool bypassFocusOut)
 
Closes the windows by hiding it then

and deallocating it, invalidating windowP for any further mdlNativeWindow_... More...

 
StatusInt mdlNativeWindow_destroyMSWindow (MSWindowP windowP, bool bSavePosition)
 Destroys the MSWindow instance. More...
 
StatusInt mdlNativeWindow_setAsChild (MSWindowP windowP, int iScreen, bool bChildStyle)
 Sets the native window as a child of MicroStation's main window. More...
 
StatusInt mdlNativeWindow_addToWindowList (MSWindowP windowP)
 Adds a native window to MicroStation's window list for menu selection. More...
 
StatusInt mdlNativeWindow_removeFromWindowList (MSWindowP windowP)
 Removes a native window from MicroStation's window list. More...
 
StatusInt mdlNativeWindow_getPreviousPosition (BSIRect *pRect, int *pScreen, MSWindowP windowP)
 Gets the previous position, size and screen from the preferences. More...
 
StatusInt mdlNativeWindow_savePosition (MSWindowP windowP)
 Saves the current position, size and screen to the preferences. More...
 
StatusInt mdlNativeWindow_minimize (MSWindowP windowP)
 Minimizes a native window within the MicroStation windowing framework. More...
 
StatusInt mdlNativeWindow_maximize (MSWindowP windowP)
 Maximizes a native window within the MicroStation windowing framework. More...
 
StatusInt mdlNativeWindow_restore (MSWindowP windowP)
 Restores a minimized or maximized native window within the MicroStation windowing framework. More...
 
StatusInt mdlNativeWindow_resize (MSWindowP windowP, int iWidth, int iHeight)
 Resizes a window based on the width and height provided. More...
 
bool mdlNativeWindow_hasFocus (MSWindowP windowP)
 Determines whether a given MicroStation window has focus. More...
 
bool mdlNativeWindow_isTwoApplicationWindows ()
 Determines whether MicroStation is operating in two application screen mode. More...
 
int mdlNativeWindow_getApplicationWindowCount ()
 Gets the number of application screens. More...
 
StatusInt mdlNativeWindow_changeScreen (MSWindowP windowP)
 Changes the native window from one MicroStation screen to the other. More...
 
StatusInt mdlNativeWindow_changeScreenEx (MSWindowP windowP, int newScreen)
 Changes the native window from one MicroStation screen to another other. More...
 
StatusInt mdlNativeWindow_onSetFocus (MSWindowP windowP, HWND hOldWin)
 Should be called in response to a WM_SETFOCUS event. More...
 
int mdlNativeWindow_onMouseActivate (MSWindowP windowP, UInt32 nHitTest, UInt32 message)
 Should be called in response to a WM_MOUSEACTIVATE event. More...
 
StatusInt mdlNativeWindow_onKillFocus (MSWindowP windowP, HWND hWndGaining)
 Should be called in response to a WM_KILLFOCUS event. More...
 
StatusInt mdlNativeWindow_onEscapeKey (MSWindowP windowP, void *pMsg)
 Should be called in response to a WM_KEYDOWN event for a VK_ESCAPE character. More...
 
StatusInt mdlNativeWindow_onFunctionKey (MSWindowP windowP, int messageId, WPARAM wParam, LPARAM lParam)
 Should be called in response to a WM_KEYDOWN event for VK_F1 through VK_F24 characters. More...
 
StatusInt mdlNativeWindow_onSysCommand (MSWindowP windowP, UInt32 nID, LPARAM lParam)
 Should be called in response to a WM_SYSCOMMAND event. More...
 
StatusInt mdlNativeWindow_onMouse (MSWindowP windowP, UInt32 msgType, UInt32 nFlags, int pointX, int pointY)
 Should be called in response to a WM_MOUSEMOVE or any Windows Button event such as WM_LBUTTONDOWN. More...
 
StatusInt mdlNativeWindow_onMove (MSWindowP windowP, int x, int y)
 Should be called in response to a window movement message such as WM_WINDOWPOSCHANGED. More...
 
StatusInt mdlNativeWindow_onResize (MSWindowP windowP, int width, int height)
 Should be called in response to a window resize message such as WM_WINDOWPOSCHANGED. More...
 
StatusInt mdlNativeWindow_onWindowPosChanged (MSWindowP windowP, WPARAM wParam, LPARAM lParam)
 Should be called in response to a WM_WINDOWPOSCHANGED message. More...
 
StatusInt mdlNativeWindow_onModalOpened (MSWindowP windowP)
 Should be called in response to a modal window being opened. More...
 
StatusInt mdlNativeWindow_getToolSettingsWindow (MSWindow **windowPP)
 Gets the MSWindow instance for MicroStation's Tool Settings window. More...
 
void mdlNativeWindow_setToolSettingsNative (bool bNative)
 Tells MicroStation that the Tool Settings window content is a native dialog or not. More...
 
StatusInt mdlNativeWindow_getDockableWindow (MSWindow **windowPP, UInt32 nID, WCharCP pTitle, PFDialogBoxHook pHook, DialogHookInterests *pInterests)
 Creates a dockable window and returns the MSWindow instance for the new window. More...
 
StatusInt mdlNativeWindow_getFramedWindow (MSWindow **windowPP, UInt32 nID, WCharCP pTitle, bool bResizeable, PFDialogBoxHook pHook, DialogHookInterests *pInterests)
 Creates a framed window and returns the MSWindow instance for the new window. More...
 
StatusInt mdlNativeWindow_getNETDockableWindow (MSWindow **windowPP, UInt32 nID, WCharCP pTitle, bool bResizeable, PFDialogBoxHook pHook, DialogHookInterests *pInterests)
 Creates a .NET Dockable window and returns the MSWindow instance for the new window. More...
 
StatusInt mdlNativeWindow_setAsContent (HWND hWndChild, void *pObject, MSWindowP windowP)
 Sets the HWND and C++ object as content of the MicroStation parent window. More...
 
void * mdlNativeWindow_getContent (MSWindowP windowP)
 Retrieves the C++ object pointer of the child modeless dialog attached to a given window. More...
 
void * mdlNativeWindow_getFocusedContent ()
 If the focused MicroStation window has native content attached, this retrieves the C++ object pointer of the child modeless dialog. More...
 
StatusInt mdlNativeWindow_attachContent (MSWindowP windowP, bool bSizeToContent)
 Attaches the native dialog content to the hosting MicroStation window. More...
 
StatusInt mdlNativeWindow_detachContent (MSWindowP windowP)
 Detaches the native dialog content from the hosting MicroStation window. More...
 
void mdlNativeWindow_setContentType (MSWindowP windowP, NativeContentType contentType)
 Sets the content type of the C++ object set as content. More...
 
NativeContentType mdlNativeWindow_getFocusedContentType ()
 If the focused MicroStation window has native content attached, this retrieves the type of C++ object set as content. More...
 
StatusInt mdlNativeWindow_setSecondaryDialogHook (MSWindowP windowP, PFDialogBoxHook pHook, DialogHookInterests *pInterests)
 Establishes a secondary dialog hook. More...
 
StatusInt mdlNativeWindow_removeSecondaryDialogHook (MSWindowP windowP, PFDialogBoxHook pHook)
 Removes a secondary dialog hook. More...
 
StatusInt mdlNativeWindow_registerAcceleratorTable (MSWindowP windowP, HACCEL hAccTable)
 Associates an accelerator table with the MicroStation window. More...
 
StatusInt mdlNativeWindow_unregisterAcceleratorTables (MSWindowP windowP)
 Disassociates registered accelerator tables from a MicroStation window. More...
 
StatusInt mdlNativeWindow_getAvailablePopupWindow (MSWindow **windowPP)
 Gets the available popup window created to host a native window. More...
 
StatusInt mdlNativeWindow_setHelpInfo (MSWindowP windowP, UInt32 helpInfo)
 Sets the alternate help ID to use for the window when invoking the help engine. More...
 
bool mdlNativeWindow_isNETDockable (MSWindowP windowP)
 Determines whether the designated window is has the .NET Dockable attribute. More...
 
StatusInt mdlNativeWindow_setNETDockable (MSWindowP windowP, bool value)
 Sets the window as Dialog Dockable. More...
 
StatusInt mdlNativeWindow_getNETDockedExtents (MSWindowP windowP)
 Gets the Docked Extents from a .NET Dockable dialog and sends those extents to the .NET docking system. More...
 
StatusInt mdlNativeWindow_getCommonDockedExtent (int *pWidth, int *pHeight)
 Returns the common docked extent for the current tool and border sizes. More...
 
StatusInt mdlNativeWindow_getCommonIconSize (int *pWidth, int *pHeight)
 Returns the common icon size for the current tool and border sizes. More...
 
StatusInt mdlNativeWindow_setTitle (MSWindowP windowP, WCharCP title)
 Sets the window's title specified by titleP. More...
 
StatusInt mdlNativeWindow_setSize (MSWindowP windowP, int width, int height)
 Changes the window size specified in windowP. More...
 
StatusInt mdlNativeWindow_contentRectGetLocal (BSIRectP contentRectP, MSWindowP windowP)
 Gets the content rectangle for a window in the window's local coordinates. More...
 
StatusInt mdlNativeWindow_contentRectGetGlobal (BSIRectP contentRectP, MSWindowP windowP)
 Gets the content rectangle for a window in global coordinates. More...
 
StatusInt mdlNativeWindow_globalRectGetLocal (BSIRectP rP, MSWindowP windowP)
 Gets the global rectangle for windowP in the window's local coordinates. More...
 
StatusInt mdlNativeWindow_globalRectGetGlobal (BSIRectP rP, MSWindowP windowP)
 Gets the global rectangle for windowP in global coordinates. More...
 
void mdlNativeWindow_globalPointToScreen (Point2d *screenPtP, MSWindowP windowP, Point2dCP globalPtP)
 Converts a point in global coordinates to a point in screen coordinates for the screen number specified by windowP. More...
 
void mdlNativeWindow_screenPointToGlobal (Point2d *globalPtP, MSWindowP windowP, Point2dCP screenPtP)
 Converts a point in screen coordinates to a point in global coordinates for the screen number specified by windowP. More...
 
DockPosition mdlNativeWindow_getDocked (MSWindowP windowP)
 Determines a window's current region number. More...
 
bool mdlNativeWindow_isDockable (MSWindowP windowP)
 Tests whether or not the designated window is dockable. More...
 
StatusInt mdlNativeWindow_dockWindow (MSWindowP windowP, DockPosition dockPosition, DockPriority dockPriority)
 Docks a window. More...
 
StatusInt mdlNativeWindow_undockWindow (MSWindowP windowP, Point2dCP newPosP)
 Undocks a window. More...
 
void mdlNativeWindow_organizeApplicationArea ()
 
Repositions all docked

windows. More...

 
void mdlNativeWindow_gradientBackgroundDraw (MSWindowP windowP, BSIRectCP rectP, BSIRectCP clipRectP, BSIColorDescrCP bgColorP, bool bVertical, bool bRoundEdges)
 Fills a rectangle with a gradient for docked windows using two system colors. More...
 
bool mdlNativeWindow_isMoveHandle (MSWindowP windowP)
 Determines if a window needs a move handle when docked. More...
 
StatusInt mdlNativeWindow_drawMoveHandles (MSWindowP windowP, DockPosition docked, BSIRectCP dialogRectP)
 Draws the handle the user grabs to move a docked window. More...
 
int mdlNativeWindow_getScreenNumber (MSWindowP windowP)
 Returns the screen number that windowP is on. More...
 
StatusInt mdlNativeWindow_setIconName (MSWindowP windowP, WCharCP name)
 Sets the window's icon name. More...
 

Macro Definition Documentation

#define __msnativewindowH__
#define NO_BOOLEAN_TYPE
#define winNT

Typedef Documentation

typedef HANDLE HACCEL
typedef PVOID HANDLE
typedef HANDLE HICON
typedef HANDLE HINSTANCE
typedef HANDLE HWND
typedef long LONG_PTR
typedef LONG_PTR LPARAM
typedef LONG_PTR LRESULT
typedef void* PVOID
typedef unsigned int UINT_PTR
typedef UINT_PTR WPARAM

Function Documentation

StatusInt mdlNativeWindow_addToWindowList ( MSWindowP  windowP)

Adds a native window to MicroStation's window list for menu selection.

Parameters
[in]windowPWindow to add to the selection list
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_removeFromWindowList
StatusInt mdlNativeWindow_attachContent ( MSWindowP  windowP,
bool  bSizeToContent 
)

Attaches the native dialog content to the hosting MicroStation window.

Parameters
[in]windowPThe parent MicroStation window
[in]bSizeToContentIndicates whether to resize the parent based on the size of the child dialog
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_detachContent
StatusInt mdlNativeWindow_changeScreen ( MSWindowP  windowP)

Changes the native window from one MicroStation screen to the other.

Parameters
[in]windowPWindow to change from one screen to the other
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_isTwoApplicationWindows mdlNativeWindow_onSysCommand
StatusInt mdlNativeWindow_changeScreenEx ( MSWindowP  windowP,
int  newScreen 
)

Changes the native window from one MicroStation screen to another other.

Parameters
[in]windowPWindow to change from one screen to the other
[in]newScreennew screen number
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_getApplicationWindowCount
StatusInt mdlNativeWindow_closeMSWindow ( MSWindowP  windowP,
bool  removeHooksFirst,
HideReasonCode  reasonCode,
bool  bypassFocusOut 
)

Closes the windows by hiding it then

and deallocating it, invalidating windowP for any further mdlNativeWindow_...

operations.

Parameters
[in]windowPwindow to close
[in]removeHooksFirstindicates whether to remove dialog & item hooks first before closing the window
[in]reasonCodereason for closing the window - codes found in dlogitem.h.
[in]bypassFocusOutbypass the focus out
Returns
SUCCESS or ERROR An error may be caused if the window pointer passed in is invalid or the window refused to relinquish focus and bypassFocusOut is false.
StatusInt mdlNativeWindow_contentRectGetGlobal ( BSIRectP  contentRectP,
MSWindowP  windowP 
)

Gets the content rectangle for a window in global coordinates.

Remarks
In MicroStation, each window has an associated content and global rectangle. The content rectangle is the window portion on which the application draws. The global rectangle includes the window's content rectangle and borders and title rectangle. The mdlNativeWindow_contentRectGetLocal and mdlNativeWindow_contentRectGetGlobal functions get the content rectangle for windowP, and mdlNativeWindow_globalRectGetLocal and mdlNativeWindow_globalRectGetGlobal are used to get the global rectangle for windowP. The mdlNativeWindow_...RectGetLocal routines return the rectangle in local coordinates, while the mdlNativeWindow_...RectGetGlobal routines return the same information in global coordinates.
Parameters
[out]contentRectPcontent rect in global coords
[in]windowPwindow to get content rect for
Returns
SUCCESS or ERROR
StatusInt mdlNativeWindow_contentRectGetLocal ( BSIRectP  contentRectP,
MSWindowP  windowP 
)

Gets the content rectangle for a window in the window's local coordinates.

Remarks
In MicroStation, each window has an associated content and global rectangle. The content rectangle is the window portion on which the application draws. The global rectangle includes the window's content rectangle and borders and title rectangle. The mdlNativeWindow_contentRectGetLocal and mdlNativeWindow_contentRectGetGlobal functions get the content rectangle for windowP, and mdlNativeWindow_globalRectGetLocal and mdlNativeWindow_globalRectGetGlobal are used to get the global rectangle for windowP. The mdlNativeWindow_...RectGetLocal routines return the rectangle in local coordinates, while the mdlNativeWindow_...RectGetGlobal routines return the same information in global coordinates.
Parameters
[out]contentRectPcontent rect in global coords
[in]windowPwindow to get content rect for
Returns
SUCCESS or ERROR
StatusInt mdlNativeWindow_createMSWindow ( MSWindow **  windowPP,
HWND  hAppWin,
bool  bModal,
bool  bResizeable,
int  resourceId 
)

Creates an instance of an MSWindow to reflect the application's native window.

This MSWindow is then used in other mdlNativeWindow_* function calls.

Parameters
[out]windowPPreceives a pointer to an MSWindow
[in]hAppWinHWND of the application's native window
[in]bModalIndicates whether this window is a modal dialog
[in]bResizeableIndicates whether this window is resizeable
[in]resourceIdNumeric resource used for saving/restoring window position and size
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_destroyMSWindow
StatusInt mdlNativeWindow_createMSWindowEx ( MSWindow **  windowPP,
HWND  hAppWin,
bool  bModal,
bool  bResizeable,
bool  bAbsolutePos,
RscId  resourceId,
WCharCP  alias,
GuiWAttributes pAttributes 
)

Extended version of mdlNativeWindow_createMSWindow with additional parameters.

Creates an instance of an MSWindow to reflect the application's native window. This MSWindow is then used in other mdlNativeWindow_* function calls.

Parameters
[out]windowPPreceives a pointer to an MSWindow
[in]hAppWinHWND of the application's native window
[in]bModalIndicates whether this window is a modal dialog
[in]bResizeableIndicates whether this window is resizeable
[in]bAbsolutePosIndicates whether to Use absolute position for save/get
[in]resourceIdNumeric resource used for saving/restoring window position and size
[in]aliasMay be NULL; Unique ID used for save and restoring window position
[in]pAttributesMay be NULL; attributes used by newly created window
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_createMSWindow mdlNativeWindow_destroyMSWindow
StatusInt mdlNativeWindow_destroyMSWindow ( MSWindowP  windowP,
bool  bSavePosition 
)

Destroys the MSWindow instance.

This function does not close or destroy the native window.

Parameters
[in]windowPThe MSWindow to destroy
[in]bSavePositionIndicates whether to save the position and size
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_createMSWindow
StatusInt mdlNativeWindow_detachContent ( MSWindowP  windowP)

Detaches the native dialog content from the hosting MicroStation window.

Parameters
[in]windowPThe parent MicroStation window
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_attachContent
StatusInt mdlNativeWindow_dockWindow ( MSWindowP  windowP,
DockPosition  dockPosition,
DockPriority  dockPriority 
)

Docks a window.

The window must be capable of being docked. mdlNativeWindow_organizeApplicationArea must be called after any dock/undock operation to organize the layout of the dock regions and, if necessary, reposition windows.

Parameters
[in]windowPis the window to dock.
[in]dockPositionis a region number. DOCK_TOP, DOCK_BOTTOM, DOCK_LEFT, and DOCK_RIGHT are valid values for dockPosition.
[in]dockPriorityis the relative priority of a window within a given region. It is typically set based on one of the following values: DOCKPRIORITY_BASETOP, DOCKPRIORITY_BASEBOTTOM, DOCKPRIORITY_BASELEFT or DOCKPRIORITY_BASERIGHT. A lower number decreases the window's priority and moves the window down and to the right in the selected dock region.
Returns
SUCCESS if windowP is successfully docked, or non-zero otherwise.
StatusInt mdlNativeWindow_drawMoveHandles ( MSWindowP  windowP,
DockPosition  docked,
BSIRectCP  dialogRectP 
)

Draws the handle the user grabs to move a docked window.

Parameters
[in]windowPpoints to the window where the move handle will be drawn.
[in]dockedthe dock mode of the dialog: DOCK_TOP, BOTTOM, LEFT, RIGHT, NOTDOCKED
[in]dialogRectPthe rectangle of the Dialog Box
int mdlNativeWindow_getApplicationWindowCount ( )

Gets the number of application screens.

Returns
the number of application screens.
See also
mdlNativeWindow_changeScreen
StatusInt mdlNativeWindow_getAvailablePopupWindow ( MSWindow **  windowPP)

Gets the available popup window created to host a native window.

Parameters
[out]windowPPReceives a pointer to the available popup window
Returns
SUCCESS, or ERROR if an error occurs.
StatusInt mdlNativeWindow_getCommonDockedExtent ( int *  pWidth,
int *  pHeight 
)

Returns the common docked extent for the current tool and border sizes.

Parameters
[out]pWidthreceives the common docked width. Set to NULL if not desired.
[out]pHeightreceives the common docked height. Set to NULL if not desired.
Returns
SUCCESS, or non-zero if error occurred.
StatusInt mdlNativeWindow_getCommonIconSize ( int *  pWidth,
int *  pHeight 
)

Returns the common icon size for the current tool and border sizes.

Parameters
[out]pWidthreceives the common icon width. Set to NULL if not desired.
[out]pHeightreceives the common icon height. Set to NULL if not desired.
Returns
SUCCESS, or non-zero if error occurred.
void* mdlNativeWindow_getContent ( MSWindowP  windowP)

Retrieves the C++ object pointer of the child modeless dialog attached to a given window.

Parameters
[in]windowPThe parent MicroStation window
Returns
The C++ object pointer of the child modeless dialog
See also
mdlNativeWindow_setAsContent mdlNativeWindow_getFocusedContent
StatusInt mdlNativeWindow_getDockableWindow ( MSWindow **  windowPP,
UInt32  nID,
WCharCP  pTitle,
PFDialogBoxHook  pHook,
DialogHookInterests pInterests 
)

Creates a dockable window and returns the MSWindow instance for the new window.

Parameters
[out]windowPPReceives a pointer to a dockable MicroStation window
[in]nIDWindows resource ID of the dialog to be hosted
[in]pTitleTitle for the dockable dialog
[in]pHookFunction pointer for secondary dialog hook
[in]pInterestsInterests for the secondary dialog hook
Returns
SUCCESS, or ERROR if an error occurs.
DockPosition mdlNativeWindow_getDocked ( MSWindowP  windowP)

Determines a window's current region number.

Parameters
[in]windowPis the window to test.
Returns
For docked windows, DOCK_NOTDOCKED, DOCK_TOP, DOCK_BOTTOM, DOCK_LEFT, or DOCK_RIGHT is returned depending on the windows docked region number. If the window is not docked or there is an error, DOCK_NOTDOCKED is returned.
void* mdlNativeWindow_getFocusedContent ( )

If the focused MicroStation window has native content attached, this retrieves the C++ object pointer of the child modeless dialog.

Returns
The C++ object pointer of the child modeless dialog
See also
mdlNativeWindow_getContent mdlNativeWindow_setAsContent
NativeContentType mdlNativeWindow_getFocusedContentType ( )

If the focused MicroStation window has native content attached, this retrieves the type of C++ object set as content.

Returns
The type of the C++ object set as the content
See also
mdlNativeWindow_getContent mdlNativeWindow_setAsContent
StatusInt mdlNativeWindow_getFramedWindow ( MSWindow **  windowPP,
UInt32  nID,
WCharCP  pTitle,
bool  bResizeable,
PFDialogBoxHook  pHook,
DialogHookInterests pInterests 
)

Creates a framed window and returns the MSWindow instance for the new window.

Parameters
[out]windowPPReceives a pointer to a framed MicroStation window
[in]nIDWindows resource ID of the dialog to be hosted
[in]pTitleTitle for the dialog
[in]bResizeabletrue = the dialog is resizeable
[in]pHookFunction pointer for secondary dialog hook
[in]pInterestsInterests for the secondary dialog hook
Returns
SUCCESS, or ERROR if an error occurs.
HINSTANCE mdlNativeWindow_getInstance ( )

Gets the HINSTANCE of MicroStation.

Returns
HINSTANCE of MicroStation
HWND mdlNativeWindow_getMainHandle ( int  iScreen)

Gets the HWND of MicroStation's main window.

Parameters
[in]iScreenindex of the screen to obtain the HWND for. If MicroStation is operating in single application window mode, this should be 0. If operating in two window mode, this may be 0 or 1.
Returns
HWND of MicroStation's main window.
HICON mdlNativeWindow_getMainIcon ( )

Gets the HICON of MicroStation's main icon.

Remarks
This HICON may be used when calling RegisterClass, AfxRegisterWndClass, or similar class registration method.
Returns
HICON of MicroStation's main icon.
StatusInt mdlNativeWindow_getNETDockableWindow ( MSWindow **  windowPP,
UInt32  nID,
WCharCP  pTitle,
bool  bResizeable,
PFDialogBoxHook  pHook,
DialogHookInterests pInterests 
)

Creates a .NET Dockable window and returns the MSWindow instance for the new window.

Parameters
[out]windowPPReceives a pointer to a .NET Dockable MicroStation window
[in]nIDWindows resource ID of the dialog to be hosted
[in]pTitleTitle for the dialog
[in]bResizeabletrue = the dialog is resizeable
[in]pHookFunction pointer for secondary dialog hook
[in]pInterestsInterests for the secondary dialog hook
Returns
SUCCESS, or ERROR if an error occurs.
StatusInt mdlNativeWindow_getNETDockedExtents ( MSWindowP  windowP)

Gets the Docked Extents from a .NET Dockable dialog and sends those extents to the .NET docking system.

Parameters
[in]windowPThe .NET Dockable window
Returns
SUCCESS if it is able to get the docked extents. Otherwise, it returns ERROR.
StatusInt mdlNativeWindow_getPreviousPosition ( BSIRect *  pRect,
int *  pScreen,
MSWindowP  windowP 
)

Gets the previous position, size and screen from the preferences.

Parameters
[in,out]pRectReceives the rectangle information about last position and size
[in,out]pScreenReceives the index of the screen the native window was on last
[in]windowPWindow to get information about
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_savePosition
int mdlNativeWindow_getScreenNumber ( MSWindowP  windowP)

Returns the screen number that windowP is on.

Parameters
[in]windowPwindow to get screen number for
Returns
The screen number.
StatusInt mdlNativeWindow_getToolSettingsWindow ( MSWindow **  windowPP)

Gets the MSWindow instance for MicroStation's Tool Settings window.

Parameters
[out]windowPPReceives a pointer to MicroStation's Tool Settings window
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_setToolSettingsNative
HWND mdlNativeWindow_getWindowHandle ( MSWindowP  windowP)

Gets the HWND associated with a given MicroStation's window.

Parameters
[in]windowPThe MSWindow to get the HWND for
Returns
HWND of the given MicroStation window.
void mdlNativeWindow_globalPointToScreen ( Point2d *  screenPtP,
MSWindowP  windowP,
Point2dCP  globalPtP 
)

Converts a point in global coordinates to a point in screen coordinates for the screen number specified by windowP.

The input point in global coordinates is specified by globalPtP. The output point in screen coordinates is returned in screenPtP. When globalPtP is NULL, mdlNativeWindow_globalPointToScreen converts the output argument in place, using screenPtP as both the input and output.

Parameters
[in,out]screenPtPPoint in screen coordinates.
[in]windowPWindow to get screen number from.
[in]globalPtPPoint in global coordinates.
StatusInt mdlNativeWindow_globalRectGetGlobal ( BSIRectP  rP,
MSWindowP  windowP 
)

Gets the global rectangle for windowP in global coordinates.

Remarks
In MicroStation, each window has an associated content and global rectangle. The content rectangle is the window portion on which the application draws. The global rectangle includes the window's content rectangle and borders and title rectangle. The mdlWindow_contentRectGetLocal and mdlWindow_contentRectGetGlobal functions get the content rectangle for windowP, and mdlWindow_globalRectGetLocal and mdlWindow_globalRectGetGlobal are used to get the global rectangle for windowP. The mdlWindow_...RectGetLocal routines return the rectangle in local coordinates, while the mdlWindow_...RectGetGlobal routines return the same information in global coordinates.
Parameters
[out]rPcontent rect in global coords
[in]windowPwindow to get content rect for
Returns
SUCCESS, or true if an error occurs.
See also
mdlWindow_contentRectGetLocal mdlWindow_globalRectGetLocal mdlWindow_contentRectGetGlobal
StatusInt mdlNativeWindow_globalRectGetLocal ( BSIRectP  rP,
MSWindowP  windowP 
)

Gets the global rectangle for windowP in the window's local coordinates.

Remarks
In MicroStation, each window has an associated content and global rectangle. The content rectangle is the window portion on which the application draws. The global rectangle includes the window's content rectangle and borders and title rectangle. The mdlWindow_contentRectGetLocal and mdlWindow_contentRectGetGlobal functions get the content rectangle for windowP, and mdlWindow_globalRectGetLocal and mdlWindow_globalRectGetGlobal are used to get the global rectangle for windowP. The mdlWindow_...RectGetLocal routines return the rectangle in local coordinates, while the mdlWindow_...RectGetGlobal routines return the same information in global coordinates.
Parameters
[out]rPcontent rect in global coords
[in]windowPwindow to get content rect for
Returns
SUCCESS, or nonzero value if an error occurs.
See also
mdlWindow_contentRectGetLocal mdlWindow_globalRectGetGlobal mdlWindow_contentRectGetGlobal
void mdlNativeWindow_gradientBackgroundDraw ( MSWindowP  windowP,
BSIRectCP  rectP,
BSIRectCP  clipRectP,
BSIColorDescrCP  bgColorP,
bool  bVertical,
bool  bRoundEdges 
)

Fills a rectangle with a gradient for docked windows using two system colors.

Parameters
[in]windowPis the window to draw to.
[in]rectPis the rectangle to be filled.
[in]clipRectPA clipping rectangle. If clipRectP is NULL, rectP is used.
[in]bgColorPis the middle color between the two system colors. If bgColorP is NULL, the system background color is used.
[in]bVerticalindicates whether the shading occurs from left to right (true) or top to bottom (false).
[in]bRoundEdgesindicates whether to round the edges after drawing the gradient.
bool mdlNativeWindow_hasFocus ( MSWindowP  windowP)

Determines whether a given MicroStation window has focus.

Parameters
[in]windowPWindow to query for focus
Returns
true if the MicroStation window has focus, or false if not.
See also
mdlNativeWindow_onSetFocus
bool mdlNativeWindow_isBentleyProductEnv ( )

Determines whether MicroStation, or another core Bentley product, is running.

Returns
true if a core Bentley product, such as MicroStation, is running.
bool mdlNativeWindow_isDockable ( MSWindowP  windowP)

Tests whether or not the designated window is dockable.

Parameters
[in]windowPis the window to test.
Returns
true if windowP is a dockable window. Otherwise, false is returned.
bool mdlNativeWindow_isMoveHandle ( MSWindowP  windowP)

Determines if a window needs a move handle when docked.

Parameters
[in]windowPpoints to the window.
Returns
true if windowP needs a move handle drawn.
bool mdlNativeWindow_isNETDockable ( MSWindowP  windowP)

Determines whether the designated window is has the .NET Dockable attribute.

Parameters
[out]windowPis the window to test.
Returns
true if windowP is .NET Dockable, or false if it is not.
bool mdlNativeWindow_isTwoApplicationWindows ( )

Determines whether MicroStation is operating in two application screen mode.

Returns
true if MicroStation is operating in two application screen mode, or false if not.
See also
mdlNativeWindow_changeScreen
StatusInt mdlNativeWindow_maximize ( MSWindowP  windowP)

Maximizes a native window within the MicroStation windowing framework.

Parameters
[in]windowPWindow to maximize
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_minimize mdlNativeWindow_restore
StatusInt mdlNativeWindow_minimize ( MSWindowP  windowP)

Minimizes a native window within the MicroStation windowing framework.

Parameters
[in]windowPWindow to minimize
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_maximize mdlNativeWindow_restore
StatusInt mdlNativeWindow_onEscapeKey ( MSWindowP  windowP,
void *  pMsg 
)

Should be called in response to a WM_KEYDOWN event for a VK_ESCAPE character.

This allows for proper focus shifting in MicroStation.

Parameters
[in]windowPWindow receiving the key event
[in]pMsgMSG received
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_onFunctionKey
StatusInt mdlNativeWindow_onFunctionKey ( MSWindowP  windowP,
int  messageId,
WPARAM  wParam,
LPARAM  lParam 
)

Should be called in response to a WM_KEYDOWN event for VK_F1 through VK_F24 characters.

This allows for proper function key processing in MicroStation.

Parameters
[in]windowPWindow receiving the event
[in]messageIdThe Windows message id; Can be NULL - not used
[in]wParamThe wParam in the Windows message
[in]lParamThe wParam in the Windows message
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_onEscapeKey
StatusInt mdlNativeWindow_onKillFocus ( MSWindowP  windowP,
HWND  hWndGaining 
)

Should be called in response to a WM_KILLFOCUS event.

This allows for proper focus handling in MicroStation.

Parameters
[in]windowPWindow that is receiving focus
[in]hWndGainingHWND of the Window gaining focus
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_hasFocus mdlNativeWindow_onSetFocus
StatusInt mdlNativeWindow_onModalOpened ( MSWindowP  windowP)

Should be called in response to a modal window being opened.

Parameters
[in]windowPModal Window being opened
Returns
SUCCESS, or ERROR if an error occurs.
StatusInt mdlNativeWindow_onMouse ( MSWindowP  windowP,
UInt32  msgType,
UInt32  nFlags,
int  pointX,
int  pointY 
)

Should be called in response to a WM_MOUSEMOVE or any Windows Button event such as WM_LBUTTONDOWN.

This allows for proper handling of Docked windows in MicroStation.

Parameters
[in]windowPWindow receiving the MouseMove event
[in]msgTypeThe mouse-related WM_ message type
[in]nFlagsIndicates whether various virtual keys are down during WM_MOUSEMOVE message
[in]pointXCPoint x member
[in]pointYCPoint y member
Returns
SUCCESS, or ERROR if an error occurs.
int mdlNativeWindow_onMouseActivate ( MSWindowP  windowP,
UInt32  nHitTest,
UInt32  message 
)

Should be called in response to a WM_MOUSEACTIVATE event.

This allows for proper focus handling in MicroStation.

Parameters
[in]windowPWindow that is receiving focus
[in]nHitTestThe hit-test area code from WM_MOUSEACTIVATE.
[in]messageThe mouse message number from WM_MOUSEACTIVATE.
Returns
Specifies whether to activate the CWnd and whether to discard the mouse event. It must be one of the MA_* manifests.
See also
mdlNativeWindow_onSetFocus
StatusInt mdlNativeWindow_onMove ( MSWindowP  windowP,
int  x,
int  y 
)

Should be called in response to a window movement message such as WM_WINDOWPOSCHANGED.

This allows for proper setting of internal content and global rectangles.

Parameters
[in]windowPWindow receiving the MouseMove event
[in]xThe X setting of the new position
[in]yThe Y setting of the new position
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_onResize
StatusInt mdlNativeWindow_onResize ( MSWindowP  windowP,
int  width,
int  height 
)

Should be called in response to a window resize message such as WM_WINDOWPOSCHANGED.

This allows for proper setting of internal content and global rectangles.

Parameters
[in]windowPWindow receiving the MouseMove event
[in]widthThe new width
[in]heightThe new height
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_onMove
StatusInt mdlNativeWindow_onSetFocus ( MSWindowP  windowP,
HWND  hOldWin 
)

Should be called in response to a WM_SETFOCUS event.

This allows for proper focus handling in MicroStation.

Parameters
[in]windowPWindow that is receiving focus
[in]hOldWinHWND of the Window losing focus
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_hasFocus mdlNativeWindow_onKillFocus
StatusInt mdlNativeWindow_onSysCommand ( MSWindowP  windowP,
UInt32  nID,
LPARAM  lParam 
)

Should be called in response to a WM_SYSCOMMAND event.

This allows for proper handling of Change Screen and Sink commands in MicroStation.

Parameters
[in]windowPWindow receiving the SysCommand event
[in]nIDID of the Windows WM_SYSCOMMAND message
[in]lParamLPARAM passed into the OnSysCommand method
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_changeScreen
StatusInt mdlNativeWindow_onWindowPosChanged ( MSWindowP  windowP,
WPARAM  wParam,
LPARAM  lParam 
)

Should be called in response to a WM_WINDOWPOSCHANGED message.

This allows for proper setting of internal content and global rectangles.

Parameters
[in]windowPWindow receiving the MouseMove event
[in]wParamWPARAM from the WM_WDOWPOSCHANGED message
[in]lParamLPARAM from the WM_WDOWPOSCHANGED message
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_onMove mdlNativeWindow_onResize
void mdlNativeWindow_organizeApplicationArea ( )

Repositions all docked

windows.

It must be called after a window (or group of windows) is either docked or undocked.

StatusInt mdlNativeWindow_registerAcceleratorTable ( MSWindowP  windowP,
HACCEL  hAccTable 
)

Associates an accelerator table with the MicroStation window.

Since a window may have multiple accelerator tables, this function may be called for each accelerator table.

Parameters
[in]windowPThe parent MicroStation window
[in]hAccTableHACCEL to the accelerator table
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_unregisterAcceleratorTables
StatusInt mdlNativeWindow_removeFromWindowList ( MSWindowP  windowP)

Removes a native window from MicroStation's window list.

Parameters
[in]windowPWindow to remove
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_addToWindowList
StatusInt mdlNativeWindow_removeSecondaryDialogHook ( MSWindowP  windowP,
PFDialogBoxHook  pHook 
)

Removes a secondary dialog hook.

Parameters
[in]windowPThe parent MicroStation window
[in]pHookFunction pointer for secondary dialog hook
Returns
SUCCESS, or ERROR if an error occurs.
StatusInt mdlNativeWindow_resize ( MSWindowP  windowP,
int  iWidth,
int  iHeight 
)

Resizes a window based on the width and height provided.

Parameters
[in]windowPWindow to restore
[in]iWidthNew width of the window
[in]iHeightNew height of the window
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_onResize
StatusInt mdlNativeWindow_restore ( MSWindowP  windowP)

Restores a minimized or maximized native window within the MicroStation windowing framework.

Parameters
[in]windowPWindow to restore
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_minimize mdlNativeWindow_maximize
StatusInt mdlNativeWindow_savePosition ( MSWindowP  windowP)

Saves the current position, size and screen to the preferences.

Parameters
[in]windowPWindow to save position for
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_getPreviousPosition
void mdlNativeWindow_screenPointToGlobal ( Point2d *  globalPtP,
MSWindowP  windowP,
Point2dCP  screenPtP 
)

Converts a point in screen coordinates to a point in global coordinates for the screen number specified by windowP.

The input point in screen coordinates is specified by screenPtP. The output point in global coordinates is returned in globalPtP. When screenPtP is NULL, mdlNativeWindow_screenPointToGlobal converts the output argument in place, using globalPtP as both the input and output.

Parameters
[in,out]globalPtPPoint in global coordinates.
[in]windowPWindow to get screen number from.
[in]screenPtPPoint in screen coordinates.
StatusInt mdlNativeWindow_setAsChild ( MSWindowP  windowP,
int  iScreen,
bool  bChildStyle 
)

Sets the native window as a child of MicroStation's main window.

Parameters
[in]windowPThe MSWindow of the child window
[in]iScreenindex of the screen on which to put the native window
[in]bChildStyletrue = set the WS_CHILD attribute dynamically. Set to true for Dialogs and false for Frames.
Returns
SUCCESS, or ERROR if an error occurs.
StatusInt mdlNativeWindow_setAsContent ( HWND  hWndChild,
void *  pObject,
MSWindowP  windowP 
)

Sets the HWND and C++ object as content of the MicroStation parent window.

Parameters
[in]hWndChildHWND of the child modeless dialog
[in]pObjectC++ object pointer of the modeless dialog
[in]windowPThe parent MicroStation window
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_getContent mdlNativeWindow_getFocusedContent mdlNativeWindow_attachContent mdlNativeWindow_detachContent
void mdlNativeWindow_setContentType ( MSWindowP  windowP,
NativeContentType  contentType 
)

Sets the content type of the C++ object set as content.

Parameters
[in]windowPThe parent MicroStation window
[in]contentTypeThe type of the C++ object set as the content
See also
mdlNativeWindow_setAsContent mdlNativeWindow_getFocusedContent
StatusInt mdlNativeWindow_setHelpInfo ( MSWindowP  windowP,
UInt32  helpInfo 
)

Sets the alternate help ID to use for the window when invoking the help engine.

Parameters
[in]windowPThe window to set the help info id for
[in]helpInfoThe help info id
Returns
SUCCESS if it is able to get the docked extents. Otherwise, it returns ERROR.
StatusInt mdlNativeWindow_setIconName ( MSWindowP  windowP,
WCharCP  name 
)

Sets the window's icon name.

This name is associated with the window for all window drawing.

Parameters
[in]windowPwindow whose icon name to set
[in]namethe icon name to associate with the window
Remarks
The following configuration variables are used when searching for the icon by this name: MS_ICONPATH, MS_ICONLIBRARYLIST, MS_ICONRSCLIST
StatusInt mdlNativeWindow_setNETDockable ( MSWindowP  windowP,
bool  value 
)

Sets the window as Dialog Dockable.

Parameters
[in]windowPwindow to set as Dialog Dockable
[in]valuetrue for dockable or false for not dockable
Remarks
This attribute may also be set using the DIALOGATTRX_NETDOCKABLE extended dialog attribute in the resource definition.
StatusInt mdlNativeWindow_setSecondaryDialogHook ( MSWindowP  windowP,
PFDialogBoxHook  pHook,
DialogHookInterests pInterests 
)

Establishes a secondary dialog hook.

Parameters
[in]windowPThe parent MicroStation window
[in]pHookFunction pointer for secondary dialog hook
[in]pInterestsInterests for the secondary dialog hook
Returns
SUCCESS, or ERROR if an error occurs.
StatusInt mdlNativeWindow_setSize ( MSWindowP  windowP,
int  width,
int  height 
)

Changes the window size specified in windowP.

Parameters
[in]windowPwindow to resize
[in]widthnew window width
[in]heightnew window height
StatusInt mdlNativeWindow_setTitle ( MSWindowP  windowP,
WCharCP  title 
)

Sets the window's title specified by titleP.

Parameters
[in]windowPwindow to set title for
[in]titleUnicode title to set
Returns
SUCCESS, or a nonzero value if there is an error.
void mdlNativeWindow_setToolSettingsNative ( bool  bNative)

Tells MicroStation that the Tool Settings window content is a native dialog or not.

Parameters
[in]bNativeIndicates whether Tool Settings window content is a native dialog or not
See also
mdlNativeWindow_getToolSettingsWindow
StatusInt mdlNativeWindow_undockWindow ( MSWindowP  windowP,
Point2dCP  newPosP 
)

Undocks a window.

mdlNativeWindow_undockWindow has no affect on a window that is not currently docked. mdlNativeWindow_organizeApplicationArea must be called after any dock/undock operation to organize the layout of the dock regions and, if necessary, reposition windows.

Parameters
[in]windowPwindow to undock
[in]newPosPis the position, in global coordinates, of where to move the upper left corner of the window's content rectangle after it is undocked.
Returns
SUCCESS if windowP is successfully undocked. Otherwise, non-zero is returned.
StatusInt mdlNativeWindow_unregisterAcceleratorTables ( MSWindowP  windowP)

Disassociates registered accelerator tables from a MicroStation window.

Parameters
[in]windowPThe parent MicroStation window
Returns
SUCCESS, or ERROR if an error occurs.
See also
mdlNativeWindow_registerAcceleratorTable

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.