Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CommandBar_Create question

Posted on 2009-05-12
10
Medium Priority
?
684 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
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

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 …
In this post we will learn different types of Android Layout and some basics of an Android App.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

773 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