winframe class : MoveWindow(int,int,int,int) method

Description

Changes the position and size of the window.

Syntax

winframeInstance.MoveWindow(int left, int top, int width, int height)

Arguments

ClassNameDescription
intleftA distance between the left of the screen and the left of a window.
inttopA distance between the top of the screen and the top of a window.
intwidthA width of the window.
intheightA height of the window.

Return value

ClassDescription
boolA value indicating whether it succeeded.

Sample code

1:

wfpool wfp;

2:

winframe winframeIns = wfp.GetActive(); // Gets a window that has focus.

3:

bool success = winframeIns.MoveWindow(0,0,1000,600);

Notes

If the window has been displayed at normal size and the method has been executed successfully, it will return true. Otherwise it returns false.

In the case above, please note that even if the position and size are the same, it returns true if the method ran successfully.

If the window has been maximized or minimized, the size and position of the window do not change by executing this method. In this case, the false will be returned.

The unit of argument is physical pixel.

Links for reference

None

Copyright © Cooker All rights reserved.