Solved

CommandBar_Create question

Posted on 2009-05-12
10
664 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 500 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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 video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.
Suggested Courses

634 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