How to use OnKickIdle and enable UPDATE_COMMAND_UI in Modeless Dialog
Box?
I've the article in codeguru. The web address is:
http://www.codeguru.com/Cpp/I-N/internet/chatprograms/article.php/c6223/
Need help badly.
In the Chat_room source code, I notice that the author added OnKickIdle
function, and explained:
//OnKickIdle is responsible for the Update CommandUI
//SDI/MDI applications have their own WM routing for this
//but Dialog doesn't. That's why we had to intercept and handle it - yh
I have tested the OnKickIdle function in the Modeless and Modal Dialog
Box. In the Modal Dialog Box, this function will handle the WM_KICKIDLE
Message. but in the Modeless Dialog Box, the function will have no response.
So I want to ask about the difference between the two modal dialog box.
--
Thanks & Regards
Daniel
--
__?__
/ \
/ ^ ^ \
( (o) (o) )
\ /
*=oOOO======(_)=====OOOo====*=====================================*
| | SHANGHAI CELLINK CO, LTD. |
| Daniel Xu | danie...@cellink.com.cn |
*=============Oooo.=========*=====================================*
.oooO ( )
( ) ) /
\ ( (_/
\_)
-------------
Ajay Kalra
ajay...@yahoo.com
"Daniel Xu" <danie...@cellink.com.cn> wrote in message news:<eFKuWGzi...@TK2MSFTNGP11.phx.gbl>...
Thanks for your reply. I want use ON_UPDATE_COMMAND_UI message of MFC in
modeless dialog, and it will response in Toolbar, I want change the Toolbar
Check/Uncheck state. Can you show me another way? I just look for the
website, but find nothing helpful information. Needs your help. Thanks!
Thanks & Regards
Daniel
"Ajay Kalra" <ajay...@yahoo.com> ????
news:df39ee97.0408...@posting.google.com...
-----------------
Ajay Kalra
ajay...@yahoo.com
"Daniel Xu" <danie...@cellink.com.cn> wrote in message news:<#2ou5K#iEHA...@TK2MSFTNGP09.phx.gbl>...
Daniel,
Is dialog invoked from your main application or is it a main window of your
app?
No, the dialog that I invoked is not the main application, it is a popup
dialog. As Ajay said "use SetWindowsHookEx with WH_FOREGROUNDIDLE to
accomplish it", do you have any source code or sample? Maybe I will look up
MSDN?
--
Thanks & Regards
Daniel
"RainMan" <Rai...@ProximaCentauri.com> 写入邮件
news:6137051F-C32C-4B7C...@microsoft.com...
I tried to use SetWindowsHookEx with WH_FOREGROUNDIDLE to accomplish
this problem, but I can not settle it. So I have no choise to trouble you.
Needs your help badly.
I make a DLL file to use SetWindowsHookEx with WH_FOREGROUNDIDLE, and
the main app Load the DLL, but Callback function's parameters as follow:
LRESULT CALLBACK ForegroundIdleProc(int code, WPARAM wParam, LPARAM
lParam)
the Code, wParam, and lParam always be 0. I think your idea is hook mouse
movement, and when the mouse click the toolbar button. then the hook will be
handled. Ritht?
Do you have any sample or document? I still can not find any information
about a modeless dialog box use UPDATE_COMMAND_UI message of toolbar.
Thanks & Regards
Daniel
"Ajay Kalra" <ajay...@yahoo.com> ????
news:df39ee97.04082...@posting.google.com...
I dont have any samples for this. This is how I think it can be
accomplished. Whenever I have encountered modeless dialog(not main
window) in MFC, I have always avoided using ON_UPDATE_COMMAND_UI.
Sorry I could not be of much help.
------------------
Ajay kalra
ajay...@yahoo.com
"Daniel Xu" <danie...@cellink.com.cn> wrote in message news:<uXfXuoHl...@tk2msftngp13.phx.gbl>...