Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CommandBar_Create question

Posted on 2009-05-12
10
Medium Priority
?
677 Views
Last Modified: 2013-12-21
I am trying to get a handle to the command bar in my windows mobile application using the following:
 HWND hCmdBar;
// Initialize when creating the command bar
hCmdBar = CommandBar_Create(hInst, hwnd, 1);

What paramaters do I use for the hInst and hwnd in MFC?
0
Comment
Question by:Wanting2LearnMan
[X]
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
  • 6
  • 4
10 Comments
 
LVL 24

Accepted Solution

by:
alexey_gusev earned 2000 total points
ID: 24369599
according to http://msdn.microsoft.com/en-us/library/ms908131.aspx, you would need the following:

hwnd = parent hwnd (eg AfxGetMainWnd()->m_hWnd)
hInst = AfxGetInstanceHandle()
0
 

Author Comment

by:Wanting2LearnMan
ID: 24369693
Thanks
HINSTANCE hInst;
hInst = AfxGetInstanceHandle();

gives me:
error C2275: 'HINSTANCE' : illegal use of this type as an expression      

??
0
 
LVL 24

Expert Comment

by:alexey_gusev
ID: 24369704
are you sure you haven't missed some semicolon or something BEFORE declaring HINSTANCE variable?

it may be just that :)
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 

Author Comment

by:Wanting2LearnMan
ID: 24369732
woops ;o). late at night here thanks
0
 
LVL 24

Expert Comment

by:alexey_gusev
ID: 24369762
btw, why do you need it at all? create any dummy project and select some Smartphone SDK. you'll see how it creates dialog bar there
0
 

Author Comment

by:Wanting2LearnMan
ID: 24370016
I'm creating a PocketPC app and I want it fullscreen as I dont want to use the dialog bar.
0
 
LVL 24

Expert Comment

by:alexey_gusev
ID: 24370093
ah, then look at SHFindMenuBar() - this gives you the default menubar (if any)
0
 

Author Comment

by:Wanting2LearnMan
ID: 24370193
I have did this and finf that it does the trick in the emulator:

HWND hWnd;
hWnd = ::SHFindMenuBar(this->m_hWnd);
::ShowWindow(hWnd, SW_HIDE);

But I notice that when I deploy it to my WM6 device the SIP button is still visible (right in the centre of the menu bar)

How can I hide this?
0
 
LVL 24

Expert Comment

by:alexey_gusev
ID: 24370220
ahhh, that's another story :), usually it's pretty hard to achieve. use Spy++ to discover related windows and hide them. you might want to open separate question, so everyone can discuss this issue there
0
 
LVL 24

Expert Comment

by:alexey_gusev
ID: 24370226
or perhaps try DestroyWindow(hwndMenubar)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

705 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