Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

General Info Tip

Posted on 2001-07-13
5
Medium Priority
?
209 Views
Last Modified: 2008-02-01
Does anyone know how to create the ballon style tooltips that appear when you receive the Windows 2000 Critical Notification or the Start Button the first time you use a 2000 installation?

It must work on any control type.

Thanks in advance
0
Comment
Question by:Allann
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6280220
You cannot link to the installed Windows system other window styles, only other window resources ...

However, when you only want to create a ballon tooltip,
then you must create a top level window in the win32 sdk
subsystem and restrict the WindowRgn to a ballon polygon
or someone else.
Therefore you must create the toplevel window without any
border or system menues and create and destroy the window
by hand or at the responce of mouse events.

When you need help to create a toplevel window via
vb and restrict the windowrgn to a ballon  .. say it

Bye
WoK
0
 
LVL 2

Author Comment

by:Allann
ID: 6289347
do you have an example of your explanation?
0
 
LVL 4

Accepted Solution

by:
WolfgangKoenig earned 400 total points
ID: 6290591
Ok, here the little tricky code:

Form1.frm:
-----------------------------------------------------------

VERSION 5.00
Begin VB.Form Form1
   BackColor       =   &H80000018&
   BorderStyle     =   0  'Kein
   Caption         =   "Form1"
   ClientHeight    =   2445
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   2445
   ScaleWidth      =   4680
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows-Standard
   Begin VB.Label TextToolTip
      BackColor       =   &H80000018&
      BackStyle       =   0  'Transparent
      Caption         =   "Text"
      Height          =   2175
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   4335
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Declare Function CreateEllipticRgn Lib "gdi32" _
 (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, _
 ByVal Y2 As Long) As Long

Private Declare Function CreatePolygonRgn Lib "gdi32" _
 (ByRef P1 As Any, ByVal NumP As Long, ByVal Mode As Long) As Long


Private Declare Function SetWindowRgn Lib "user32" _
 (ByVal hWnd As Long, ByVal hRgn As Long, _
 ByVal bRedraw As Boolean) As Long

Private Sub Form_Load()
Dim Ttpsize As Integer
Dim Brdsize As Integer
Dim DipScale As Integer
Dim Rngsize As Long

TextToolTip.Caption = Tooltiptext
DipScale = TextWidth(" ")
Ttpsize = TextWidth(TextToolTip.Caption & " ")
TextToolTip.Width = Ttpsize

Brdsize = DipScale * 1

Me.Width = TextToolTip.Width + Brdsize * 2
Me.Height = (TextToolTip.Width + Brdsize * 2) * Bubblefac

TextToolTip.Left = Brdsize
TextToolTip.Top = Brdsize * 30 * Bubblefac
Show

Rngsize = (Ttpsize + Brdsize * 2) / DipScale * (DipScale / Screen.TwipsPerPixelX)

SetWindowRgn hWnd, CreateEllipticRgn(0, 0, Rngsize, 200 * Bubblefac), True
'Call amazingborder
End Sub

Sub amazingborder()
Dim MYREC() As PUNKT
ReDim MYREC(4)
Show
MYREC(0).X = 20
MYREC(0).Y = 20
MYREC(1).X = 100
MYREC(1).Y = 0
MYREC(2).X = 200
MYREC(2).Y = 40
MYREC(3).X = 200
MYREC(3).Y = 80
MYREC(4).X = 20
MYREC(4).Y = 70

SetWindowRgn hWnd, CreatePolygonRgn(MYREC(0), 5, 2), True
End Sub

-----------------------------------------------------------


Module1.bas:
-----------------------------------------------------------


Attribute VB_Name = "Module1"
Public Tooltiptext As String
Public Bubblefac As Single

Type PUNKT
   X As Long
   Y As Long
End Type

Sub main()
Tooltiptext = "This is a little message that appears in a elipse!"
Bubblefac = 0.5
Form1.Show
Form1.Left = 150 * Screen.TwipsPerPixelX
Form1.Top = 150 * Screen.TwipsPerPixelY
End Sub

-----------------------------------------------------------


Attention:
Set the Startup to "Sub Main" ....

When you start the program an elliptic bubble will appears
at the window screen position 150/150.

The example works only for one line of bubble text ...
You can set the text in the main procedure ...
You can set also the bubble factor:
1 means circle
0.5 means elliptic (width)
1.5 means elliptic (height)

Have fun the code was a little hard to code

WoK










0
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6290597
The amazingborder routine can used such as the function
SetWindowRgn hWnd, CreateEllipticRgn(0, 0, Rngsize, 200 * Bubblefac), True

but you must adjust the correct setting for the numbers
Lots of fun
WoK
0
 
LVL 2

Author Comment

by:Allann
ID: 6293081
Thanks dude...  helped a lot...

btw, i found this the other night which combined with your answer has netted me with a great little tooltip balloon.

http://www.vbthunder.com/software/ExCooltips/index.html
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question