|
Hi all,
I have made a dialog box application, in that application i have made various controls and on clicking on buttons some resources are being hide and some are being shown. My problem is sometimes when i press button or simultaneusly press various buttons controls take time to load and at that time cpu usage is 75-100%.
Can anybody help me in solving this....
thanks in advance
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
How many buttons you have on the forum ?
|
|
|
|
|
12 buttons
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Can you show us the code you use to hide/show the controls?
|
|
|
|
|
m_Dialog_Path.ShowWindow(FALSE);
m_Shortcut_Info.ShowWindow(FALSE);
m_Reg_Det.ShowWindow(FALSE);
m_Uninst_Gen_Info.ShowWindow(FALSE);
m_Del_Edit.ShowWindow(FALSE);
m_Files.ShowWindow(TRUE);
m_Fil.ShowWindow(TRUE);
m_Add_Dir.ShowWindow(TRUE);
m_Clear_List.ShowWindow(TRUE);
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Look up the documentation for ShowWindow(). Use SW_SHOW and SW_HIDE as parameters.
However, I doubt that it solves your problem with high CPU usage. It could be something else in your code.
|
|
|
|
|
when i have just written code to show and hide controls problem existed
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
I dont think problem is of these buttons.you click them repeated or once?
|
|
|
|
|
Without the relevant code there is not much we can do.
Use the debugger or even the profiler to isolate the function that uses too many CPU cycles.
|
|
|
|
|
If you comment out these nine statements, what happens? If you uncomment them one at a time, what happens?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi
Create a Tooltip for dropdown menu using Win32 .
Thanks and Regrads
Prabhat Singh
|
|
|
|
|
..on a toolbar, or on a dropdown menu? You contradict yourself in the two sentences you wrote.
One is easy, one is hard. There's a good reason the help text for a menu item goes in the status bar normally...
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Sir
I want to Create a Tooltip on Toolbar Menu using Win32 API.
Prabhat Singh
|
|
|
|
|
I know of no thing as a "toolbar menu".
Do you mean a popup menu, that you make appear when someone clicks on a toolbar button?
If you use TrackPopupMenu (from memory), then the window used as a parameter will get WM_MENUSELECT messages, and you can then put help text somewhere (eg the status bar).
Enough guessing - you need to provide more information.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
yap Toolbar popupmenu
How Can I do this ?
is there any example for that ?
Prabhat Singh
|
|
|
|
|
pls help me to solve my problem.
Prabhat Singh
|
|
|
|
|
Prabhat.Singh wrote: pls help me to solve my problem.
Pls be clear about what your problem *is*.
Do you have a toolbar?
Do you have a handler that is run when a button is pressed?
Have you make a popupmenu? (hint: TrackPopupMenu).
Have you written a handler for WM_INITMENU?
The answers to those all need to be "Yes" before you need further help.
I've already said putting a tooltip next to a menu that has popped up is very hard, and you should use some other way of giving feedback to the user. MFC uses the status bar for it. If they're not clever enough to put a tooltip next to the menu, then neither are you - or me.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
His head may explode now.
|
|
|
|
|
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Yes Sir I am having Toolbar which have Button when I press button Popupmenu create .
Sir I am able to display a tooltip on Toolbar Button , But tooltip is not display on Menu item.
I used TTN_NEEDTEXT for Tooltip.
Prabhat Singh
|
|
|
|
|
This is the last time I repeat myself.
When the mouse moves about the menu, a WM_MENUSELECT is passed to the window handle specified in the TrackPopupMenu function. (You are using this function? I know of no MagicMenuButton controls in standard Win32).
Handle that message, and display text somewhere.
If you start popping up windows, then that may mess up the menu message loop. I take the fact that the clever people at microsoft, who are (hopefully) better programmers than either of us, use the status bar for menu help text as a very strong hint that putting tooltips up is (a) a bad idea, (b) very hard.
Menus are a very opaque part of windows, as they have lots of strange behaviours that date back to Windows 1.0...
Try putting a static control on your dialog, or the status bar, and display the help text there.
Bye,
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Oh, one more thing. Perhaps I have more important things to do with my time than helping you? Unless you give me money, I don't provide a 11 minute response time.
The problem may be important to you, and helps you pay your mortgage. It doesn't pay mine.
Patience, young padawan.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Iain Clarke wrote: Patience, young padawan
Yes master. May the force be with you - always.
|
|
|
|
|
Prabhat.Singh wrote: Hi Create a Tooltip for dropdown menu using Win32
No, I won't.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Next task?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|