Dude wrote:...only difference is the #PB_Window_SizeGadget flag...
This is a Windows issue, by design. The
#WS_SIZEBOX property is synonymous with
#WS_THICKFRAME;
and thus the offset.
Pure-API windows yield exactly the same results:
Code: Select all
Procedure WndProc(hWnd, uMsg, wParam, lParam)
Select uMsg
Case #WM_CLOSE
DestroyWindow_(hWnd)
Case #WM_DESTROY
PostQuitMessage_(0)
Default
result = DefWindowProc_(hWnd, uMsg, wParam, lParam)
EndSelect
ProcedureReturn result
EndProcedure
wndClass$ = "API Window"
wndClass.WNDCLASSEX
With wndClass
\lpfnWndProc = @WndProc()
\lpszClassName = @wndClass$
\cbSize = SizeOf(WNDCLASSEX)
EndWith
RegisterClassEx_(@wndClass)
client.RECT
With client
\top = 0
\left = 0
\right = 200
\bottom = 100
AdjustWindowRect_(@client, #WS_CAPTION | #WS_SYSMENU | #WS_SIZEBOX, 0);
hWnd = CreateWindowEx_(0, wndClass$, "Resizable Win",
#WS_VISIBLE | #WS_SYSMENU | #WS_SIZEBOX,
200, 400, \right - \left, \bottom - \top, 0, 0, 0, 0)
\top = 0
\left = 0
\right = 200
\bottom = 100
AdjustWindowRect_(@client, #WS_CAPTION | #WS_SYSMENU, 0);
hWnd2 = CreateWindowEx_(0, wndClass$, "Regular Win",
#WS_VISIBLE | #WS_SYSMENU,
300, 400, \right - \left, \bottom - \top, 0, 0, 0, 0)
EndWith
While GetMessage_(uMsg.MSG, 0, 0, 0)
TranslateMessage_(uMsg)
DispatchMessage_(uMsg)
Wend
Bug or not, it's not a PureBasic issue.
