谁给个显示Balloon Tip的例子? Tray的或者窗口上的都行,谢谢了,我按照MSDN里面的例子搞不定:( 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://www.csdn.net/develop/article/20/20821.shtm 是自己画一个HITWINDOW吗?从THINTWINDOW派生了画成什么都可以。 这个是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;为什么不行呢? [散分测试]研究RealICQ源代码完成并成功编译出成品 为什么会出现“Stack overflow”的错误提示? 上传文件报错,急!!! 如何实现让用户来调整delphi中报表内容的位置 DOM和TXmlDocument,请大家帮忙 给一段简单画不规则按钮的代码..谢谢 高分求delphi 8.0的下载地址.不要试用版. 有谁知道哪儿有DELPHI4的下载? 请帮忙解释一下禁止用户窗口移动代码 各位在北京工作的大哥,拉小弟一把! 怎样将两个数组连接起来? $$$$讨论热门流行最吃香月薪高的编成语言$$$$
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;
为什么不行呢?