CommandBar_Create question

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?
Wanting2LearnManAsked:
Who is Participating?
 
alexey_gusevConnect With a Mentor Commented:
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
 
Wanting2LearnManAuthor Commented:
Thanks
HINSTANCE hInst;
hInst = AfxGetInstanceHandle();

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

??
0
 
alexey_gusevCommented:
are you sure you haven't missed some semicolon or something BEFORE declaring HINSTANCE variable?

it may be just that :)
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
Wanting2LearnManAuthor Commented:
woops ;o). late at night here thanks
0
 
alexey_gusevCommented:
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
 
Wanting2LearnManAuthor Commented:
I'm creating a PocketPC app and I want it fullscreen as I dont want to use the dialog bar.
0
 
alexey_gusevCommented:
ah, then look at SHFindMenuBar() - this gives you the default menubar (if any)
0
 
Wanting2LearnManAuthor Commented:
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
 
alexey_gusevCommented:
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
 
alexey_gusevCommented:
or perhaps try DestroyWindow(hwndMenubar)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.