Detecting dialog bar being hidden by command button 
Author Message
 Detecting dialog bar being hidden by command button

Hi,

I have a dialog bar with a corresponding menu item which gets
checked/unchecked just like the standard toolbar.

Everything is working fine, except for when the command buton is clicked on
the dialog bar. I am trying to handle the WM_SYSCOMMAND message (the code is
good because I tested it on main frame). What do I need to do to ensure that
when the user closes the dialog bar, I can trap the event and uncheck the
menu item?

Thanks in advance.

Andrew Wilford



Sat, 06 Nov 2004 03:29:32 GMT  
 Detecting dialog bar being hidden by command button
Hi Andrew,

The standard toolbar is handled in
CFrameWnd::OnUpdateControlBarMenu(CCmdUI* pCmdUI). The code is:

CControlBar* pBar = GetControlBar(pCmdUI->m_nID);
if (pBar != NULL)
{
        pCmdUI->SetCheck((pBar->GetStyle() & WS_VISIBLE) != 0);
        return;

Quote:
}

You an also add the code to corresponding UPDATE_COMMAND_UI message handler
to check/uncheck the menu item.

Hope this helps.

Best Regards,
Leo Chen

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

| Newsgroups: microsoft.public.vc.mfc
| Subject: Detecting dialog bar being hidden by command button
| Lines: 17
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

| Date: Mon, 20 May 2002 19:29:32 GMT
| NNTP-Posting-Host: 68.5.81.238

| X-Trace: news2.west.cox.net 1021922972 68.5.81.238 (Mon, 20 May 2002
15:29:32 EDT)
| NNTP-Posting-Date: Mon, 20 May 2002 15:29:32 EDT
| Organization: Cox Communications
| Path:
cpmsftngxa08!tkmsftngp01!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.
de!t-online.de!newspeer1-gui.server.ntli.net!ntli.net!cox.net!news2.west.cox
net.POSTED!53ab2750!not-for-mail
| Xref: cpmsftngxa08 microsoft.public.vc.mfc:324776
| X-Tomcat-NG: microsoft.public.vc.mfc
|
| Hi,
|
| I have a dialog bar with a corresponding menu item which gets
| checked/unchecked just like the standard toolbar.
|
| Everything is working fine, except for when the command buton is clicked
on
| the dialog bar. I am trying to handle the WM_SYSCOMMAND message (the code
is
| good because I tested it on main frame). What do I need to do to ensure
that
| when the user closes the dialog bar, I can trap the event and uncheck the
| menu item?
|
| Thanks in advance.
|
| Andrew Wilford
|
|
|
|



Sun, 07 Nov 2004 14:16:20 GMT  
 Detecting dialog bar being hidden by command button
Leo,

A thousand thanks! That had been driving me crazy for days! Your
implementation did the job.

Best regards,

Andrew Wilford



Mon, 08 Nov 2004 00:19:19 GMT  
 Detecting dialog bar being hidden by command button
Hi Andrew,

It's my pleasure to be of help. :-)

Best Regards,
Leo Chen

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

| Newsgroups: microsoft.public.vc.mfc


| Subject: Re: Detecting dialog bar being hidden by command button
| Lines: 11
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

| Date: Wed, 22 May 2002 16:19:19 GMT
| NNTP-Posting-Host: 68.5.81.238

| X-Trace: news2.west.cox.net 1022084359 68.5.81.238 (Wed, 22 May 2002
12:19:19 EDT)
| NNTP-Posting-Date: Wed, 22 May 2002 12:19:19 EDT
| Organization: Cox Communications
| Path:
cpmsftngxa08!tkmsftngp01!newsfeed00.sul.t-online.de!t-online.de!news-xfer.ne
wsread.com!bad-news.newsread.com!netaxs.com!newsread.com!cox.net!news2.west.
cox.net.POSTED!53ab2750!not-for-mail
| Xref: cpmsftngxa08 microsoft.public.vc.mfc:325164
| X-Tomcat-NG: microsoft.public.vc.mfc
|
| Leo,
|
| A thousand thanks! That had been driving me crazy for days! Your
| implementation did the job.
|
| Best regards,
|
| Andrew Wilford
|
|
|
|



Tue, 09 Nov 2004 18:28:45 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. how to hide a command button

2. status bar hidden under START bar (quick-launch bar)

3. How to control the Add-in command bar button

4. How to change button style in command bar?

5. How can disabled command bar button in runtime?

6. How to detect when a modeless dialog hide?

7. hide and show the title bar of a dialog box on execution

8. how can i hide the dialog on task bar

9. Hide minimize dialog in the task bar

10. How2 hide a Modal Dialog app on task bar

11. Show or hide title-bar of dialogs

12. Hiding Tooltips in ActiveX Control on Dialog Bar

 

 
Powered by phpBB® Forum Software