CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2005
    Posts
    13

    error creating balloon tip for tray icon

    Hi all,
    I'm having a problem in creating a balloon tip for tray icon.
    I found a code from "msdn" , which is

    #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))

    NOTIFYICONDATA IconData = {0};

    IconData.cbSize = SIZEOF(IconData);
    IconData.hWnd = hwndNI;
    IconData.uFlags = NIF_INFO;

    HRESULT hr = StringCchCopy(IconData.szInfo, ARRAYSIZE(IconData.szInfo), TEXT("Your message text goes here."));
    if(FAILED(hr))
    {
    // TODO: Write an error handler in case the call to StringCchCopy fails.
    }
    IconData.uTimeout = 15000; // in milliseconds

    Shell_NotifyIcon(NIM_MODIFY, &IconData);

    but here in my application i.e. in win32, i'm not having either the NIF_INFO, nor IconData.szInfo, similarly timeout.

    So please reply me what should I do to implement it.

    Regards,
    Gaurav

  2. #2
    Join Date
    Dec 2003
    Posts
    45

    Re: error creating balloon tip for tray icon

    Please add "#define _WIN32_IE 0x0500" in your header file

  3. #3
    Join Date
    May 2004
    Location
    Michigan, United States
    Posts
    457

    Re: error creating balloon tip for tray icon

    Yes, as Wang suggested, you need to define your version BEFORE you include windows.h. Also, depending on what version of VC++ you're using, you may need to download the Platform SDK from Microsoft's website.

    msdn.microsoft.com/platformsdk/
    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured