Solved

CommandBar_Create question

Posted on 2009-05-12
10
643 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

914 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

23 Experts available now in Live!

Get 1:1 Help Now