Solved

CommandBar_Create question

Posted on 2009-05-12
10
634 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 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
 

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator (https://www.appcelerator.com/). This article presumes a wor…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now