I made some further experiments.
Looks like my first test was not good enough or if you prefer I was wrong.
Using a win spying utility I was able to replicate all the styles used by the PB program and looks like it's not a PB bug.
Code: Select all
Global hBrush = CreateSolidBrush_(GetSysColor_(#COLOR_BTNFACE))
; window procedure
Procedure WinProc (hWnd, Msg, wParam, lParam)
Select Msg
Case #WM_CLOSE
DestroyWindow_(hWnd)
Case #WM_NCDESTROY
DeleteObject_(hBrush)
PostQuitMessage_(0)
ProcedureReturn 0
EndSelect
ProcedureReturn DefWindowProc_(hWnd, Msg, wParam, lParam)
EndProcedure
; window class
Classname$ = "MyApiWindow"
With wClass.WNDCLASSEX
\cbsize = SizeOf(WNDCLASSEX)
\lpfnWndProc = @WinProc()
\hCursor = LoadCursor_(0, #IDC_ARROW)
\hbrBackground = hBrush
\lpszClassName = @classname$
EndWith
RegisterClassEx_(@wClass)
; create window and process messages
WinStyle = #WS_CLIPSIBLINGS | #WS_CLIPCHILDREN
WinStyle | #WS_CAPTION | #WS_SYSMENU | #WS_MINIMIZEBOX
WinStyle | #WS_MAXIMIZEBOX | #WS_SIZEBOX
hWnd = CreateWindowEx_(0, Classname$, "bug width", WinStyle, 100, 100, 500, 200, 0, 0, 0, 0)
EditStyle = #WS_OVERLAPPED | #WS_CHILD | #WS_VISIBLE | #WS_GROUP | #WS_TABSTOP
EditStyleEx = #WS_EX_LEFT | #WS_EX_LTRREADING | #WS_EX_RIGHTSCROLLBAR
;EditStyleEx = #WS_EX_CLIENTEDGE | #WS_EX_LEFT | #WS_EX_LTRREADING | #WS_EX_RIGHTSCROLLBAR
CreateWindowEx_(EditStyleEx, "EDIT", "", EditStyle , 10, 10, 1, 100, hwnd, 0, 0 ,0)
CreateWindowEx_(EditStyleEx, "EDIT", "", EditStyle , 100, 10, 2, 100, hwnd, 0, 0 ,0)
CreateWindowEx_(EditStyleEx, "EDIT", "", EditStyle , 200, 10, 3, 100, hwnd, 0, 0 ,0)
CreateWindowEx_(EditStyleEx, "EDIT", "", EditStyle , 300, 10, 4, 100, hwnd, 0, 0 ,0)
CreateWindowEx_(EditStyleEx, "EDIT", "", EditStyle , 400, 10, 5, 100, hwnd, 0, 0 ,0)
ShowWindow_(hWnd, #SW_SHOW)
While GetMessage_(msg.MSG, 0, 0, 0 )
TranslateMessage_(msg)
DispatchMessage_(msg)
Wend
UnregisterClass_(Classname$, GetModuleHandle_(#Null))
Run it as it is, and there is no bug.
But comment out the second version of the extended style, the one using #WS_EX_CLIENTEDGE and the "bug" it's there in the API version too.
So is it a problem due to the fact that using #WS_EX_CLIENTEDGE the sunken effect mess with client area ?