Thread View: borland.public.cppbuilder.nativeapi
3 messages
3 total messages
Started by Carlos
Wed, 09 May 2007 12:59
How can I create an application like BCB IDE
Author: Carlos
Date: Wed, 09 May 2007 12:59
Date: Wed, 09 May 2007 12:59
10 lines
1264 bytes
1264 bytes
Hello, I don�t want use MDI for my applications. but I need a Main toolbar (like BCB IDE) and work windows (cpp files, forms, ...). When you maximize any window all work windows are maximized to Main Toolbar. How can I set forms properties for emulate this system ? Regards
Re: How can I create an application like BCB IDE
Author: Ron Sawyer
Date: Wed, 09 May 2007 21:47
Date: Wed, 09 May 2007 21:47
56 lines
3176 bytes
3176 bytes
> When you maximize any window all work windows are maximized to Main
Toolbar.
If I understand correctly, the solution appears below. Before I post it:
credit where it is due.
Harold Howe used to have an excellent how-to site. When he shut it down he
graciously allowed us to download a word document from the site. This post
is taken direction from his document.
Many Windows programs create secondary forms that minimize to the taskbar.
For example, MS Exchange opens a new window when you read a mail message,
and these windows minimize to the taskbar. Netscape creates different
windows for its browser, news reader, and mail reader, and each window
minimizes to the taskbar. Come to think of it, having forms that minimize to
the desktop isn't too useful, and not many apps seem to work that way.
A window will minimize to the taskbar if its extended window style contains
the WS_EX_APPWINDOW style. By default, secondary forms do not have this
style set. You can make a form minimize to the taskbar by overriding the
CreateParams function and altering the extended windows style. Use this code
from the secondary form.
void __fastcall TForm2::CreateParams(TCreateParams &Params)
{
TForm::CreateParams(Params);
Params.ExStyle |= WS_EX_APPWINDOW;
}
In addition to making a form minimize to the taskbar, you will also want to
change the owner of the secondary form. By owner, I mean the owner window of
the form in API terms, not the VCL owner. The hidden application window owns
all forms in a C++Builder program. The OS hides all owned windows when their
owner window is hidden or minimized. When you create an independent form
that minimizes to the taskbar, this behavior will seem awkward. To fix the
problem, set the WndParent member of TCreateParams to the result of
GetDesktopWindow. This makes the desktop the owner of the form, and prevents
the form from being hidden when you minimize the main form of the program.
void __fastcall TForm2::CreateParams(TCreateParams &Params)
{
TForm::CreateParams(Params);
Params.ExStyle |= WS_EX_APPWINDOW;
Params.WndParent = GetDesktopWindow();
}
Remember that changing the WndParent member of CreateParams does not affect
who deletes the form object.
Re: How can I create an application like BCB IDE
Author: Carlos
Date: Thu, 10 May 2007 10:49
Date: Thu, 10 May 2007 10:49
80 lines
3903 bytes
3903 bytes
Thank you Ron,
It help me. But it does not solve the entire problem.
I can�t maximize to Main toolbar of Main Form (emulating BCB Ide )
And when I click in main form secundary form goes to hidden state.
Regards
"Ron Sawyer" <XXXRSAWYER8128XQQXX@aol.com> escribi� en el mensaje de
noticias news:46424187@newsgroups.borland.com...
>> When you maximize any window all work windows are maximized to Main
> Toolbar.
> If I understand correctly, the solution appears below. Before I post it:
> credit where it is due.
>
> Harold Howe used to have an excellent how-to site. When he shut it down
> he
> graciously allowed us to download a word document from the site. This
> post
> is taken direction from his document.
>
> Many Windows programs create secondary forms that minimize to the taskbar.
> For example, MS Exchange opens a new window when you read a mail message,
> and these windows minimize to the taskbar. Netscape creates different
> windows for its browser, news reader, and mail reader, and each window
> minimizes to the taskbar. Come to think of it, having forms that minimize
> to
> the desktop isn't too useful, and not many apps seem to work that way.
>
> A window will minimize to the taskbar if its extended window style
> contains
> the WS_EX_APPWINDOW style. By default, secondary forms do not have this
> style set. You can make a form minimize to the taskbar by overriding the
> CreateParams function and altering the extended windows style. Use this
> code
> from the secondary form.
>
> void __fastcall TForm2::CreateParams(TCreateParams &Params)
>
> {
>
> TForm::CreateParams(Params);
>
> Params.ExStyle |= WS_EX_APPWINDOW;
>
> }
>
> In addition to making a form minimize to the taskbar, you will also want
> to
> change the owner of the secondary form. By owner, I mean the owner window
> of
> the form in API terms, not the VCL owner. The hidden application window
> owns
> all forms in a C++Builder program. The OS hides all owned windows when
> their
> owner window is hidden or minimized. When you create an independent form
> that minimizes to the taskbar, this behavior will seem awkward. To fix the
> problem, set the WndParent member of TCreateParams to the result of
> GetDesktopWindow. This makes the desktop the owner of the form, and
> prevents
> the form from being hidden when you minimize the main form of the program.
>
> void __fastcall TForm2::CreateParams(TCreateParams &Params)
>
> {
>
> TForm::CreateParams(Params);
>
> Params.ExStyle |= WS_EX_APPWINDOW;
>
> Params.WndParent = GetDesktopWindow();
>
> }
>
> Remember that changing the WndParent member of CreateParams does not
> affect
> who deletes the form object.
>
>
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