Navigation:  Programmer's Reference > Sending data to DPlot from another application >

SetWindowPos macro command

Print this Topic Previous pageReturn to chapter overviewNext page

Macro commands may be used either in macros or by sending the commands to DPlot via dynamic data exchange (DDE). Some commands are valid only in macros (noted by Macros Only). Commands sent to DPlot via DDE must be enclosed by square brackets [     ]. Macro commands should not include the brackets.

Command parameters shown in the descriptions below are placeholders for the actual values. Command parameters are either numeric values, equations that evaluate to numbers, or character strings. Character string parameters are always bound by double quotation marks. Equations must be preceded by an equals sign (=).

The pipe symbol (|) in the command syntax indicates that a parameter is optional, and should not be included in your macro unless otherwise noted.

All indices into arrays are 1-based, e.g. Curve1=1 refers to the first curve in a plot.

A 0x prefix for numbers in the descriptions below indicates hexadecimal notation; e.g. 0x0010 = 16.

JR/Viewer indicates that the command is supported by DPlot Jr or DPlot Viewer.
JR/Viewer indicates that the command is NOT supported by DPlot Jr or DPlot Viewer.


 

[SetWindowPos(index,hwndInsertAfter,x,y,cx,cy,uflags)]

JR   Viewer

Similar to the Windows API SetWindowPos command.

index

-1

document associated with the current DDE conversation.

0

main application window.

1-32

index of a child document window.

For index=0 (main application window), X and Y specify the window position in screen coordinates. For child document windows, X and Y specify the window position relative to the upper-left corner of the client area.
 

hWndInsertAfter

Handle to the window to precede the positioned window in the Z order. This value is ignored for all but index=0 (main application window). This parameter must be a window handle or one of the following values:

Value

Meaning

HWND_BOTTOM (=1)

Places the window at the bottom of the Z order. If the hwndInsertAfter parameter identifies a topmost window, the window loses its topmost status and is placed at the bottom of all other windows.

HWND_NOTOPMOST (=-2)

Places the window above all non-topmost windows (that is, behind all topmost windows). This flag has no effect if the window is already a non-topmost window.

HWND_TOP (=0)

Places the window at the top of the Z order.

HWND_TOPMOST (=-1)

Places the window above all non-topmost windows. The window maintains its topmost position even when it is deactivated.

X
Specifies the new position of the left side of the window, in client coordinates.

Y
Specifies the new position of the top of the window, in client coordinates.

cx
Specifies the new width of the window, in pixels.

cy
Specifies the new height of the window, in pixels.

uFlags
Specifies the window sizing and positioning flags. Most of these flags should only be used for the main application window. DPlot will re-activate the document associated with the current DDE conversation after processing this command, if necessary. This parameter can be a combination of the following values:

API Constant

Value

Meaning

SWP_ASYNCWINDOWPOS

0x4000
(16384)

If the calling thread does not own the window, the system posts the request to the thread that owns the window. This prevents the calling thread from blocking its execution while other threads process the request.

SWP_DEFERERASE

0x2000
(8192)

Prevents generation of the WM_SYNCPAINT message.

SWP_FRAMECHANGED

0x0020
(32)

Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed. Draws a frame (defined in the window's class description) around the window.

SWP_HIDEWINDOW

0x0080
(128)

Hides the window.

SWP_NOACTIVATE

0x0010
(16)

Does not activate the window. If this flag is not set, the window is activated and moved to the top of either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter parameter).

SWP_NOCOPYBITS

0x0100
(256)

Discards the entire contents of the client area. If this flag is not specified, the valid contents of the client area are saved and copied back into the client area after the window is sized or repositioned.

SWP_NOMOVE

0x0002
(2)

Retains the current position (ignores the X and Y parameters).

SWP_NOOWNERZORDER

0x0200
(512)

Does not change the owner window's position in the Z order.

SWP_NOREDRAW

0x0008
(8)

Does not redraw changes. If this flag is set, no repainting of any kind occurs. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of the window being moved. When this flag is set, the application must explicitly invalidate or redraw any parts of the window and parent window that need redrawing.

SWP_NOSENDCHANGING

0x0400
(1024)

Prevents the window from receiving the WM_WINDOWPOSCHANGING message.

SWP_NOSIZE

0x0001
(1)

Retains the current size (ignores the cx and cy parameters).

SWP_NOZORDER

0x0004
(4)

Retains the current Z order (ignores the hWndInsertAfter parameter).

SWP_SHOWWINDOW

0x0040
(64)

Displays the window.

Examples

You can force DPlot's main window to stay on top of all other windows, retaining its current size and position with

SetWindowPos(0,-1,0,0,0,0,3)

and turn off the stay-on-top state with

SetWindowPos(0,-2,0,0,0,0,3)

These are equivalent to toggling the Keep DPlot on top menu item on the View menu.

 

 


Page url: https://www.dplot.com/help/index.htm?setwindowposcommand.htm