- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
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:
Declarations of variables and constants:
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?
Thanks,
Walter Kramer
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:
szDescription="flup"C
hwndStatbar=CreateStatusWindow(IOR (WS_CHILD,WS_VISIBLE),szDescription, &
hwnd,IDM_STATUSBAR)
call GetEffectiveClientRect(Hwnd,Rect,RectInfo)
hwndEdit = CreateWindowEx(0,"edit"C, &
""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, &
ES_AUTOVSCROLL)))))))))), &
Rect.left, Rect.top, Rect.right, Rect.bottom, &
hwnd, EDITID, ghInstance, NULL)
Declarations of variables and constants:
integer(2), parameter :: IDM_STATUSBAR = 501
type(T_RECT) Rect
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?
Thanks,
Walter Kramer
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Walter,
Frankly, this is the first time I hear about GetEffectiveClientRect. Why not
simply subtract status bar from frame's client rect in order to obtain
desired height of edit control?:
HTH
Jugoslav
Frankly, this is the first time I hear about GetEffectiveClientRect. Why not
simply subtract status bar from frame's client rect in order to obtain
desired height of edit control?:
CALL GetWindowRect(hWndStatbar,Rect) iStatusHeight=Rect%Bottom - Rect%Top CALL GetClientRect(hWnd,Rect) hWndEdit=CreateWindowEx(... Rect%left, Rect%top, Rect%right, Rect%bottom-iStatusHeight ...)
HTH
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Jugoslav
Thank you, this works without any problem.
Walter Kramer
Thank you, this works without any problem.
Walter Kramer

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page