Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

::CommandBar_Show(m_pWndEmptyCB->m_hWnd, FALSE ); using VS2005?

Posted on 2009-05-11
8
600 Views
Last Modified: 2013-12-21
In my eVC++4 project I made my app fullscreen by doing the following:

SHFullScreen( m_hWnd, SHFS_HIDESTARTICON|
                         SHFS_HIDETASKBAR|
                        SHFS_HIDESIPBUTTON );

MoveWindow(15,70,220,180,TRUE);

::CommandBar_Show(m_pWndEmptyCB->m_hWnd, FALSE );

I have now converted it to VS2005 and m_pWndEmptyCB is no longer supported.

How exactly can I do the same as ::CommandBar_Show(m_pWndEmptyCB->m_hWnd, FALSE ); using VS2005?

Thanks
0
Comment
Question by:Wanting2LearnMan
  • 4
  • 2
  • 2
8 Comments
 
LVL 19

Expert Comment

by:LordOfPorts
ID: 24357660
I am not certain if this will be helpful however according to http://msdn.microsoft.com/en-us/library/ew94tebd.aspx m_pWndEmptyCB is no longer supported because you now control the creation of the command bar so somewhere in your code you would have a call to CommandBar_Create http://msdn.microsoft.com/en-us/library/ms908131.aspx which will return the handle to your command bar when called (if successful), you could store this handle in a member variable, e.g.:

// Declare handle to control bar as object member variable
HWND hCmdBar;

// Initialize when creating the command bar
hCmdBar = ::CommandBar_Create(...

and later on pass it as the first argument to the CommandBar_Show method, e.g.:

::CommandBar_Show(hCmdBar, FALSE );

0
 
LVL 33

Expert Comment

by:pgnatyuk
ID: 24362907
Do you use MFC in your project?
I think Lordof Ports is right. IN my application I just don't create the command bar, but the main window has WS_POPUP style, so it can cover the whole screen. I don't use the MFC.
0
 
LVL 33

Expert Comment

by:pgnatyuk
ID: 24362943
One more thing - I control the WM_ACTIVATE to hide the system controls.
for example, this code will find the task bar:
HWND hWnd = ::FindWindow(TEXT("HHTaskBar"), NULL);
then: ShowWindow(hWnd, SW_HIDE);

or SIP button:
HWND HWnd = ::FindWindow(TEXT("MS_SIPBUTTON"), NULL);
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

Author Comment

by:Wanting2LearnMan
ID: 24366150
Yes I use MFC in my project.

I also control the WM_ACTIVATE and I 'had' the following:
void CAbout::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
{
          CDialog::OnActivate(nState, pWndOther, bMinimized);  
          SHFullScreen( m_hWnd, SHFS_HIDESTARTICON|SHFS_HIDETASKBAR|SHFS_HIDESIPBUTTON );
          MoveWindow(0,0,240,320,TRUE);
          ::CommandBar_Show(m_pWndEmptyCB->m_hWnd, FALSE );      
}

I will try out your suggestions above to replace the m_pWndEmptyCB.
Thanks
0
 

Author Comment

by:Wanting2LearnMan
ID: 24367939
The following does not hide the bottom SIP:

HWND HWnd = ::FindWindow(TEXT("MS_SIPBUTTON"), NULL);
::ShowWindow(HWnd, SW_HIDE);

Any ideas??

Thanks
0
 
LVL 19

Expert Comment

by:LordOfPorts
ID: 24368112
Check if HWnd is NULL perhaps. According the FindWindow's description http://msdn.microsoft.com/en-us/library/ms633499.aspx it does not search for child windows, use FindWindowEx http://msdn.microsoft.com/en-us/library/ms633500(VS.85).aspx to search for child windows.

The post at http://forum.soft32.com/pda/Removing-SIP-icon-Command-Bar-ftopict58785.html might also be helpful although in that solution the button is moved.
0
 
LVL 33

Accepted Solution

by:
pgnatyuk earned 500 total points
ID: 24371572
HWND HWnd = ::FindWindow(TEXT("MS_SIPBUTTON"), NULL);
::ShowWindow(HWnd, SW_HIDE);
You can say millions times "it does not work" and it will not help. Please look for a mistake. Maybe there is something specific about your device or about OS image on it and so it does not work. I've not seen when it didn't work on a PDA since Pocket PC 2003 and it still work on WM 6.1.
Why you put the activate handler into About only? Is this the main window in your app? It should be in the main window - frame, dialog. Also pay attention that you are in this code when your app is becoming inactive.

0
 
LVL 33

Expert Comment

by:pgnatyuk
ID: 24371592
Probably I understood what happens - after these games with the commandbar you need to redraw your window also - call invalidate for the main app window
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Doc'in system (example?) BA 7 115
isEverywhere  challenge 19 82
Syntax Error 2 77
Remove Password Protection from pdf (with password) using an command line executable 5 62
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
A short article about problems I had with the new location API and permissions in Marshmallow
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question