 |
|
 |
This is really what I need, and I learned very much. Thank you for your sharing!
|
|
|
|
 |
|
 |
How Can I make This TTS_BALLON work on other window platforms also as it does not work on windows NT and some other.....
|
|
|
|
 |
|
 |
Win9x and NT don't have balloons I think. CBalloonHelp from codeproject implements it though.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
 |
|
 |
I do not get the use of:
// NO ALT+ key
if (pMsg->message == WM_SYSCOMMAND)
{
return TRUE;
}
It would inhibit some useful events, like an aboutbox for instance.
cheers, g->
|
|
|
|
 |
|
 |
hi.. umm well this will only work on Window 2k and Window ME, correct me if i'm wrong
What are you gonna learn today?
|
|
|
|
 |
|
 |
Well it worked well on my machine - WinXP SP2.
I think the concept in generally has worked well in my application though my effort involved getting balloon tooltips on toolbuttons of a toolbar that is a Flyout toolbar. It works perfect.
After reading MSDN documentation a bit on CToolTipCtrl - imagine that somehow you got the CToolTipCtrl object. Now all you need to do is -
const int TTS_BALLOON = 0x40;
m_flyout->GetToolBarCtrl().GetToolTips()->ModifyStyle(0, TTS_BALLOON);
|
|
|
|
 |
|
 |
d34c0n wrote: correct me if i'm wrong
Works just fine on WinNT 4.0 SP6a IE 5.5
and
Win2000, XP etc...
|
|
|
|
 |
|
 |
I saw some program has a tray icon with a balloon tool tip on it, and when you click the close button, the tool tip will dispear, but when you click in the tool tip not the close button, the tool tip also dispear as well as the main dialog window of the program was opened.
I don't know how to process the click event in the tool tip. do you know some thing about this?
|
|
|
|
 |
|
 |
How can i use a balloon tooltip with an editbox ? For example when a user types in a wrong password to display a balloon tooltip showin` the error message (after he pressed enter of course)
|
|
|
|
 |
|
 |
This is a function I wrote to create ToolTips sometime back, it is written in PowerBASIC, but should be easy to follow and use: <pre>Type DLLVERSIONINFO ' For ToolTips cbSize As Dword dwMajorVersion As Dword ' Major version dwMinorVersion As Dword ' Minor version dwBuildNumber As Dword ' Build number dwPlatformID As Dword ' %DLLVER_PLATFORM_* End Type Declare Function TTver(DLLver As DLLVERSIONINFO) As Long ' For ToolTip Function ToolTipSet(ByVal hWnd As Dword, ByVal hCtrl As Dword, ByVal sText As String, Optional ByVal BalloonStyle As Dword, Optional ByVal Title As Asciiz * 100, Optional ByVal IconPic As Dword) As Long Static hWnd_PreXPToolTip As Dword Static hWnd_XPToolTip As Dword Static TTversion As DLLVERSIONINFO Local hWnd_ToolTip As Dword Local TI As TOOLINFO Local hDLL As Dword Local hVerProc As Dword Local returnVal As Long ' Icons= 1 for Info, 2 for Warning, 3 for Error, SP2 can also be HICON handle...but docs are weird saying you have to clean up the copy it makes??? ' Title and IconPic are global to the ToolWindow, so only need set on first call to a Balloon Type. IF BalloonStyle THEN IF IsWindow(hWnd_XPToolTip)= 0 THEN ' If no XP Tooltip Window. IF TTversion.CbSize= 0 THEN ' If haven't checked Version already. TTversion.CbSize= SIZEOF(TTversion) hDLL= GetModuleHandle("COMCTL32.DLL") IF hDLL THEN hVerProc= GetProcAddress(hDLL, "DllGetVersion") IF hVerProc THEN CALL DWORD hVerProc USING TTver(TTversion) TO returnVal END IF End If IF TTversion.dwMajorVersion > 5 OR (TTversion.dwMajorVersion= 5 AND TTversion.dwMinorVersion >= 80) THEN ' XP Version Available. hWnd_XPToolTip= CreateWindowEx(0, "tooltips_class32", "", %TTS_BALLOON OR %TTS_NOPREFIX OR %TTS_ALWAYSTIP, 0,0,0,0,0, BYVAL 0, GetModuleHandle(BYVAL %Null), BYVAL 0) IF IsWindow(hWnd_XPToolTip) THEN SendMessage(hWnd_XPToolTip, %TTM_SETMAXTIPWIDTH, 0, 300) If (TTversion.dwMajorVersion = 5) And IconPic > 3 Then IconPic= 1 ' If hIcon given and PreXP SP2 then make it Info Icon SendMessage(hWnd_XPToolTip, %TTM_SETTITLE, IconPic, BYVAL VARPTR(Title)) END IF END IF END IF hWnd_ToolTip= hWnd_XPToolTip END IF IF IsWindow(hWnd_ToolTip)= 0 THEN ' No Selected Tooltip Window yet or error making Ballon/XP Style Tooltip. IF IsWindow(hWnd_PreXPToolTip)= 0 THEN ' If no PreXP Tooltip Window. hWnd_PreXPToolTip= CreateWindowEx(0, "tooltips_class32", "", %TTS_NOPREFIX OR %TTS_ALWAYSTIP, 0,0,0,0,0, BYVAL 0, GetModuleHandle(BYVAL %Null), BYVAL 0) IF IsWindow(hWnd_PreXPToolTip) THEN SendMessage(hWnd_PreXPToolTip, %TTM_SETMAXTIPWIDTH, 0, 300) END IF hWnd_ToolTip= hWnd_PreXPToolTip END IF IF IsWindow(hWnd_ToolTip)= 0 THEN EXIT FUNCTION TI.cbSize= SIZEOF(TI) TI.hWnd= hWnd IF hCtrl= 0 THEN TI.uId= hWnd ELSE TI.uId = hCtrl ' If 0 set to Window else set to Control. hCtrl is Handle, not ID of control. FUNCTION= SendMessage(hWnd_ToolTip, %TTM_DELTOOL, 0, BYVAL VARPTR(TI)) IF LEN(sText) > 0 THEN TI.uFlags= %TTF_SUBCLASS OR %TTF_IDISHWND TI.lpszText= STRPTR(sText) FUNCTION= SendMessage(hWnd_ToolTip, %TTM_ADDTOOL, 0, BYVAL VARPTR(TI)) END IF End Function</pre>
|
|
|
|
 |
|
 |
Well I develop with C++/Qt for multiplateforme in Visual Studio .Net and I would like to make it for my application
in windows, thats perfect (although it's not ansi C++) ; but for linux and others ...
I'm looking for on the net
if you have a link or something else
Thanks for all
David
|
|
|
|
 |
|
 |
Hi!
What i wanted to implement is to handling WM_LBUTTONDOWN from the balloon.
I've inherited form CToolTipCtrl and implemented handlers for some events
like WM_LBUTTONDOWN, WM_MOUSEMOVE ....
but without a success.
How could i get that event for handling?
this is critical for my project ...
Thanks.
|
|
|
|
 |
|
 |
Hello,
Does anyone know if it is possible to put my own icon in the balloon tooltip, instead of using standard icons? If it is possible - what is the way?\
Thanks in advance.
|
|
|
|
 |
|
 |
Yes, with SP2 of XP you can give it an icon handle instead of the 1-3 values for the icon.
|
|
|
|
 |
|
 |
Could you give me more detail on this point? Thank you!
Life is hard.
|
|
|
|
 |
|
 |
Set dwInfoFlags to NIIF_USER and hIcon to the icon you want to show in the tooltip.
Note that this works for WindowsXP SP2 or higher ONLY!
|
|
|
|
 |
|
 |
Hi, first of all nice work. Second, i'm kinf of new to MFC, so i'm having trouble doing this:
I'm using PreTranslateMessage like you do to handle WM_MOUSEMOVE to show hr BaloonTip in CStatic, but i want to handle the message in the parent (CDialog) too (for example to show a different cursor as the mouse hovers over the CStatic). Also i want to handle the WM_BUTTONDOWN & WM_BUTTONUP!
How can i do that?
Thanks in advance!
Antonio Dias
|
|
|
|
 |
|
 |
When i click Command Button i need a balloon to appear, how can i do this, while keeping the tray icon??
Thanks
|
|
|
|
 |
|
 |
I've tried your simple code in a my program anda when it pops a balloon it stays there forever and ever. Even if a click on them, he closes and then pops again with the same message...
Am I missing something?
|
|
|
|
 |
|
 |
I'v tried your sample code on XP.
I can see task tray's ballon has a close button.
But controll's ballon has no one.
A shapshot on this page shows ballons with no close button. Why?
---
Hiroki
|
|
|
|
 |
|
 |
I developed this short example on Win2000 and this is why you don’t see in the picture a “close” button on the balloon associated with the tray. In XP is a different story.
On the other hand the balloon tool tip associated with a control in this example is just a regular CToolTipCtrl MFC object adjusted with a common cartoon "balloon" appearance (TTS_BALLOON), nothing more.
Thank you,
Liviu
|
|
|
|
 |
|
 |
What about XP?
I dont get close button on XP inspite of TTS_CLOSE being there.
|
|
|
|
 |
|
 |
I did a little poking around with Spy, and you can get a close button on control tooltips by adding 0x00000080 to the dwStyle when creating the window. For example:
HWND hwndToolTip = CreateWindow(TOOLTIPS_CLASS, TEXT(""),
WS_POPUP | TTS_NOPREFIX | TTS_BALLOON | 0x00000080,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, ghInstance, NULL);
And for the betterment of the world, I'll share something else that I had a heck of a time finding info on...
If you use the TTF_PARSELINKS flag on the TOOLINFO uFlags parameter passed into to TTM_ADDTOOL, you can make a section of text appear underlined by enclosing it in tags. When the user clicks on it, you should get a TTN_LINKCLICK notification message.
Hopefully this info will save somebody else a few hours.
Enjoy!
- Steve
|
|
|
|
 |
|
 |
Can you explain what tags you used and maybe give a sample
-- you can make a section of text appear underlined by enclosing it in tags
|
|
|
|
 |
|
 |
Sorry, that would be useful!
You just enclose the text with an empty A tag, like an HTML anchor. I.e., the text:
You can click <A>here</A> to open the wizard.
would appear with the "here" underlined.
- Steve
|
|
|
|
 |