MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / GetNonClientArea

Method GetNonClientArea

source/script_gui.cpp:5166–5187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5164
5165
5166void GuiType::GetNonClientArea(LONG &aWidth, LONG &aHeight)
5167// Added for v1.0.44.13.
5168// Yields only the *extra* width/height added by the windows non-client area.
5169// If the window hasn't been shown for the first time, the caller wants zeros.
5170// The reason for making the script specify size of client area rather than entire window is that it
5171// seems far more useful. For example, a script might know exactly how much minimum height its
5172// controls require in the client area, but would find it inconvenient to have to take into account
5173// the height of the title bar and menu bar (which vary depending on theme and other settings).
5174{
5175 if (mGuiShowHasNeverBeenDone) // In this case, the script might not yet have added the menu bar and other styles that affect the size of the non-client area. So caller wants to do these calculations later.
5176 {
5177 aWidth = 0;
5178 aHeight = 0;
5179 return;
5180 }
5181 // Otherwise, mGuiShowHasNeverBeenDone==false, which should mean that mHwnd!=NULL.
5182 RECT rect, client_rect;
5183 GetWindowRect(mHwnd, &rect);
5184 GetClientRect(mHwnd, &client_rect); // Client rect's left & top are always zero.
5185 aWidth = (rect.right - rect.left) - client_rect.right;
5186 aHeight = (rect.bottom - rect.top) - client_rect.bottom;
5187}
5188
5189
5190

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected