|
-
September 30th, 2010, 10:49 AM
#1
[WM6.5] How to show/hide menu automatically
Hi All,
I have a application.
In which, I will show a message box when receive a specify message. And this message box should is TopMost.
It work fine except when user click show menu, my message box will show under this menu.
I had tried to use some code to hide my menu or set top for my messagebox:
ex:
ShowWindow(hMenu,SW_HIDE);
SetForeground(hMessagebox)
SendMessage(hMenu,WM_COMMAND,0,0);
...
But notthing happen.
I need it urgently. Thanks for any solution.
My English is very bad. So tell me if Something I talked make u confuse.
My Ebook Store: www.coding.vn/book.php
-
September 30th, 2010, 01:17 PM
#2
Re: [WM6.5] How to show/hide menu automatically
A message box is normally modal, so a user shouldn't be able to click on a menu. If your message box isn't modal, you'll have to explain what you mean with a message box.
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
-
September 30th, 2010, 09:40 PM
#3
Re: [WM6.5] How to show/hide menu automatically
Hi, thanks for your quick reply.
But now I am not using MFC framework, It's just my customer framework, and their framework has a message box with a method to DoModal().
ex:
ABCMessageBox x;
//Do Init there
x.DoModal();
The problem is I can't check its source code. So my solution is Hiding the menu bar before show my message box.
But I have tried several times. all of it had failed.
Could you give me another solution ?
My English is very bad. So tell me if Something I talked make u confuse.
My Ebook Store: www.coding.vn/book.php
-
October 1st, 2010, 02:08 AM
#4
Re: [WM6.5] How to show/hide menu automatically
uhm, Nobody can help me ?
Currently, I am thinking about hiding menu by send to it a virtual key.
When I use RemoteSpy I found that it will hide menu by sending two command:
WM_CANCELMODE WParam 0 LParam 0
WM_EXITMENULOOP WParam 1 LParam 0
So in code before I show my Message Box I had sent this command to hide my menu :
SendMessage(hWnd,WM_CANCELMODE,0,0);
SendMessage(hWnd,WM_EXITMENULOOP,1,0);
But the menu still exist.
I don't know why exactly.
Thanks for any suggestion.
My English is very bad. So tell me if Something I talked make u confuse.
My Ebook Store: www.coding.vn/book.php
-
October 1st, 2010, 11:04 AM
#5
Re: [WM6.5] How to show/hide menu automatically
Is the menu displayed in the ABCMessageBox window or in another window?
If it is displayed in another window and ABCMessageBox is displayed modal, then the user shouldn't be able to open the menu. If he is able to do so, then perhaps you didn't set the parent of the ABCMessageBox window.
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
-
October 4th, 2010, 08:54 AM
#6
Re: [WM6.5] How to show/hide menu automatically
hey,
I have set its parent. But nothing happens. it's so strange.
Because I am working in my customer platform, So it's hard to find out the root cause.
I have doing some tests to process MENU by send LEFT KEY down.
I send message BROADCAST like this:
SendMessage(HWND_BROADCAST, WM_KEYDOWN, VK_LEFT, 1);
and the menu is close. but active program is other program too.
I am doubt that Another process has control the menu. (maybe it is well know with "menu_worker") so I send WM_KEYDOWN to this process, but still nothing happen.
uhm, so hard to show you all of the way I have done to fix it. I am so upset right now.
Thanks for answer.
My English is very bad. So tell me if Something I talked make u confuse.
My Ebook Store: www.coding.vn/book.php
-
October 7th, 2010, 05:13 AM
#7
Re: [WM6.5] How to show/hide menu automatically
Hi All,
Thanks for your all support. I have found the root problem.
In this case, at my customer framework, they have a background service to handle my menu.
So I have handled my menu by sending message to that service.
Thank so much.
My English is very bad. So tell me if Something I talked make u confuse.
My Ebook Store: www.coding.vn/book.php
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|