Thread View: borland.public.cppbuilder.nativeapi
5 messages
5 total messages
Started by Renald Yazmir
Thu, 10 Apr 2008 20:52
Creating toolbar using CreateWindowEx()
Author: Renald Yazmir
Date: Thu, 10 Apr 2008 20:52
Date: Thu, 10 Apr 2008 20:52
58 lines
2218 bytes
2218 bytes
Hello
I created a toolbar using CreateWindowEx() in MDI document.
..
dwStyle = WS_CHILD | TBSTYLE_WRAPABLE | TBSTYLE_FLAT | WS_BORDER;
// Create the toolbar.
hWndToolbar = CreateWindowEx(
0,
TOOLBARCLASSNAME,
NULL,
dwStyle,
0, 0, 0, 0,
hWndParent, //
main frame window
NULL,
hInstance,
NULL);
..
return hWndToolbar; // it is not used anywhere
When I open a child window it does not know about existence of toolbar. The
child window overlaps the toolbar.
How do make a child window aware of toolbar?
So when I drag a child window towards a toolbar it will stop when it hits a
toolbar.
Thank you
Rony
Re: Creating toolbar using CreateWindowEx()
Author: Remy Lebeau (TeamB)
Date: Thu, 10 Apr 2008 20:39
Date: Thu, 10 Apr 2008 20:39
18 lines
1561 bytes
1561 bytes
"Renald Yazmir" <renald@partmaker.com> wrote in message news:47fe6fee$1@newsgroups.borland.com... > When I open a child window it does not know about > existence of toolbar. The child window overlaps the toolbar. > > How do make a child window aware of toolbar? > > So when I drag a child window towards a toolbar it will > stop when it hits a toolbar. Sounds like you are not resizing your main frame's MDICLIENT window to account for the toolbar. MDI children are hosted inside the MDICLIENT window, not inside the main frame's window directly. Gambit
Re: Creating toolbar using CreateWindowEx()
Author: Remy Lebeau (TeamB)
Date: Thu, 10 Apr 2008 21:47
Date: Thu, 10 Apr 2008 21:47
17 lines
1782 bytes
1782 bytes
"Renald Yazmir" <renald@partmaker.com> wrote in message news:47fe7fad$1@newsgroups.borland.com... > Can you tell me how to resize MDICLIENT to account for toolbar? The fact that you are calling CreateWindowEx() manually, and posting this question to the .nativeapi group, suggests that you are creating your HWNDs using the Win32 API manually instead of using the VCL, is that right? If so, then you would have had to call CreateWindow/Ex(..., 'MDICLIENT', ...) to create the MDICLIENT window first before you can create MDI child windows. Simply pass the MDICLIENT's HWND to SetWindowPos() to move it around the main frame as needed. MDI child windows cannot appear outside of the MDICLIENT's area. Gambit
Re: Creating toolbar using CreateWindowEx()
Author: Renald Yazmir
Date: Thu, 10 Apr 2008 21:59
Date: Thu, 10 Apr 2008 21:59
26 lines
1831 bytes
1831 bytes
Can you tell me how to resize MDICLIENT to account for toolbar? Thank you Rony. "Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message news:47fe7b08$1@newsgroups.borland.com... > > "Renald Yazmir" <renald@partmaker.com> wrote in message > news:47fe6fee$1@newsgroups.borland.com... > >> When I open a child window it does not know about >> existence of toolbar. The child window overlaps the toolbar. >> >> How do make a child window aware of toolbar? >> >> So when I drag a child window towards a toolbar it will >> stop when it hits a toolbar. > > Sounds like you are not resizing your main frame's MDICLIENT window to > account for the toolbar. MDI children are hosted inside the MDICLIENT > window, not inside the main frame's window directly. > > > Gambit >
Re: Creating toolbar using CreateWindowEx()
Author: Renald Yazmir
Date: Fri, 11 Apr 2008 21:57
Date: Fri, 11 Apr 2008 21:57
24 lines
2017 bytes
2017 bytes
It works. Thank you very much! "Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message news:47fe8b15@newsgroups.borland.com... > > "Renald Yazmir" <renald@partmaker.com> wrote in message > news:47fe7fad$1@newsgroups.borland.com... > >> Can you tell me how to resize MDICLIENT to account for toolbar? > > The fact that you are calling CreateWindowEx() manually, and posting this > question to the .nativeapi group, suggests that you are creating your > HWNDs using the Win32 API manually instead of using the VCL, is that > right? If so, then you would have had to call CreateWindow/Ex(..., > 'MDICLIENT', ...) to create the MDICLIENT window first before you can > create MDI child windows. Simply pass the MDICLIENT's HWND to > SetWindowPos() to move it around the main frame as needed. MDI child > windows cannot appear outside of the MDICLIENT's area. > > > Gambit >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads