Hi Peter,
Thanks for the xyx demo,Easter card and new win64.
Unfortunately the window size adjustment is not accurate for a number of examples.
But here is a procedure which will deliver a precise adjustment to the window size, giving the desired client area
I have rather rudely dunked it into your Window() procedure below
declare GetWindowRect lib "user32.dll" (sys h,RECT*r)
declare MoveWindow lib "user32.dll" (sys h,x,y,w,h,repaint)
RECT r
sys l,t,w,h
GetClientRect sys_hwnd,r
w=2*ww-r.right
h=2*wh-r.bottom
GetWindowRect sys_hwnd,r
l=r.left
t=r.top
MoveWindow sys_hwnd,l,t,w,h,1
Function Window (string caption, sys Ww, Wh, style) as sys
sys inst Wx, Wy, Scr, jx
iF style =0
style = CheckReso Ww, Wh
EndiF
iF style =1 then style =0xCF0000
iF style =2 then style =0x80000
iF style =3 then style =0x80000000
iF style =4 then style =0x400000
inst = GetModuleHandle 0
wc.style = CS_HREDRAW or CS_VREDRAW or CS_OWNDC
wc.lpfnWndProc = &WndProc
wc.cbClsExtra =0
wc.cbWndExtra =0
wc.hInstance = inst
wc.hIcon=LoadIconA 0,IDI_WINLOGO
wc.hCursor=LoadCursor 0,IDC_ARROW
wc.hbrBackground = 0
wc.lpszMenuName = ?0
wc.lpszClassName = @"Oxygen"
RegisterClass &wc
Scr = GetSystemMetrics SM_CXSCREEN
Wx = (Scr - Ww) /2
Scr = GetSystemMetrics SM_CYSCREEN
Wy = (Scr - Wh) /2
'sys_hwnd = CreateWindowEx 0, wc.lpszClassName,caption,style,Wx,Wy,Ww+16,Wh+38,0,0,inst,0
sys_hwnd = CreateWindowEx 0, wc.lpszClassName,caption,style,Wx,Wy,Ww,Wh,0,0,inst,0
'
declare GetWindowRect lib "user32.dll" (sys h,RECT*r)
declare MoveWindow lib "user32.dll" (sys h,x,y,w,h,repaint)
RECT r
sys l,t,w,h
GetClientRect sys_hwnd,r
w=2*ww-r.right
h=2*wh-r.bottom
GetWindowRect sys_hwnd,r
l=r.left
t=r.top
MoveWindow sys_hwnd,l,t,w,h,1
'
ShowWindow sys_hwnd,SW_SHOW
sys_hdc = GetDC(sys_hwnd)
GetClientRect sys_hwnd, rc
bHnd = CreateCompatibleBitmap(sys_hdc, rc.right, rc.bottom)
bHdc = CreateCompatibleDC(sys_hdc)
SelectObject bHdc, bHnd
ScreenWidth = rc.right: ScreenHeight = rc.bottom
sys_Seed = timeGetTime
QueryPerformanceFrequency sys_qf
QueryPerformanceCounter sys_qc1
Return sys_hwnd
End Function
Sub Pause()
While AscKey=0
Events
iF WinExit=1
WinEnd
ExitProcess 0
End iF
FlipBuffer
sleep 20
Wend
'AscKey=0
End Sub
Charles