Tooltip problem
-
Hello, I have a problem with a tooltip control in a modeless dialog. I have created the tooltip like this in the dialogs OnInitDialog() function:
m\_pTip = new CToolTipCtrl(); m\_pTip->Create(this, TTS\_ALWAYSTIP); m\_pTip->SetMaxTipWidth(250); m\_pTip->Activate(TRUE); m\_pTip->AddTool(this, "TEST");
I also call RelayEvent in PreTranslateMessage. This works fine. But in a certain situation I must disable the parent window of the dialog, so the dialog behaves like a modal dialog. I do this just with
m\_pParentWnd->EnableWindow(FALSE);
But after this call the tooltips in my dialog do not work anymore. Does someone have a hint for me? Thank you
-
Hello, I have a problem with a tooltip control in a modeless dialog. I have created the tooltip like this in the dialogs OnInitDialog() function:
m\_pTip = new CToolTipCtrl(); m\_pTip->Create(this, TTS\_ALWAYSTIP); m\_pTip->SetMaxTipWidth(250); m\_pTip->Activate(TRUE); m\_pTip->AddTool(this, "TEST");
I also call RelayEvent in PreTranslateMessage. This works fine. But in a certain situation I must disable the parent window of the dialog, so the dialog behaves like a modal dialog. I do this just with
m\_pParentWnd->EnableWindow(FALSE);
But after this call the tooltips in my dialog do not work anymore. Does someone have a hint for me? Thank you
Install a Windows
WH_GETMESSAGE
hook for the modeless dialog box. More info here: http://support.microsoft.com/kb/187988/en-us[^]Best wishes, Hans
[CodeProject Forum Guidelines] [How To Ask A Question] [My Articles]
-
Install a Windows
WH_GETMESSAGE
hook for the modeless dialog box. More info here: http://support.microsoft.com/kb/187988/en-us[^]Best wishes, Hans
[CodeProject Forum Guidelines] [How To Ask A Question] [My Articles]
Hello Hans, thank you for your answer. I have tried this but it does not work. After calling AfxGetStaticModuleState() in the GetMessageProc, AfxGetApp() returns a NULL pointer within the proc. So I removed AFX_MANAGE_STATE(AfxGetStaticModuleState( )) and then the pointer is OK. (But here is no change in the tooltip behavior)
LRESULT CALLBACK GetMessageProc(int nCode, WPARAM wParam, LPARAM lParam)
{
// Switch the module state for the correct handle to be used.
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
...I think the problem is not that it is a modeless dialog, because when the dialog is in modeless state, the tooltips work (without any GetMessageProc). This means that PreTranslateMessage within my dialog is called. The problem only occurs when I call
m\_pParentWnd->EnableWindow(FALSE);
in the dialog class. When I set a breakpoint in PreTranslateMessige procedure of my dialog, I can see that RelayEvent is called (But the Tooltip doens not apear): Btw: My modeless dialog is created in the mainframe, it is not in a dll. Any ideas? regards
-
Hello, I have a problem with a tooltip control in a modeless dialog. I have created the tooltip like this in the dialogs OnInitDialog() function:
m\_pTip = new CToolTipCtrl(); m\_pTip->Create(this, TTS\_ALWAYSTIP); m\_pTip->SetMaxTipWidth(250); m\_pTip->Activate(TRUE); m\_pTip->AddTool(this, "TEST");
I also call RelayEvent in PreTranslateMessage. This works fine. But in a certain situation I must disable the parent window of the dialog, so the dialog behaves like a modal dialog. I do this just with
m\_pParentWnd->EnableWindow(FALSE);
But after this call the tooltips in my dialog do not work anymore. Does someone have a hint for me? Thank you
-
You got to activate the tooltip new. If it doesnt work create every tiem a new one.:~
Greetings from Germany
Hi Karsten That's it! I just have to call Activate after disabling the parent wnd. Thank you very much