Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Thu, 26 Jun 2008 14:01:04 -0500,    group: microsoft.public.win32.programmer.ui        back       


Tooltip disappears after showing once   
Hi all,

I have a simple dialog with a button (the id is 1000). I am on XP and the 
manifest file is included with the executable. I tried adding a tooltip to 
the button using the following code. The problem I have is that

1) If the user clicks/right-clicks the button, the tooltip will not show 
again.
2) If the user mouses over the button, tooltip will show. However if tooltip 
timeouts, the tooltip disappears and never shows again.

If the user hovers on and off the button, the tooltip would show correctly.
If I take out the manifest file, everything works.

I used Spy to look at the messages for the tooltip control. When there is no 
manifest file, the tooltip will get TTM_RELAYEVENT and fire the timer right 
away if the user hovers the button. However after the user clicks on the 
button, the tooltip will not fire the timer anymore.

I tried TTM_ACTIVATE and it didn't work. I did a search on google and I 
found that there were quite a few posts regarding this very same issue. 
However there was no resolution

http://groups.google.com/group/microsoft.public.win32.programmer.ui/browse_thread/thread/b46916de05312985/39187db839c2a196?lnk=gst&q=TTF_SUBCLASS#39187db839c2a196

Anyone has any clue what's going on?

Thanks in advance,

Frank Cheng


#include <windows.h>
#include <commctrl.h>
HWND hwndToolTips;

BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
{
 TOOLINFO ti;
 switch (MyMSG)
 {
  case WM_COMMAND:
   if (wp==2) EndDialog(h,0);
   break;
  case WM_INITDIALOG:
   hwndToolTips = CreateWindow(TOOLTIPS_CLASS,
          NULL,
          WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
          CW_USEDEFAULT, CW_USEDEFAULT,
          CW_USEDEFAULT, CW_USEDEFAULT,
          h, NULL,
          GetModuleHandle(NULL),
          NULL);
   if (hwndToolTips)
   {
    ZeroMemory(&ti,sizeof(ti));
    ti.cbSize = sizeof(ti);
    ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS;
    ti.hwnd = h;
    ti.uId = (UINT)GetDlgItem(h,1000);
    ti.lpszText = "ASDF";
    SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
   }
   break;
 }
 return FALSE;
}

int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR lpCmdLine,int 
nCmdShow)
{
 INITCOMMONCONTROLSEX ics;
 ics.dwSize = sizeof(ics);
 ics.dwICC = ICC_WIN95_CLASSES;
 InitCommonControlsEx(&ics);
 DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
 ExitProcess(0);
 return 0;
}
date: Thu, 26 Jun 2008 14:01:04 -0500   author:   Frank Cheng

Re: Tooltip disappears after showing once   
On Jun 26, 12:01 pm, "Frank Cheng"  wrote:
> Hi all,
>
> I have a simple dialog with a button (the id is 1000). I am on XP and the
> manifest file is included with the executable. I tried adding a tooltip to
> the button using the following code. The problem I have is that
>
> 1) If the user clicks/right-clicks the button, the tooltip will not show
> again.
> 2) If the user mouses over the button, tooltip will show. However if tooltip
> timeouts, the tooltip disappears and never shows again.
>
> If the user hovers on and off the button, the tooltip would show correctly.
> If I take out the manifest file, everything works.
>
> I used Spy to look at the messages for the tooltip control. When there is no
> manifest file, the tooltip will get TTM_RELAYEVENT and fire the timer right
> away if the user hovers the button. However after the user clicks on the
> button, the tooltip will not fire the timer anymore.
>
> I tried TTM_ACTIVATE and it didn't work. I did a search on google and I
> found that there were quite a few posts regarding this very same issue.
> However there was no resolution
>
> http://groups.google.com/group/microsoft.public.win32.programmer.ui/b...
>
> Anyone has any clue what's going on?
>
> Thanks in advance,
>
> Frank Cheng
>
> #include <windows.h>
> #include <commctrl.h>
> HWND hwndToolTips;
>
> BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
> {
>  TOOLINFO ti;
>  switch (MyMSG)
>  {
>   case WM_COMMAND:
>    if (wp==2) EndDialog(h,0);
>    break;
>   case WM_INITDIALOG:
>    hwndToolTips = CreateWindow(TOOLTIPS_CLASS,
>           NULL,
>           WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
>           CW_USEDEFAULT, CW_USEDEFAULT,
>           CW_USEDEFAULT, CW_USEDEFAULT,
>           h, NULL,
>           GetModuleHandle(NULL),
>           NULL);
>    if (hwndToolTips)
>    {
>     ZeroMemory(&ti,sizeof(ti));
>     ti.cbSize = sizeof(ti);
>     ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS;
>     ti.hwnd = h;
>     ti.uId = (UINT)GetDlgItem(h,1000);
>     ti.lpszText = "ASDF";
>     SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
>    }
>    break;
>  }
>  return FALSE;
>
> }
>
> int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR lpCmdLine,int
> nCmdShow)
> {
>  INITCOMMONCONTROLSEX ics;
>  ics.dwSize = sizeof(ics);
>  ics.dwICC = ICC_WIN95_CLASSES;
>  InitCommonControlsEx(&ics);
>  DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
>  ExitProcess(0);
>  return 0;
>
>
>
> }- Hide quoted text -
>
> - Show quoted text -



Hi,

When creating the tooltip control with the API CreateWindowEx(),
use the extended window style  WS_EX_TOPMOST.

Also, you need to activate the tooltip with the following message:

	SendMessage()		TTM_ACTIVATE

http://msdn2.microsoft.com/en-us/library/ms672653.aspx

http://msdn2.microsoft.com/en-us/library/ms650484.aspx

Kellie.
date: Thu, 26 Jun 2008 12:27:16 -0700 (PDT)   author:   Kellie Fitton

Re: Tooltip disappears after showing once   
Here is the modify version with WS_EX_TOPMOST and TTM_ACTIVATE, still 
doesn't work.

#include <windows.h>
#include <commctrl.h>

HWND hwndToolTips;

BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
{
 TOOLINFO ti;
 switch (MyMSG)
 {
  case WM_COMMAND:
   if (wp==2) EndDialog(h,0);
   break;
  case WM_INITDIALOG:
   hwndToolTips = CreateWindowEx(WS_EX_TOPMOST,TOOLTIPS_CLASS,
          NULL,
          WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
          CW_USEDEFAULT, CW_USEDEFAULT,
          CW_USEDEFAULT, CW_USEDEFAULT,
          h, NULL,
          GetModuleHandle(NULL),
          NULL);
   if (hwndToolTips)
   {
    ZeroMemory(&ti,sizeof(ti));
    ti.cbSize = sizeof(ti);
    ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS ;
    ti.hwnd = h;
    ti.lpszText = "ASDF";
    ti.uId = (UINT)GetDlgItem(h,1000);
    SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
    SendMessage(hwndToolTips, TTM_ACTIVATE, 1, 0);
   }
   break;
 }
 return FALSE;
}

int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR lpCmdLine,int 
nCmdShow)
{
 INITCOMMONCONTROLSEX ics;
 ics.dwSize = sizeof(ics);
 ics.dwICC = ICC_WIN95_CLASSES;
 InitCommonControlsEx(&ics);
 DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
 ExitProcess(0);
 return 0;
}



"Kellie Fitton"  
???????:eb7a6f34-9b4e-4905-9cb3-2cfafc74ba5b@c58g2000hsc.googlegroups.com...
On Jun 26, 12:01 pm, "Frank Cheng"  wrote:
> Hi all,
>
> I have a simple dialog with a button (the id is 1000). I am on XP and the
> manifest file is included with the executable. I tried adding a tooltip to
> the button using the following code. The problem I have is that
>
> 1) If the user clicks/right-clicks the button, the tooltip will not show
> again.
> 2) If the user mouses over the button, tooltip will show. However if 
> tooltip
> timeouts, the tooltip disappears and never shows again.
>
> If the user hovers on and off the button, the tooltip would show 
> correctly.
> If I take out the manifest file, everything works.
>
> I used Spy to look at the messages for the tooltip control. When there is 
> no
> manifest file, the tooltip will get TTM_RELAYEVENT and fire the timer 
> right
> away if the user hovers the button. However after the user clicks on the
> button, the tooltip will not fire the timer anymore.
>
> I tried TTM_ACTIVATE and it didn't work. I did a search on google and I
> found that there were quite a few posts regarding this very same issue.
> However there was no resolution
>
> http://groups.google.com/group/microsoft.public.win32.programmer.ui/b...
>
> Anyone has any clue what's going on?
>
> Thanks in advance,
>
> Frank Cheng
>
> #include <windows.h>
> #include <commctrl.h>
> HWND hwndToolTips;
>
> BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
> {
> TOOLINFO ti;
> switch (MyMSG)
> {
> case WM_COMMAND:
> if (wp==2) EndDialog(h,0);
> break;
> case WM_INITDIALOG:
> hwndToolTips = CreateWindow(TOOLTIPS_CLASS,
> NULL,
> WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
> CW_USEDEFAULT, CW_USEDEFAULT,
> CW_USEDEFAULT, CW_USEDEFAULT,
> h, NULL,
> GetModuleHandle(NULL),
> NULL);
> if (hwndToolTips)
> {
> ZeroMemory(&ti,sizeof(ti));
> ti.cbSize = sizeof(ti);
> ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS;
> ti.hwnd = h;
> ti.uId = (UINT)GetDlgItem(h,1000);
> ti.lpszText = "ASDF";
> SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
> }
> break;
> }
> return FALSE;
>
> }
>
> int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR lpCmdLine,int
> nCmdShow)
> {
> INITCOMMONCONTROLSEX ics;
> ics.dwSize = sizeof(ics);
> ics.dwICC = ICC_WIN95_CLASSES;
> InitCommonControlsEx(&ics);
> DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
> ExitProcess(0);
> return 0;
>
>
>
> }- Hide quoted text -
>
> - Show quoted text -



Hi,

When creating the tooltip control with the API CreateWindowEx(),
use the extended window style  WS_EX_TOPMOST.

Also, you need to activate the tooltip with the following message:

SendMessage() TTM_ACTIVATE

http://msdn2.microsoft.com/en-us/library/ms672653.aspx

http://msdn2.microsoft.com/en-us/library/ms650484.aspx

Kellie.
date: Thu, 26 Jun 2008 15:46:35 -0500   author:   Frank Cheng

Re: Tooltip disappears after showing once   
On Jun 26, 1:46 pm, "Frank Cheng"  wrote:
> Here is the modify version with WS_EX_TOPMOST and TTM_ACTIVATE, still
> doesn't work.
>
> #include <windows.h>
> #include <commctrl.h>
>
> HWND hwndToolTips;
>
> BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
> {
>  TOOLINFO ti;
>  switch (MyMSG)
>  {
>   case WM_COMMAND:
>    if (wp==2) EndDialog(h,0);
>    break;
>   case WM_INITDIALOG:
>    hwndToolTips = CreateWindowEx(WS_EX_TOPMOST,TOOLTIPS_CLASS,
>           NULL,
>           WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
>           CW_USEDEFAULT, CW_USEDEFAULT,
>           CW_USEDEFAULT, CW_USEDEFAULT,
>           h, NULL,
>           GetModuleHandle(NULL),
>           NULL);
>    if (hwndToolTips)
>    {
>     ZeroMemory(&ti,sizeof(ti));
>     ti.cbSize = sizeof(ti);
>     ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS ;
>     ti.hwnd = h;
>     ti.lpszText = "ASDF";
>     ti.uId = (UINT)GetDlgItem(h,1000);
>     SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
>     SendMessage(hwndToolTips, TTM_ACTIVATE, 1, 0);
>    }
>    break;
>  }
>  return FALSE;
>
> }
>
> int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR lpCmdLine,int
> nCmdShow)
> {
>  INITCOMMONCONTROLSEX ics;
>  ics.dwSize = sizeof(ics);
>  ics.dwICC = ICC_WIN95_CLASSES;
>  InitCommonControlsEx(&ics);
>  DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
>  ExitProcess(0);
>  return 0;
>
> }
>
> "Kellie Fitton" 
> ???????:eb7a6f34-9b4e-4905-9cb3-2cfafc74b...@c58g2000hsc.googlegroups.com> On Jun 26, 12:01 pm, "Frank Cheng"  wrote:
>
>
>
>
>
> > Hi all,
>
> > I have a simple dialog with a button (the id is 1000). I am on XP and the
> > manifest file is included with the executable. I tried adding a tooltip to
> > the button using the following code. The problem I have is that
>
> > 1) If the user clicks/right-clicks the button, the tooltip will not show
> > again.
> > 2) If the user mouses over the button, tooltip will show. However if
> > tooltip
> > timeouts, the tooltip disappears and never shows again.
>
> > If the user hovers on and off the button, the tooltip would show
> > correctly.
> > If I take out the manifest file, everything works.
>
> > I used Spy to look at the messages for the tooltip control. When there is
> > no
> > manifest file, the tooltip will get TTM_RELAYEVENT and fire the timer
> > right
> > away if the user hovers the button. However after the user clicks on the
> > button, the tooltip will not fire the timer anymore.
>
> > I tried TTM_ACTIVATE and it didn't work. I did a search on google and I
> > found that there were quite a few posts regarding this very same issue.
> > However there was no resolution
>
> >http://groups.google.com/group/microsoft.public.win32.programmer.ui/b...
>
> > Anyone has any clue what's going on?
>
> > Thanks in advance,
>
> > Frank Cheng
>
> > #include <windows.h>
> > #include <commctrl.h>
> > HWND hwndToolTips;
>
> > BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
> > {
> > TOOLINFO ti;
> > switch (MyMSG)
> > {
> > case WM_COMMAND:
> > if (wp==2) EndDialog(h,0);
> > break;
> > case WM_INITDIALOG:
> > hwndToolTips = CreateWindow(TOOLTIPS_CLASS,
> > NULL,
> > WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
> > CW_USEDEFAULT, CW_USEDEFAULT,
> > CW_USEDEFAULT, CW_USEDEFAULT,
> > h, NULL,
> > GetModuleHandle(NULL),
> > NULL);
> > if (hwndToolTips)
> > {
> > ZeroMemory(&ti,sizeof(ti));
> > ti.cbSize = sizeof(ti);
> > ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS;
> > ti.hwnd = h;
> > ti.uId = (UINT)GetDlgItem(h,1000);
> > ti.lpszText = "ASDF";
> > SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
> > }
> > break;
> > }
> > return FALSE;
>
> > }
>
> > int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR lpCmdLine,int
> > nCmdShow)
> > {
> > INITCOMMONCONTROLSEX ics;
> > ics.dwSize = sizeof(ics);
> > ics.dwICC = ICC_WIN95_CLASSES;
> > InitCommonControlsEx(&ics);
> > DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
> > ExitProcess(0);
> > return 0;
>


Hi,

Try to send the following Windows message:

	SendMessage()	TTM_SETTOOLINFO

http://msdn.microsoft.com/en-us/library/bb760416(VS.85).aspx

Kellie.
date: Thu, 26 Jun 2008 14:19:53 -0700 (PDT)   author:   Kellie Fitton

Re: Tooltip disappears after showing once   
I tried it and it didn't work, and I failed to see how sending 
TTM_SETTOOLINFO is relevant to the problem.

"Kellie Fitton"  
???????:615c5ec2-f4c2-42b4-ac1a-5d5d1a2a1650@k37g2000hsf.googlegroups.com...
On Jun 26, 1:46 pm, "Frank Cheng"  wrote:
> Here is the modify version with WS_EX_TOPMOST and TTM_ACTIVATE, still
> doesn't work.
>
> #include <windows.h>
> #include <commctrl.h>
>
> HWND hwndToolTips;
>
> BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
> {
> TOOLINFO ti;
> switch (MyMSG)
> {
> case WM_COMMAND:
> if (wp==2) EndDialog(h,0);
> break;
> case WM_INITDIALOG:
> hwndToolTips = CreateWindowEx(WS_EX_TOPMOST,TOOLTIPS_CLASS,
> NULL,
> WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
> CW_USEDEFAULT, CW_USEDEFAULT,
> CW_USEDEFAULT, CW_USEDEFAULT,
> h, NULL,
> GetModuleHandle(NULL),
> NULL);
> if (hwndToolTips)
> {
> ZeroMemory(&ti,sizeof(ti));
> ti.cbSize = sizeof(ti);
> ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS ;
> ti.hwnd = h;
> ti.lpszText = "ASDF";
> ti.uId = (UINT)GetDlgItem(h,1000);
> SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
> SendMessage(hwndToolTips, TTM_ACTIVATE, 1, 0);
> }
> break;
> }
> return FALSE;
>
> }
>
> int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR lpCmdLine,int
> nCmdShow)
> {
> INITCOMMONCONTROLSEX ics;
> ics.dwSize = sizeof(ics);
> ics.dwICC = ICC_WIN95_CLASSES;
> InitCommonControlsEx(&ics);
> DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
> ExitProcess(0);
> return 0;
>
> }
>
> "Kellie Fitton" 
> ???????:eb7a6f34-9b4e-4905-9cb3-2cfafc74b...@c58g2000hsc.googlegroups.com...
> On Jun 26, 12:01 pm, "Frank Cheng"  wrote:
>
>
>
>
>
> > Hi all,
>
> > I have a simple dialog with a button (the id is 1000). I am on XP and 
> > the
> > manifest file is included with the executable. I tried adding a tooltip 
> > to
> > the button using the following code. The problem I have is that
>
> > 1) If the user clicks/right-clicks the button, the tooltip will not show
> > again.
> > 2) If the user mouses over the button, tooltip will show. However if
> > tooltip
> > timeouts, the tooltip disappears and never shows again.
>
> > If the user hovers on and off the button, the tooltip would show
> > correctly.
> > If I take out the manifest file, everything works.
>
> > I used Spy to look at the messages for the tooltip control. When there 
> > is
> > no
> > manifest file, the tooltip will get TTM_RELAYEVENT and fire the timer
> > right
> > away if the user hovers the button. However after the user clicks on the
> > button, the tooltip will not fire the timer anymore.
>
> > I tried TTM_ACTIVATE and it didn't work. I did a search on google and I
> > found that there were quite a few posts regarding this very same issue.
> > However there was no resolution
>
> >http://groups.google.com/group/microsoft.public.win32.programmer.ui/b...
>
> > Anyone has any clue what's going on?
>
> > Thanks in advance,
>
> > Frank Cheng
>
> > #include <windows.h>
> > #include <commctrl.h>
> > HWND hwndToolTips;
>
> > BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
> > {
> > TOOLINFO ti;
> > switch (MyMSG)
> > {
> > case WM_COMMAND:
> > if (wp==2) EndDialog(h,0);
> > break;
> > case WM_INITDIALOG:
> > hwndToolTips = CreateWindow(TOOLTIPS_CLASS,
> > NULL,
> > WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
> > CW_USEDEFAULT, CW_USEDEFAULT,
> > CW_USEDEFAULT, CW_USEDEFAULT,
> > h, NULL,
> > GetModuleHandle(NULL),
> > NULL);
> > if (hwndToolTips)
> > {
> > ZeroMemory(&ti,sizeof(ti));
> > ti.cbSize = sizeof(ti);
> > ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS;
> > ti.hwnd = h;
> > ti.uId = (UINT)GetDlgItem(h,1000);
> > ti.lpszText = "ASDF";
> > SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
> > }
> > break;
> > }
> > return FALSE;
>
> > }
>
> > int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR lpCmdLine,int
> > nCmdShow)
> > {
> > INITCOMMONCONTROLSEX ics;
> > ics.dwSize = sizeof(ics);
> > ics.dwICC = ICC_WIN95_CLASSES;
> > InitCommonControlsEx(&ics);
> > DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
> > ExitProcess(0);
> > return 0;
>


Hi,

Try to send the following Windows message:

SendMessage() TTM_SETTOOLINFO

http://msdn.microsoft.com/en-us/library/bb760416(VS.85).aspx

Kellie.
date: Thu, 26 Jun 2008 17:15:19 -0500   author:   Frank Cheng

Re: Tooltip disappears after showing once   
On Jun 26, 3:15 pm, "Frank Cheng"  wrote:
> I tried it and it didn't work, and I failed to see how sending
> TTM_SETTOOLINFO is relevant to the problem.
>
> "Kellie Fitton" 
> ???????:615c5ec2-f4c2-42b4-ac1a-5d5d1a2a1...@k37g2000hsf.googlegroups.com> On Jun 26, 1:46 pm, "Frank Cheng"  wrote:
>
>
>
>
>
> > Here is the modify version with WS_EX_TOPMOST and TTM_ACTIVATE, still
> > doesn't work.
>
> > #include <windows.h>
> > #include <commctrl.h>
>
> > HWND hwndToolTips;
>
> > BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
> > {
> > TOOLINFO ti;
> > switch (MyMSG)
> > {
> > case WM_COMMAND:
> > if (wp==2) EndDialog(h,0);
> > break;
> > case WM_INITDIALOG:
> > hwndToolTips = CreateWindowEx(WS_EX_TOPMOST,TOOLTIPS_CLASS,
> > NULL,
> > WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
> > CW_USEDEFAULT, CW_USEDEFAULT,
> > CW_USEDEFAULT, CW_USEDEFAULT,
> > h, NULL,
> > GetModuleHandle(NULL),
> > NULL);
> > if (hwndToolTips)
> > {
> > ZeroMemory(&ti,sizeof(ti));
> > ti.cbSize = sizeof(ti);
> > ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS ;
> > ti.hwnd = h;
> > ti.lpszText = "ASDF";
> > ti.uId = (UINT)GetDlgItem(h,1000);
> > SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
> > SendMessage(hwndToolTips, TTM_ACTIVATE, 1, 0);
> > }
> > break;
> > }
> > return FALSE;
>
> > }
>
> > int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR lpCmdLine,int
> > nCmdShow)
> > {
> > INITCOMMONCONTROLSEX ics;
> > ics.dwSize = sizeof(ics);
> > ics.dwICC = ICC_WIN95_CLASSES;
> > InitCommonControlsEx(&ics);
> > DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
> > ExitProcess(0);
> > return 0;
>
> > }
>
> > "Kellie Fitton" 
> > ???????:eb7a6f34-9b4e-4905-9cb3-2cfafc74b...@c58g2000hsc.googlegroups.com...
> > On Jun 26, 12:01 pm, "Frank Cheng"  wrote:
>
> > > Hi all,
>
> > > I have a simple dialog with a button (the id is 1000). I am on XP and
> > > the
> > > manifest file is included with the executable. I tried adding a tooltip
> > > to
> > > the button using the following code. The problem I have is that
>
> > > 1) If the user clicks/right-clicks the button, the tooltip will not show
> > > again.
> > > 2) If the user mouses over the button, tooltip will show. However if
> > > tooltip
> > > timeouts, the tooltip disappears and never shows again.
>
> > > If the user hovers on and off the button, the tooltip would show
> > > correctly.
> > > If I take out the manifest file, everything works.
>
> > > I used Spy to look at the messages for the tooltip control. When there
> > > is
> > > no
> > > manifest file, the tooltip will get TTM_RELAYEVENT and fire the timer
> > > right
> > > away if the user hovers the button. However after the user clicks on the
> > > button, the tooltip will not fire the timer anymore.
>
> > > I tried TTM_ACTIVATE and it didn't work. I did a search on google and I
> > > found that there were quite a few posts regarding this very same issue.
> > > However there was no resolution
>
> > >http://groups.google.com/group/microsoft.public.win32.programmer.ui/b.> > > Anyone has any clue what's going on?
>
> > > Thanks in advance,
>
> > > Frank Cheng
>
> > > #include <windows.h>
> > > #include <commctrl.h>
> > > HWND hwndToolTips;
>
> > > BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
> > > {
> > > TOOLINFO ti;
> > > switch (MyMSG)
> > > {
> > > case WM_COMMAND:
> > > if (wp==2) EndDialog(h,0);
> > > break;
> > > case WM_INITDIALOG:
> > > hwndToolTips = CreateWindow(TOOLTIPS_CLASS,
> > > NULL,
> > > WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
> > > CW_USEDEFAULT, CW_USEDEFAULT,
> > > CW_USEDEFAULT, CW_USEDEFAULT,
> > > h, NULL,
> > > GetModuleHandle(NULL),
> > > NULL);
> > > if (hwndToolTips)
> > > {
> > > ZeroMemory(&ti,sizeof(ti));
> > > ti.cbSize = sizeof(ti);
> > > ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS;
> > > ti.hwnd = h;
> > > ti.uId = (UINT)GetDlgItem(h,1000);
> > > ti.lpszText = "ASDF";
> > > SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
> > > }
> > > break;
> > > }
> > > return FALSE;
>
> > > }
>
> > > int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR lpCmdLine,int
> > > nCmdShow)
> > > {
> > > INITCOMMONCONTROLSEX ics;
> > > ics.dwSize = sizeof(ics);
> > > ics.dwICC = ICC_WIN95_CLASSES;
> > > InitCommonControlsEx(&ics);
> > > DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
> > > ExitProcess(0);
> > > return 0;
>


Hi,

The following weblink should give you more pointers:

http://msdn.microsoft.com/en-us/library/bb760252(VS.85).aspx

Kellie.
date: Thu, 26 Jun 2008 15:27:43 -0700 (PDT)   author:   Kellie Fitton

Re: Tooltip disappears after showing once   
My code was copied from that article, plus that article didn't even use any 
of the things that you recommended (WS_EX_TOPMOST, TTM_ACTIVATE, 
TTM_SETTOOLINFO)

"Kellie Fitton"  
???????:8e14acbb-222a-4930-9d15-9d2403d85d2c@m44g2000hsc.googlegroups.com...
On Jun 26, 3:15 pm, "Frank Cheng"  wrote:
> I tried it and it didn't work, and I failed to see how sending
> TTM_SETTOOLINFO is relevant to the problem.
>
> "Kellie Fitton" 
> ???????:615c5ec2-f4c2-42b4-ac1a-5d5d1a2a1...@k37g2000hsf.googlegroups.com...
> On Jun 26, 1:46 pm, "Frank Cheng"  wrote:
>
>
>
>
>
> > Here is the modify version with WS_EX_TOPMOST and TTM_ACTIVATE, still
> > doesn't work.
>
> > #include <windows.h>
> > #include <commctrl.h>
>
> > HWND hwndToolTips;
>
> > BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
> > {
> > TOOLINFO ti;
> > switch (MyMSG)
> > {
> > case WM_COMMAND:
> > if (wp==2) EndDialog(h,0);
> > break;
> > case WM_INITDIALOG:
> > hwndToolTips = CreateWindowEx(WS_EX_TOPMOST,TOOLTIPS_CLASS,
> > NULL,
> > WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
> > CW_USEDEFAULT, CW_USEDEFAULT,
> > CW_USEDEFAULT, CW_USEDEFAULT,
> > h, NULL,
> > GetModuleHandle(NULL),
> > NULL);
> > if (hwndToolTips)
> > {
> > ZeroMemory(&ti,sizeof(ti));
> > ti.cbSize = sizeof(ti);
> > ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS ;
> > ti.hwnd = h;
> > ti.lpszText = "ASDF";
> > ti.uId = (UINT)GetDlgItem(h,1000);
> > SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
> > SendMessage(hwndToolTips, TTM_ACTIVATE, 1, 0);
> > }
> > break;
> > }
> > return FALSE;
>
> > }
>
> > int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR lpCmdLine,int
> > nCmdShow)
> > {
> > INITCOMMONCONTROLSEX ics;
> > ics.dwSize = sizeof(ics);
> > ics.dwICC = ICC_WIN95_CLASSES;
> > InitCommonControlsEx(&ics);
> > DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
> > ExitProcess(0);
> > return 0;
>
> > }
>
> > "Kellie Fitton" 
> > ???????:eb7a6f34-9b4e-4905-9cb3-2cfafc74b...@c58g2000hsc.googlegroups.com...
> > On Jun 26, 12:01 pm, "Frank Cheng"  wrote:
>
> > > Hi all,
>
> > > I have a simple dialog with a button (the id is 1000). I am on XP and
> > > the
> > > manifest file is included with the executable. I tried adding a 
> > > tooltip
> > > to
> > > the button using the following code. The problem I have is that
>
> > > 1) If the user clicks/right-clicks the button, the tooltip will not 
> > > show
> > > again.
> > > 2) If the user mouses over the button, tooltip will show. However if
> > > tooltip
> > > timeouts, the tooltip disappears and never shows again.
>
> > > If the user hovers on and off the button, the tooltip would show
> > > correctly.
> > > If I take out the manifest file, everything works.
>
> > > I used Spy to look at the messages for the tooltip control. When there
> > > is
> > > no
> > > manifest file, the tooltip will get TTM_RELAYEVENT and fire the timer
> > > right
> > > away if the user hovers the button. However after the user clicks on 
> > > the
> > > button, the tooltip will not fire the timer anymore.
>
> > > I tried TTM_ACTIVATE and it didn't work. I did a search on google and 
> > > I
> > > found that there were quite a few posts regarding this very same 
> > > issue.
> > > However there was no resolution
>
> > >http://groups.google.com/group/microsoft.public.win32.programmer.ui/b...
>
> > > Anyone has any clue what's going on?
>
> > > Thanks in advance,
>
> > > Frank Cheng
>
> > > #include <windows.h>
> > > #include <commctrl.h>
> > > HWND hwndToolTips;
>
> > > BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
> > > {
> > > TOOLINFO ti;
> > > switch (MyMSG)
> > > {
> > > case WM_COMMAND:
> > > if (wp==2) EndDialog(h,0);
> > > break;
> > > case WM_INITDIALOG:
> > > hwndToolTips = CreateWindow(TOOLTIPS_CLASS,
> > > NULL,
> > > WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
> > > CW_USEDEFAULT, CW_USEDEFAULT,
> > > CW_USEDEFAULT, CW_USEDEFAULT,
> > > h, NULL,
> > > GetModuleHandle(NULL),
> > > NULL);
> > > if (hwndToolTips)
> > > {
> > > ZeroMemory(&ti,sizeof(ti));
> > > ti.cbSize = sizeof(ti);
> > > ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS;
> > > ti.hwnd = h;
> > > ti.uId = (UINT)GetDlgItem(h,1000);
> > > ti.lpszText = "ASDF";
> > > SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
> > > }
> > > break;
> > > }
> > > return FALSE;
>
> > > }
>
> > > int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR lpCmdLine,int
> > > nCmdShow)
> > > {
> > > INITCOMMONCONTROLSEX ics;
> > > ics.dwSize = sizeof(ics);
> > > ics.dwICC = ICC_WIN95_CLASSES;
> > > InitCommonControlsEx(&ics);
> > > DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
> > > ExitProcess(0);
> > > return 0;
>


Hi,

The following weblink should give you more pointers:

http://msdn.microsoft.com/en-us/library/bb760252(VS.85).aspx

Kellie.
date: Thu, 26 Jun 2008 18:45:31 -0500   author:   Frank Cheng

Re: Tooltip disappears after showing once   
Hi,
I'm also having this very problem. Unfortunately, there is no solution in 
here. Has anyone been able to solve this in the meantime?
Thanks
Sam

"Frank Cheng" wrote:

> My code was copied from that article, plus that article didn't even use any 
> of the things that you recommended (WS_EX_TOPMOST, TTM_ACTIVATE, 
> TTM_SETTOOLINFO)
> 
> "Kellie Fitton"  
> ???????:8e14acbb-222a-4930-9d15-9d2403d85d2c@m44g2000hsc.googlegroups.com...
> On Jun 26, 3:15 pm, "Frank Cheng"  wrote:
> > I tried it and it didn't work, and I failed to see how sending
> > TTM_SETTOOLINFO is relevant to the problem.
> >
> > "Kellie Fitton" 
> > ???????:615c5ec2-f4c2-42b4-ac1a-5d5d1a2a1...@k37g2000hsf.googlegroups.com...
> > On Jun 26, 1:46 pm, "Frank Cheng"  wrote:
> >
> >
> >
> >
> >
> > > Here is the modify version with WS_EX_TOPMOST and TTM_ACTIVATE, still
> > > doesn't work.
> >
> > > #include <windows.h>
> > > #include <commctrl.h>
> >
> > > HWND hwndToolTips;
> >
> > > BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
> > > {
> > > TOOLINFO ti;
> > > switch (MyMSG)
> > > {
> > > case WM_COMMAND:
> > > if (wp==2) EndDialog(h,0);
> > > break;
> > > case WM_INITDIALOG:
> > > hwndToolTips = CreateWindowEx(WS_EX_TOPMOST,TOOLTIPS_CLASS,
> > > NULL,
> > > WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
> > > CW_USEDEFAULT, CW_USEDEFAULT,
> > > CW_USEDEFAULT, CW_USEDEFAULT,
> > > h, NULL,
> > > GetModuleHandle(NULL),
> > > NULL);
> > > if (hwndToolTips)
> > > {
> > > ZeroMemory(&ti,sizeof(ti));
> > > ti.cbSize = sizeof(ti);
> > > ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS ;
> > > ti.hwnd = h;
> > > ti.lpszText = "ASDF";
> > > ti.uId = (UINT)GetDlgItem(h,1000);
> > > SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
> > > SendMessage(hwndToolTips, TTM_ACTIVATE, 1, 0);
> > > }
> > > break;
> > > }
> > > return FALSE;
> >
> > > }
> >
> > > int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR lpCmdLine,int
> > > nCmdShow)
> > > {
> > > INITCOMMONCONTROLSEX ics;
> > > ics.dwSize = sizeof(ics);
> > > ics.dwICC = ICC_WIN95_CLASSES;
> > > InitCommonControlsEx(&ics);
> > > DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
> > > ExitProcess(0);
> > > return 0;
> >
> > > }
> >
> > > "Kellie Fitton" 
> > > ???????:eb7a6f34-9b4e-4905-9cb3-2cfafc74b...@c58g2000hsc.googlegroups.com...
> > > On Jun 26, 12:01 pm, "Frank Cheng"  wrote:
> >
> > > > Hi all,
> >
> > > > I have a simple dialog with a button (the id is 1000). I am on XP and
> > > > the
> > > > manifest file is included with the executable. I tried adding a 
> > > > tooltip
> > > > to
> > > > the button using the following code. The problem I have is that
> >
> > > > 1) If the user clicks/right-clicks the button, the tooltip will not 
> > > > show
> > > > again.
> > > > 2) If the user mouses over the button, tooltip will show. However if
> > > > tooltip
> > > > timeouts, the tooltip disappears and never shows again.
> >
> > > > If the user hovers on and off the button, the tooltip would show
> > > > correctly.
> > > > If I take out the manifest file, everything works.
> >
> > > > I used Spy to look at the messages for the tooltip control. When there
> > > > is
> > > > no
> > > > manifest file, the tooltip will get TTM_RELAYEVENT and fire the timer
> > > > right
> > > > away if the user hovers the button. However after the user clicks on 
> > > > the
> > > > button, the tooltip will not fire the timer anymore.
> >
> > > > I tried TTM_ACTIVATE and it didn't work. I did a search on google and 
> > > > I
> > > > found that there were quite a few posts regarding this very same 
> > > > issue.
> > > > However there was no resolution
> >
> > > >http://groups.google.com/group/microsoft.public.win32.programmer.ui/b...
> >
> > > > Anyone has any clue what's going on?
> >
> > > > Thanks in advance,
> >
> > > > Frank Cheng
> >
> > > > #include <windows.h>
> > > > #include <commctrl.h>
> > > > HWND hwndToolTips;
> >
> > > > BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
> > > > {
> > > > TOOLINFO ti;
> > > > switch (MyMSG)
> > > > {
> > > > case WM_COMMAND:
> > > > if (wp==2) EndDialog(h,0);
> > > > break;
> > > > case WM_INITDIALOG:
> > > > hwndToolTips = CreateWindow(TOOLTIPS_CLASS,
> > > > NULL,
> > > > WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
> > > > CW_USEDEFAULT, CW_USEDEFAULT,
> > > > CW_USEDEFAULT, CW_USEDEFAULT,
> > > > h, NULL,
> > > > GetModuleHandle(NULL),
> > > > NULL);
> > > > if (hwndToolTips)
> > > > {
> > > > ZeroMemory(&ti,sizeof(ti));
> > > > ti.cbSize = sizeof(ti);
> > > > ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS;
> > > > ti.hwnd = h;
> > > > ti.uId = (UINT)GetDlgItem(h,1000);
> > > > ti.lpszText = "ASDF";
> > > > SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
> > > > }
> > > > break;
> > > > }
> > > > return FALSE;
> >
> > > > }
> >
> > > > int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR lpCmdLine,int
> > > > nCmdShow)
> > > > {
> > > > INITCOMMONCONTROLSEX ics;
> > > > ics.dwSize = sizeof(ics);
> > > > ics.dwICC = ICC_WIN95_CLASSES;
> > > > InitCommonControlsEx(&ics);
> > > > DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
> > > > ExitProcess(0);
> > > > return 0;
> >
> 
> 
> Hi,
> 
> The following weblink should give you more pointers:
> 
> http://msdn.microsoft.com/en-us/library/bb760252(VS.85).aspx
> 
> Kellie.
> 
> 
>
date: Fri, 12 Sep 2008 04:47:01 -0700   author:   Sam

Re: Tooltip disappears after showing once   
Hi,

I had the same problem and finally I found the solution on this this
thread :
http://www.codeproject.com/KB/miscctrl/tooltipzen.aspx?df=100&forumid=4069&exp=0&fr=26&select=2018653#xx2018653xx

The problem is due to the TOOLINFO size which depends on the windows
version targetted. I made the modifications proposed in the thread and
it works!

Hope it helps!

Ben

On 12 sep, 07:47, Sam  wrote:
> Hi,
> I'm also having this very problem. Unfortunately, there is no solution in
> here. Has anyone been able to solve this in the meantime?
> Thanks
> Sam
>
> "Frank Cheng" wrote:
> > My code was copied from that article, plus that article didn't even use any
> > of the things that you recommended (WS_EX_TOPMOST, TTM_ACTIVATE,
> > TTM_SETTOOLINFO)
>
> > "Kellie Fitton" 
> > ???????:8e14acbb-222a-4930-9d15-9d2403d85...@m44g2000hsc.googlegroups.com...
> > On Jun 26, 3:15 pm, "Frank Cheng"  wrote:
> > > I tried it and it didn't work, and I failed to see how sending
> > > TTM_SETTOOLINFO is relevant to the problem.
>
> > > "Kellie Fitton" 
> > > ???????:615c5ec2-f4c2-42b4-ac1a-5d5d1a2a1...@k37g2000hsf.googlegroups.com...
> > > On Jun 26, 1:46 pm, "Frank Cheng"  wrote:
>
> > > > Here is the modify version with WS_EX_TOPMOST and TTM_ACTIVATE, still
> > > > doesn't work.
>
> > > > #include <windows.h>
> > > > #include <commctrl.h>
>
> > > > HWND hwndToolTips;
>
> > > > BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
> > > > {
> > > > TOOLINFO ti;
> > > > switch (MyMSG)
> > > > {
> > > > case WM_COMMAND:
> > > > if (wp==2) EndDialog(h,0);
> > > > break;
> > > > case WM_INITDIALOG:
> > > > hwndToolTips = CreateWindowEx(WS_EX_TOPMOST,TOOLTIPS_CLASS,
> > > > NULL,
> > > > WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
> > > > CW_USEDEFAULT, CW_USEDEFAULT,
> > > > CW_USEDEFAULT, CW_USEDEFAULT,
> > > > h, NULL,
> > > > GetModuleHandle(NULL),
> > > > NULL);
> > > > if (hwndToolTips)
> > > > {
> > > > ZeroMemory(&ti,sizeof(ti));
> > > > ti.cbSize = sizeof(ti);
> > > > ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS ;
> > > > ti.hwnd = h;
> > > > ti.lpszText = "ASDF";
> > > > ti.uId = (UINT)GetDlgItem(h,1000);
> > > > SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
> > > > SendMessage(hwndToolTips, TTM_ACTIVATE, 1, 0);
> > > > }
> > > > break;
> > > > }
> > > > return FALSE;
>
> > > > }
>
> > > > int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR lpCmdLine,int
> > > > nCmdShow)
> > > > {
> > > > INITCOMMONCONTROLSEX ics;
> > > > ics.dwSize = sizeof(ics);
> > > > ics.dwICC = ICC_WIN95_CLASSES;
> > > > InitCommonControlsEx(&ics);
> > > > DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
> > > > ExitProcess(0);
> > > > return 0;
>
> > > > }
>
> > > > "Kellie Fitton" 
> > > > ???????:eb7a6f34-9b4e-4905-9cb3-2cfafc74b...@c58g2000hsc.googlegroups.com...
> > > > On Jun 26, 12:01 pm, "Frank Cheng"  wrote:
>
> > > > > Hi all,
>
> > > > > I have a simple dialog with a button (the id is 1000). I am on XP and
> > > > > the
> > > > > manifest file is included with the executable. I tried adding a
> > > > > tooltip
> > > > > to
> > > > > the button using the following code. The problem I have is that
>
> > > > > 1) If the user clicks/right-clicks the button, the tooltip will not
> > > > > show
> > > > > again.
> > > > > 2) If the user mouses over the button, tooltip will show. However if
> > > > > tooltip
> > > > > timeouts, the tooltip disappears and never shows again.
>
> > > > > If the user hovers on and off the button, the tooltip would show
> > > > > correctly.
> > > > > If I take out the manifest file, everything works.
>
> > > > > I used Spy to look at the messages for the tooltip control. When there
> > > > > is
> > > > > no
> > > > > manifest file, the tooltip will get TTM_RELAYEVENT and fire the timer
> > > > > right
> > > > > away if the user hovers the button. However after the user clicks on
> > > > > the
> > > > > button, the tooltip will not fire the timer anymore.
>
> > > > > I tried TTM_ACTIVATE and it didn't work. I did a search on google and
> > > > > I
> > > > > found that there were quite a few posts regarding this very same
> > > > > issue.
> > > > > However there was no resolution
>
> > > > >http://groups.google.com/group/microsoft.public.win32.programmer.ui/b...
>
> > > > > Anyone has any clue what's going on?
>
> > > > > Thanks in advance,
>
> > > > > Frank Cheng
>
> > > > > #include <windows.h>
> > > > > #include <commctrl.h>
> > > > > HWND hwndToolTips;
>
> > > > > BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
> > > > > {
> > > > > TOOLINFO ti;
> > > > > switch (MyMSG)
> > > > > {
> > > > > case WM_COMMAND:
> > > > > if (wp==2) EndDialog(h,0);
> > > > > break;
> > > > > case WM_INITDIALOG:
> > > > > hwndToolTips = CreateWindow(TOOLTIPS_CLASS,
> > > > > NULL,
> > > > > WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
> > > > > CW_USEDEFAULT, CW_USEDEFAULT,
> > > > > CW_USEDEFAULT, CW_USEDEFAULT,
> > > > > h, NULL,
> > > > > GetModuleHandle(NULL),
> > > > > NULL);
> > > > > if (hwndToolTips)
> > > > > {
> > > > > ZeroMemory(&ti,sizeof(ti));
> > > > > ti.cbSize = sizeof(ti);
> > > > > ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS;
> > > > > ti.hwnd = h;
> > > > > ti.uId = (UINT)GetDlgItem(h,1000);
> > > > > ti.lpszText = "ASDF";
> > > > > SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
> > > > > }
> > > > > break;
> > > > > }
> > > > > return FALSE;
>
> > > > > }
>
> > > > > int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR lpCmdLine,int
> > > > > nCmdShow)
> > > > > {
> > > > > INITCOMMONCONTROLSEX ics;
> > > > > ics.dwSize = sizeof(ics);
> > > > > ics.dwICC = ICC_WIN95_CLASSES;
> > > > > InitCommonControlsEx(&ics);
> > > > > DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
> > > > > ExitProcess(0);
> > > > > return 0;
>
> > Hi,
>
> > The following weblink should give you more pointers:
>
> >http://msdn.microsoft.com/en-us/library/bb760252(VS.85).aspx
>
> > Kellie.
date: Thu, 9 Oct 2008 09:44:09 -0700 (PDT)   author:   unknown

Re: Tooltip disappears after showing once   
Hi Ben,

Unfortunately the thread in your last post wasn't quite related to the 
problem I am having. I am on XP and I have an embedded manifest file in the 
program. I make sure that I am loading Comctl32.dll v6.0. I also did

#define _WIN32_IE 0x400
#define _WIN32_WINNT 0x502

At the beginning of my source code file to ensure I got the "largest" 
TOOLINFO (the one with lpReserved). I tried using

TTTOOLINFOA_V1_SIZE
TTTOOLINFOW_V1_SIZE
TTTOOLINFOA_V2_SIZE
TTTOOLINFOW_V2_SIZE
TTTOOLINFOA_V3_SIZE
TTTOOLINFOW_V3_SIZE

all of the above constants for the cbSize (I also tried compiling my program 
with/without UNICODE). The problem remains. The thread you mentioned was 
regarding tooltip not handling some TTM messages because the structure size 
might have been initialized to something that Commctrl DLL didn't expect 
(either smaller or bigger). In my case the TTM_ADDTOOL is working, however 
the tooltip will not show again after you click on the control that's 
associated with the tooltip. However if you have two controls (let's call 
them Button1 and Button2) associated with the same tooltip, clicking on 
button1 will cause the tooltip not showing for button1 again UNLESS you 
mouse over to Button2, which the tooltip will work for Button2. If you then 
mouse over back to button1, the tooltip will be working again. Having said 
that, if you click on Button1 and never mouse over to Button2, the tooltip 
will not show for Button1 again.

Thanks for looking into the issue.

Frank Cheng



 wrote in message 
news:b20f89bb-6a2c-4516-b201-754c11983736@q5g2000hsa.googlegroups.com...
> Hi,
>
> I had the same problem and finally I found the solution on this this
> thread :
> http://www.codeproject.com/KB/miscctrl/tooltipzen.aspx?df=100&forumid=4069&exp=0&fr=26&select=2018653#xx2018653xx
>
> The problem is due to the TOOLINFO size which depends on the windows
> version targetted. I made the modifications proposed in the thread and
> it works!
>
> Hope it helps!
>
> Ben
>
> On 12 sep, 07:47, Sam  wrote:
>> Hi,
>> I'm also having this very problem. Unfortunately, there is no solution in
>> here. Has anyone been able to solve this in the meantime?
>> Thanks
>> Sam
>>
>> "Frank Cheng" wrote:
>> > My code was copied from that article, plus that article didn't even use 
>> > any
>> > of the things that you recommended (WS_EX_TOPMOST, TTM_ACTIVATE,
>> > TTM_SETTOOLINFO)
>>
>> > "Kellie Fitton" 
>> > ???????:8e14acbb-222a-4930-9d15-9d2403d85...@m44g2000hsc.googlegroups.com...
>> > On Jun 26, 3:15 pm, "Frank Cheng"  wrote:
>> > > I tried it and it didn't work, and I failed to see how sending
>> > > TTM_SETTOOLINFO is relevant to the problem.
>>
>> > > "Kellie Fitton" 
>> > > ???????:615c5ec2-f4c2-42b4-ac1a-5d5d1a2a1...@k37g2000hsf.googlegroups.com...
>> > > On Jun 26, 1:46 pm, "Frank Cheng"  wrote:
>>
>> > > > Here is the modify version with WS_EX_TOPMOST and TTM_ACTIVATE, 
>> > > > still
>> > > > doesn't work.
>>
>> > > > #include <windows.h>
>> > > > #include <commctrl.h>
>>
>> > > > HWND hwndToolTips;
>>
>> > > > BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
>> > > > {
>> > > > TOOLINFO ti;
>> > > > switch (MyMSG)
>> > > > {
>> > > > case WM_COMMAND:
>> > > > if (wp==2) EndDialog(h,0);
>> > > > break;
>> > > > case WM_INITDIALOG:
>> > > > hwndToolTips = CreateWindowEx(WS_EX_TOPMOST,TOOLTIPS_CLASS,
>> > > > NULL,
>> > > > WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
>> > > > CW_USEDEFAULT, CW_USEDEFAULT,
>> > > > CW_USEDEFAULT, CW_USEDEFAULT,
>> > > > h, NULL,
>> > > > GetModuleHandle(NULL),
>> > > > NULL);
>> > > > if (hwndToolTips)
>> > > > {
>> > > > ZeroMemory(&ti,sizeof(ti));
>> > > > ti.cbSize = sizeof(ti);
>> > > > ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS ;
>> > > > ti.hwnd = h;
>> > > > ti.lpszText = "ASDF";
>> > > > ti.uId = (UINT)GetDlgItem(h,1000);
>> > > > SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
>> > > > SendMessage(hwndToolTips, TTM_ACTIVATE, 1, 0);
>> > > > }
>> > > > break;
>> > > > }
>> > > > return FALSE;
>>
>> > > > }
>>
>> > > > int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR 
>> > > > lpCmdLine,int
>> > > > nCmdShow)
>> > > > {
>> > > > INITCOMMONCONTROLSEX ics;
>> > > > ics.dwSize = sizeof(ics);
>> > > > ics.dwICC = ICC_WIN95_CLASSES;
>> > > > InitCommonControlsEx(&ics);
>> > > > DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
>> > > > ExitProcess(0);
>> > > > return 0;
>>
>> > > > }
>>
>> > > > "Kellie Fitton" 
>> > > > ???????:eb7a6f34-9b4e-4905-9cb3-2cfafc74b...@c58g2000hsc.googlegroups.com...
>> > > > On Jun 26, 12:01 pm, "Frank Cheng"  wrote:
>>
>> > > > > Hi all,
>>
>> > > > > I have a simple dialog with a button (the id is 1000). I am on XP 
>> > > > > and
>> > > > > the
>> > > > > manifest file is included with the executable. I tried adding a
>> > > > > tooltip
>> > > > > to
>> > > > > the button using the following code. The problem I have is that
>>
>> > > > > 1) If the user clicks/right-clicks the button, the tooltip will 
>> > > > > not
>> > > > > show
>> > > > > again.
>> > > > > 2) If the user mouses over the button, tooltip will show. However 
>> > > > > if
>> > > > > tooltip
>> > > > > timeouts, the tooltip disappears and never shows again.
>>
>> > > > > If the user hovers on and off the button, the tooltip would show
>> > > > > correctly.
>> > > > > If I take out the manifest file, everything works.
>>
>> > > > > I used Spy to look at the messages for the tooltip control. When 
>> > > > > there
>> > > > > is
>> > > > > no
>> > > > > manifest file, the tooltip will get TTM_RELAYEVENT and fire the 
>> > > > > timer
>> > > > > right
>> > > > > away if the user hovers the button. However after the user clicks 
>> > > > > on
>> > > > > the
>> > > > > button, the tooltip will not fire the timer anymore.
>>
>> > > > > I tried TTM_ACTIVATE and it didn't work. I did a search on google 
>> > > > > and
>> > > > > I
>> > > > > found that there were quite a few posts regarding this very same
>> > > > > issue.
>> > > > > However there was no resolution
>>
>> > > > >http://groups.google.com/group/microsoft.public.win32.programmer.ui/b...
>>
>> > > > > Anyone has any clue what's going on?
>>
>> > > > > Thanks in advance,
>>
>> > > > > Frank Cheng
>>
>> > > > > #include <windows.h>
>> > > > > #include <commctrl.h>
>> > > > > HWND hwndToolTips;
>>
>> > > > > BOOL CALLBACK WndProc(HWND h, UINT MyMSG, WPARAM wp, LPARAM lp)
>> > > > > {
>> > > > > TOOLINFO ti;
>> > > > > switch (MyMSG)
>> > > > > {
>> > > > > case WM_COMMAND:
>> > > > > if (wp==2) EndDialog(h,0);
>> > > > > break;
>> > > > > case WM_INITDIALOG:
>> > > > > hwndToolTips = CreateWindow(TOOLTIPS_CLASS,
>> > > > > NULL,
>> > > > > WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP ,
>> > > > > CW_USEDEFAULT, CW_USEDEFAULT,
>> > > > > CW_USEDEFAULT, CW_USEDEFAULT,
>> > > > > h, NULL,
>> > > > > GetModuleHandle(NULL),
>> > > > > NULL);
>> > > > > if (hwndToolTips)
>> > > > > {
>> > > > > ZeroMemory(&ti,sizeof(ti));
>> > > > > ti.cbSize = sizeof(ti);
>> > > > > ti.uFlags = TTF_IDISHWND |TTF_SUBCLASS;
>> > > > > ti.hwnd = h;
>> > > > > ti.uId = (UINT)GetDlgItem(h,1000);
>> > > > > ti.lpszText = "ASDF";
>> > > > > SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
>> > > > > }
>> > > > > break;
>> > > > > }
>> > > > > return FALSE;
>>
>> > > > > }
>>
>> > > > > int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR 
>> > > > > lpCmdLine,int
>> > > > > nCmdShow)
>> > > > > {
>> > > > > INITCOMMONCONTROLSEX ics;
>> > > > > ics.dwSize = sizeof(ics);
>> > > > > ics.dwICC = ICC_WIN95_CLASSES;
>> > > > > InitCommonControlsEx(&ics);
>> > > > > DialogBoxParam(NULL,MAKEINTRESOURCE(1),NULL,WndProc,0);
>> > > > > ExitProcess(0);
>> > > > > return 0;
>>
>> > Hi,
>>
>> > The following weblink should give you more pointers:
>>
>> >http://msdn.microsoft.com/en-us/library/bb760252(VS.85).aspx
>>
>> > Kellie.
>
date: Thu, 9 Oct 2008 23:00:23 -0500   author:   Frank Cheng

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us