Tray的或者窗口上的都行,谢谢了,我按照MSDN里面的例子搞不定:(

解决方案 »

  1.   

    http://www.csdn.net/develop/article/20/20821.shtm
      

  2.   

    是自己画一个HITWINDOW吗?从THINTWINDOW派生了画成什么都可以。
      

  3.   

    这个是MSDN里面给的例子:
    hwndToolTips = CreateWindow(TOOLTIPS_CLASS,
                                NULL,
                                WS_POPUP | TTS_NOPREFIX | TTS_BALLOON,
                                0, 0,
                                0, 0,
                                NULL, NULL,
                                g_hinst,
                                NULL);
    if (hwndTooltip)
    {
    // Do the standard ToolTip coding. 
        TOOLINFO ti;    ti.cbSize = sizeof(ti);
        ti.uFlags = TTF_TRANSPARENT | TTF_CENTERTIP;
        ti.hwnd = hwnd;
        ti.uId = 0;
        ti.hinst = NULL;
        ti.lpszText = LPSTR_TEXTCALLBACK;    GetClientRect(hwnd, &ti.rect);
        SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti );
    }这个是我翻译的Delphi代码:
    type
      TToolInfo = record
        cbSize: Integer;
        uFlags: Integer;
        hwnd: THandle;
        uId: Integer;
        rect: TRect;
        hinst: LongWord;
        lpszText: PChar;
        lParam: Integer;
      end;procedure TForm1.Button2Click(Sender: TObject);
    const
      TOOLTIPS_CLASS = 'tooltips_class32';
      TTS_NOPREFIX: Cardinal = 2;
      TTS_BALLOON: Cardinal = $40;
      TTF_TRANSPARENT: Cardinal = $100;
      TTF_CENTERTIP: Cardinal = $2;
      LPSTR_TEXTCALLBACK = LPSTR(-1);
      TTM_ADDTOOL = WM_USER + 4;
    var
      hwndToolTips: THandle;
      ti: TToolInfo;
    begin
      hwndToolTips:= CreateWindow(TOOLTIPS_CLASS,
                                  nil,
                                  WS_POPUP or TTS_NOPREFIX or TTS_BALLOON,
                                  0, 0,
                                  0, 0,
                                  0, 0,
                                  hInstance,
                                  nil);
      if (hwndTooltips<>0) then
      begin
      // Do the standard ToolTip coding.    ti.cbSize := sizeof(ti);
        ti.uFlags := TTF_TRANSPARENT or TTF_CENTERTIP;
        ti.hwnd := Handle;
        ti.uId := 0;
        ti.hinst := 0;
        ti.lpszText := LPSTR_TEXTCALLBACK;    Windows.GetClientRect(Handle, ti.rect);
        SendMessage(hwndToolTips, TTM_ADDTOOL, 0, Cardinal(@ti) );
      end;
    end;
    为什么不行呢?