I am trying to implement a status bar in a windows application with a single edit control in the client area.
To prevent the status bar from being painted over the edit control I tried to use the following approach:
After creating the Status bar using "CreateStatusWindow" I try to call "GetEffectiveClientRect" to find the rectangular area remaining for the edit control.
The code I use with WM_CREATE looks something like this:
hwndStatbar=CreateStatusWindow(IOR (WS_CHILD,WS_VISIBLE),szDescription, &
hwndEdit = CreateWindowEx(0,"edit"C, &
IOR(WS_CHILD, IOR(WS_VISIBLE, &
IOR(WS_HSCROLL, IOR(WS_VSCROLL, &
IOR(WS_BORDER, IOR(ES_LEFT, &
IOR(ES_MULTILINE, IOR(ES_NOHIDESEL, &
IOR(ES_AUTOHSCROLL, IOR(ES_READONLY, &
Rect.left, Rect.top, Rect.right, Rect.bottom, &
hwnd, EDITID, ghInstance, NULL)
Declarations of variables and constants:
integer(2), parameter :: IDM_STATUSBAR = 501
integer(2), dimension(4) :: RectInfo=(/1,IDM_STATUSBAR,0,0/)
However, GetEffectiveClientRect returns the same Rect data as GetClientRect would. So the edit control is painted over the status bar. I have my doubts about the RectInfo array.
Does anyone have an idea? Perhaps I am using a completely wrong approach?