I am using Visual C++ 6.0 and eMbedded Visual C++ 4.0.

The question seems easy at the first look:

I want to show a Tab Control at the top of a big Bitmap control. However,
after the program runs, only the Bitmap is shown, and the Tab Control cannot
be shown until it is clicked. I tried SetWindowPos() function to set the Tab
Control to the topmost, and ShowWindow() as well, but still no success. I
also modified the Tab Control style to WS_EX_TOPMOST in resource file, but
still no luck (see the following).

Could anybody help me to solve the problem?

John


In resource file, from CONTROL
"Tab1",IDC_TAB_FWS,"SysTabControl32", 0x0,47,71,185,192
to CONTROL
"Tab1",IDC_TAB_FWS,"SysTabControl32", WS_EX_TOPMOST,47,71,185,192


//and

RECT * lpRect = new RECT();
GetDlgItem (IDC_TAB_FWS)->GetWindowRect (lpRect);
GetDlgItem (IDC_TAB_FWS)->SetWindowPos ( &wndTopMost, lpRect->left,
lpRect->top,
lpRect->right - lpRect->left ,
lpRect->bottom - lpRect->top , SWP_SHOWWINDOW );

//or
GetDlgItem (IDC_TAB_FWS)->BringWindowToTop();
//or
GetDlgItem (IDC_TAB_FWS)->ShowWindow ( SW_SHOW);

Re: How to show a Tab Control at the top of the Z order by Norman

Norman
Wed Sep 08 22:57:40 CDT 2004

JohnL wrote:
> I am using Visual C++ 6.0 and eMbedded Visual C++ 4.0.
>
> The question seems easy at the first look:
>
> I want to show a Tab Control at the top of a big Bitmap control. However,
> after the program runs, only the Bitmap is shown, and the Tab Control cannot
> be shown until it is clicked. I tried SetWindowPos() function to set the Tab
> Control to the topmost, and ShowWindow() as well, but still no success. I
> also modified the Tab Control style to WS_EX_TOPMOST in resource file, but
> still no luck (see the following).
>
> Could anybody help me to solve the problem?
>
> John
>
>
> In resource file, from CONTROL
> "Tab1",IDC_TAB_FWS,"SysTabControl32", 0x0,47,71,185,192
> to CONTROL
> "Tab1",IDC_TAB_FWS,"SysTabControl32", WS_EX_TOPMOST,47,71,185,192
>
>
> //and
>
> RECT * lpRect = new RECT();
> GetDlgItem (IDC_TAB_FWS)->GetWindowRect (lpRect);
> GetDlgItem (IDC_TAB_FWS)->SetWindowPos ( &wndTopMost, lpRect->left,
> lpRect->top,
> lpRect->right - lpRect->left ,
> lpRect->bottom - lpRect->top , SWP_SHOWWINDOW );
>
> //or
> GetDlgItem (IDC_TAB_FWS)->BringWindowToTop();
> //or
> GetDlgItem (IDC_TAB_FWS)->ShowWindow ( SW_SHOW);
>
>
Child windows are generally allowed to paint anywhere within their
parent's client area so, regardless of Z-order, one child window (e.g.
your bitmap) might paint an area that was just painted by another child
window (e.g. your tab control) making the first window painted disappear.

You can prevent this by adding the WS_CLIPSIBLINGS to the bitmap window.
This will prevent it from painting any area occupied by other child windows.

Norm

--
--
To reply, change domain to an adult feline.


Re: How to show a Tab Control at the top of the Z order by JohnL

JohnL
Thu Sep 09 10:29:45 CDT 2004

Great! The problem is solved!

Norman, could you please recommend me several books or documents so I can
learn this type of tips myself? I would like to know where you learned it.

Thank you very much.

John


"Norman Bullen" <norm@BlackKittenAssociates.com.INVALID> wrote in message
news:UwQ%c.10958$w%6.6722@newsread1.news.pas.earthlink.net...
> JohnL wrote:
> > I am using Visual C++ 6.0 and eMbedded Visual C++ 4.0.
> >
> > The question seems easy at the first look:
> >
> > I want to show a Tab Control at the top of a big Bitmap control.
However,
> > after the program runs, only the Bitmap is shown, and the Tab Control
cannot
> > be shown until it is clicked. I tried SetWindowPos() function to set the
Tab
> > Control to the topmost, and ShowWindow() as well, but still no success.
I
> > also modified the Tab Control style to WS_EX_TOPMOST in resource file,
but
> > still no luck (see the following).
> >
> > Could anybody help me to solve the problem?
> >
> > John
> >
> >
> > In resource file, from CONTROL
> > "Tab1",IDC_TAB_FWS,"SysTabControl32", 0x0,47,71,185,192
> > to CONTROL
> > "Tab1",IDC_TAB_FWS,"SysTabControl32", WS_EX_TOPMOST,47,71,185,192
> >
> >
> > //and
> >
> > RECT * lpRect = new RECT();
> > GetDlgItem (IDC_TAB_FWS)->GetWindowRect (lpRect);
> > GetDlgItem (IDC_TAB_FWS)->SetWindowPos ( &wndTopMost, lpRect->left,
> > lpRect->top,
> > lpRect->right - lpRect->left ,
> > lpRect->bottom - lpRect->top , SWP_SHOWWINDOW );
> >
> > //or
> > GetDlgItem (IDC_TAB_FWS)->BringWindowToTop();
> > //or
> > GetDlgItem (IDC_TAB_FWS)->ShowWindow ( SW_SHOW);
> >
> >
> Child windows are generally allowed to paint anywhere within their
> parent's client area so, regardless of Z-order, one child window (e.g.
> your bitmap) might paint an area that was just painted by another child
> window (e.g. your tab control) making the first window painted disappear.
>
> You can prevent this by adding the WS_CLIPSIBLINGS to the bitmap window.
> This will prevent it from painting any area occupied by other child
windows.
>
> Norm
>
> --
> --
> To reply, change domain to an adult feline.
>



Re: How to show a Tab Control at the top of the Z order by Norman

Norman
Fri Sep 10 21:07:12 CDT 2004

JohnL wrote:
> Great! The problem is solved!
>
> Norman, could you please recommend me several books or documents so I can
> learn this type of tips myself? I would like to know where you learned it.
>
> Thank you very much.
>
> John
>
>
I learned Windows programming is the days of Windows 3.1 primarily, I
think, from "reference" sources: the _Windows API Bible_ by James L
Conger and the on-line help files provided with my Borland C and later
C++ compilers. The two cover the same material but, I find, the book
form has better organization that the hot links in the on-line form
can't make up for.

I also had some Microsoft book that dated from even earlier (Win 3.0)
that went into the fundamentals of Windows programming.

Now I use the _Windows 2000 API Bible_ by Richard J Simon and the
Microsoft MSDN documentation from the Platform SDK.

There does not seem to be a comparable book for Windows CE but MSDN now
flags the differences between the various "big" Windows platforms and
CE. I also have all three editions of _Programming Windows CE_ by Doug
Boling which are more tutorial than reference but do help to highlight
the differences in CE.

Many people will recommend the latest edition of _Programming Windows_
by Charles Petzold. I, personally, don't care for this series because I
feel that too many of the examples are out of the mainstream and
therefore not appropriate for an entry-level tutorial and the overall
coverage is far too haphazard for a reference.

When I want to learn about creating windows I read the sections on
CreateWindow() and CreateWindowEx() to find all the possible choices
offered by the various parameters. You won't get everything from one
reading; when you're ready to try something different in the way of
window creation, read the sections again looking for anything that
relates to your new needs.

Norm
--
--
To reply, change domain to an adult feline.


Re: How to show a Tab Control at the top of the Z order by JohnL

JohnL
Mon Sep 13 11:22:10 CDT 2004


Thanks a lot for sharing the treasure with us!

John



"Norman Bullen" <norm@BlackKittenAssociates.com.INVALID> wrote in message
news:k5t0d.12578$w%6.6661@newsread1.news.pas.earthlink.net...
> JohnL wrote:
> > Great! The problem is solved!
> >
> > Norman, could you please recommend me several books or documents so I
can
> > learn this type of tips myself? I would like to know where you learned
it.
> >
> > Thank you very much.
> >
> > John
> >
> >
> I learned Windows programming is the days of Windows 3.1 primarily, I
> think, from "reference" sources: the _Windows API Bible_ by James L
> Conger and the on-line help files provided with my Borland C and later
> C++ compilers. The two cover the same material but, I find, the book
> form has better organization that the hot links in the on-line form
> can't make up for.
>
> I also had some Microsoft book that dated from even earlier (Win 3.0)
> that went into the fundamentals of Windows programming.
>
> Now I use the _Windows 2000 API Bible_ by Richard J Simon and the
> Microsoft MSDN documentation from the Platform SDK.
>
> There does not seem to be a comparable book for Windows CE but MSDN now
> flags the differences between the various "big" Windows platforms and
> CE. I also have all three editions of _Programming Windows CE_ by Doug
> Boling which are more tutorial than reference but do help to highlight
> the differences in CE.
>
> Many people will recommend the latest edition of _Programming Windows_
> by Charles Petzold. I, personally, don't care for this series because I
> feel that too many of the examples are out of the mainstream and
> therefore not appropriate for an entry-level tutorial and the overall
> coverage is far too haphazard for a reference.
>
> When I want to learn about creating windows I read the sections on
> CreateWindow() and CreateWindowEx() to find all the possible choices
> offered by the various parameters. You won't get everything from one
> reading; when you're ready to try something different in the way of
> window creation, read the sections again looking for anything that
> relates to your new needs.
>
> Norm
> --
> --
> To reply, change domain to an adult feline.
>



Re: How to show a Tab Control at the top of the Z order by JohnL

JohnL
Mon Sep 13 13:05:48 CDT 2004

Hi, Norman,

I could not find Windows 2000 API Bible wriiten by Richard J Simon. Is it
Microsoft Windows 2000 Api Superbible instead?

John


"Norman Bullen" <norm@BlackKittenAssociates.com.INVALID> wrote in message
news:k5t0d.12578$w%6.6661@newsread1.news.pas.earthlink.net...
> JohnL wrote:
> > Great! The problem is solved!
> >
> > Norman, could you please recommend me several books or documents so I
can
> > learn this type of tips myself? I would like to know where you learned
it.
> >
> > Thank you very much.
> >
> > John
> >
> >
> I learned Windows programming is the days of Windows 3.1 primarily, I
> think, from "reference" sources: the _Windows API Bible_ by James L
> Conger and the on-line help files provided with my Borland C and later
> C++ compilers. The two cover the same material but, I find, the book
> form has better organization that the hot links in the on-line form
> can't make up for.
>
> I also had some Microsoft book that dated from even earlier (Win 3.0)
> that went into the fundamentals of Windows programming.
>
> Now I use the _Windows 2000 API Bible_ by Richard J Simon and the
> Microsoft MSDN documentation from the Platform SDK.
>
> There does not seem to be a comparable book for Windows CE but MSDN now
> flags the differences between the various "big" Windows platforms and
> CE. I also have all three editions of _Programming Windows CE_ by Doug
> Boling which are more tutorial than reference but do help to highlight
> the differences in CE.
>
> Many people will recommend the latest edition of _Programming Windows_
> by Charles Petzold. I, personally, don't care for this series because I
> feel that too many of the examples are out of the mainstream and
> therefore not appropriate for an entry-level tutorial and the overall
> coverage is far too haphazard for a reference.
>
> When I want to learn about creating windows I read the sections on
> CreateWindow() and CreateWindowEx() to find all the possible choices
> offered by the various parameters. You won't get everything from one
> reading; when you're ready to try something different in the way of
> window creation, read the sections again looking for anything that
> relates to your new needs.
>
> Norm
> --
> --
> To reply, change domain to an adult feline.
>



Re: How to show a Tab Control at the top of the Z order by Norman

Norman
Mon Sep 13 21:50:54 CDT 2004

JohnL wrote:

> Hi, Norman,
>
> I could not find Windows 2000 API Bible wriiten by Richard J Simon. Is it
> Microsoft Windows 2000 Api Superbible instead?
>
> John
>
>
That's it. I noticed the difference a few hours later when I picked up
the book to look up some details of MDI.

Norm

--
--
To reply, change domain to an adult feline.