Balloon tooltips

This is a discussion on Balloon tooltips within the Windows Programming forums, part of the Platform Specific Boards category; Can anyone show me an easy example using ballon tooltips? I've checked Balloon tooltips but it is not very clear ...

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    35

    Balloon tooltips

    Can anyone show me an easy example using ballon tooltips? I've checked Balloon tooltips but it is not very clear to me. For example, how can I put a message "Click here" into the balloon and how can I detect user has clicked? And how can I make the message to be underlined when user passes over it with the mouse?

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    329
    Code:
    #if _WIN32_IE>=0x502
    int TrayBalloon(HWND wnd1, long lTimeOut, int iInfoFlags, char *achTitle, char *achTip){
    	Nid.cbSize = sizeof(NOTIFYICONDATA);
      Nid.uFlags = NIF_INFO;
    	Nid.uTimeout = lTimeOut;
    	Nid.uVersion = NOTIFYICON_VERSION;
      Nid.dwInfoFlags = iInfoFlags;
    	if(strlen(achTip)>255)
    		achTip[255]=0;
      strcpy(Nid.szInfo,achTip);
    	if(strlen(achTitle)>63)
    		achTitle[63]=0;
      strcpy(Nid.szInfoTitle,achTitle);
    
      return(Shell_NotifyIcon(NIM_MODIFY, &Nid));
    }
    #endif

  3. #3
    Registered User
    Join Date
    Jul 2004
    Posts
    35
    Thanks for your answer.

    The code from your example is more or less quite clear.

    With this code you can create a ballooon tooltip. But, which gui element is this balloon tooltip attached to? The window referred by the hwnd variable? Suppose the hwnd variable is referring to a dialog box, when is the balloon tooltip is going to show? When the user passes over any element (button, list, etc.) contained in the dialog box?

    The other thing that I can't see is how the application is notified when the user clicks on the balloon tooltip. Which message is received by the window procedure, or the dialog procedure so that I can detect the user has clicked on the balloon tooltip? I mean, when you use a button in a dialog box you can process button clicks by something like this:
    Code:
    BOOL CALLBACK DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
    {
      switch(uMsg) {
        case WM_COMMAND:
        {
          switch(LOWORD(wParam)) {
            case BUTTON2_ID:
            {
              /* user has clicked button 2 */
              ...
              break;
            }
          }
          break;
        }
        ...
        default: return FALSE;
      }
      return TRUE;
    }
    Well, which is the equivalent code that detects and processes balloon tooltip clicks?

  4. #4
    Registered User
    Join Date
    Feb 2002
    Posts
    329

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cannot for the life of me get win32 tooltips working
    By Sfpiano in forum Windows Programming
    Replies: 7
    Last Post: 09-26-2008, 11:46 PM
  2. Toolbar Tooltips not displaying
    By JaWiB in forum Windows Programming
    Replies: 2
    Last Post: 11-04-2005, 10:49 PM
  3. Displaying a balloon tip on sys trap app at startup
    By BobS0327 in forum Windows Programming
    Replies: 0
    Last Post: 03-25-2005, 07:35 PM
  4. Balloon tip an headers
    By knutso in forum Windows Programming
    Replies: 0
    Last Post: 09-23-2003, 04:03 AM
  5. I need help on adding tooltips to controls
    By Templario in forum Windows Programming
    Replies: 6
    Last Post: 01-03-2003, 02:47 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21