Documentation
Click the function links to see the prototype, the function parameters, the return values and the remarks. Click it again to hide it.
These docs are for both the C and the C++ version.
Flags
Options
Values
ESO_AUTORESIZE
This option tells EasySize to simply send a WM_SIZE message without any data about position or dimension. Use this option
for windows that automatically size themselves (rebars and status bars)
ESO_INVALIDATE
This option tells EasySize to invalidate the window after sizing it.
Remarks
None.
Anchor flags
This are the values you should use as left, top, right and bottom anchors to anchor a window.
Values
ESF_BORDER
This flag tells EasySize to keep the distance from the border this flag is used on.
ESF_KEEPSIZE
This flag tells EasySize to maintain the size of the window instead of anchoring it to the border, that is, it expands the space
between the window and the border. This flag shouldn't be set to facing borders: e.g. it shouldn't be set on both top and bottom, or on both left and right.
Remarks
None.
C++ (EasySize class' functions)
EasySize::AddWindow
Set how a window has to be resized, from direct handle.
Prototype
void EasySize::AddWindow(HWND hwnd, int left, int top, int right, int bottom, int options = 0);
Parameters
hwnd
[IN] Handle to the window to be resized.
left
[IN] Left anchor.
top
[IN] Top anchor.
right
[IN] Right anchor.
bottom
[IN] Bottom anchor.
options
[IN] See the options for a list of the possible values. Defaults to 0 (no options).
Return values
None
Remarks
None
EasySize::AddWindow
Set the options of a window, zeroing the anchor values.
Prototype
void EasySize::AddWindow(HWND hwnd, int options);
Parameters
hwnd
[IN] Handle to the window to be resized.
options
[IN] See the options for a list of the possible values.
Return values
None
Remarks
None
EasySize::AddDlgItem
Set how a window has to be resized, from parent window handle and dialog item ID.
Prototype
void EasySize::AddDlgItem(HWND hwndParent, int id, int left, int top, int right, int bottom, int options = 0);
Parameters
hwndParent
[IN] Handle to the parent window of the dialog control.
id
[IN] ID of a dialog control.
left
[IN] Left anchor.
top
[IN] Top anchor.
right
[IN] Right anchor.
bottom
[IN] Bottom anchor.
options
[IN] See the options for a list of the possible values. Defaults to 0 (no options).
Return values
None
Remarks
None
EasySize::AddDlgItem
Set the options of a dialog item, zeroing the anchor values.
Prototype
void EasySize::AddDlgItem(HWND hwndParent, int id, int options);
Parameters
hwndParent
[IN] Handle to the parent window of the dialog control.
id
[IN] ID of a dialog control.
options
[IN] See the options for a list of the possible values.
Return values
None
Remarks
None
EasySize::Empty()
Removes all the windows being anchored.
Prototype
void EasySize::Empty();
Parameters
None
Return values
None
Remarks
It is not necessary to call this function when the class object is destroyed.
EasySize::SizeContents()
The function that does the job of resizing the window that have an anchor.
Prototype
void EasySize::SizeContents();
Parameters
None
Return values
None
Remarks
This function should be called only in response to a WM_SIZE message, it's useless elsewhere.
EasySize::RedoComputations()
This function recalcs all the windows distance from the border.
Prototype
void EasySize::RedoComputations();
Parameters
None
Return values
None
Remarks
This is an helper function that should be called only when you call SetWindowPos on your own on a anchored window.
C
EasySize_DoComputations
Prototype
void EasySize_DoComputations(ANCHORPOINTS *ap);
Parameters
ap
[IN] Pointer to an ANCHORPOINTS structure, whose hwndToResize must be valid.
Remarks
This function is called internally when adding a window anchor, so you don't need to call it manually. It's an helper function that
should be called only when you call SetWindowPos on your own on a anchored window.
EasySize_SizeContents
The function that does the job of resizing the window that have an anchor.
Prototype
void EasySize_SizeContents(const ANCHORPOINTSSTRUCT *aps);
Parameters
aps
[IN] Pointer to the ANCHORPOINTSSTRUCT structure that contains the array of ANCHORPOINTS structures with all the window anchored.
Return values
No return values.
Remarks
This function should be called only in response to a WM_SIZE message, it's useless elsewhere.
EasySize_SetWindow
Helper function that set a window's anchors, through the structure pointer.
Prototype
void EasySize_SetWindow(ANCHORPOINTS *ap, HWND hwnd, int left, int top, int right, int bottom, int options);
Parameters
ap
[IN] Pointer to an ANCHORPOINTS structure to be set.
hwnd
[IN] Handle to the window to be resized.
left
[IN] Left anchor.
top
[IN] Top anchor.
right
[IN] Right anchor.
bottom
[IN] Bottom anchor.
options
[IN] See the options for a list of the possible values.
Return values
None
Remarks
None
EasySize_SetSimpleWindow
Set the options of a window, zeroing the anchor values.
Prototype
void EasySize_SetSimpleWindow(ANCHORPOINTS *ap, HWND hwnd, int options);
Parameters
ap
[IN] Pointer to an ANCHORPOINTS structure to be set.
hwnd
[IN] Handle to the window to be resized.
options
[IN] See the options for a list of the possible values.
Return values
None
Remarks
None
EasySize_SetDlgItem
Set how a window has to be resized, from parent window handle and dialog item ID.
Prototype
void EasySize_SetDlgItem(ANCHORPOINTS *ap, HWND hwndParent, int id, int left, int top, int right, int bottom, int options);
Parameters
ap
[IN] Pointer to an ANCHORPOINTS structure to be set.
hwndParent
[IN] Handle to the parent window of the dialog control.
id
[IN] ID of a dialog control.
left
[IN] Left anchor.
top
[IN] Top anchor.
right
[IN] Right anchor.
bottom
[IN] Bottom anchor.
options
[IN] See the options for a list of the possible values.
Return values
No return values.
Remarks
None
EasySize_SetSimpleDlgItem
Set the options of a dialog item, zeroing the anchor values.
Prototype
void EasySize_SetSimpleDlgItem(ANCHORPOINTS *ap, HWND hwndParent, int id, int options);
Parameters
ap
[IN] Pointer to an ANCHORPOINTS structure to be set.
hwndParent
[IN] Handle to the parent window of the dialog control.
id
[IN] ID of a dialog control.
options
[IN] See the options for a list of the possible values.
Return values
No return values.
Remarks
None
This page was last modified
32 months, 2 weeks, 6 days and 2 hours ago