Set Application Window statement - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Sets which window will be the parent of dialog boxes that are yet to be created.You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Set Application Window HWND 

HWND is an integer window handle, which identifies a window.

Description

This statement sets which window is the application window. Once you set the application window, all MapInfo Pro dialog boxes have the application window as their parent. This statement is useful in "integrated mapping" applications, where MapInfo Pro windows are integrated into another application, such as a Visual Basic application.

In your Visual Basic program, after you create a MapInfo Object, send MapInfo Pro a Set Application Window statement, so that the Visual Basic application becomes the parent of MapInfo Pro dialog boxes. If you do not issue the Set Application Window statement, you may find it difficult to coordinate whether MapInfo Pro or your Visual Basic program has the focus.

Issuing the command Set Application Window 0 will return MapInfo Pro to its default state. This statement re-parents dialog box windows. To re-parent document windows, such as a Map window, use the Set Next Document statement.

Note: If you specify the HWND as an explicit hexadecimal value, you must place the characters &H at the start of the HWND; otherwise, MapInfo Pro will try to interpret the expression as a decimal value. (This situation can arise, for example, when a Visual Basic program builds a command string that includes a Set Application Window statement.)

For more information on integrated mapping, see the MapBasic User Guide.

See Also:

Set Next Document statement