-
Notifications
You must be signed in to change notification settings - Fork 32
/
Tooltips.cls
1490 lines (1266 loc) · 49.3 KB
/
Tooltips.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "class_Tooltips"
Attribute VB_GlobalNameSpace = True
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Option Explicit
#Const WIN32_IE = &H400
Private hWndTT As Long
Private m_Enabled As Boolean
Private m_Icon As InfoTitleConstants
Private m_Title As String
Public Enum DelayTimeConstants
dtAutoPop = &H2
dtInitial = &H3
dtReshow = &H1
End Enum
Public Enum SetDelayTimeConstants
sdtAutoPop = &H2
sdtInitial = &H3
sdtReshow = &H1
sdtAutomatic = &H0
End Enum
Public Enum InfoTitleConstants
itNoIcon = 0
itInfoIcon = 1
itWarningIcon = 2
itErrorIcon = 3
End Enum
Private Type RECT
left As Long
top As Long
right As Long
bottom As Long
End Type
Private Type TOOLINFO
cbSize As Long
uFlags As Long
hWnd As Long
uId As Long
WinRect As RECT
hinst As Long
lpszText As String
#If WIN32_IE >= &H300 Then
lParam As Long
#End If
End Type
Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
Private Const WS_EX_TOPMOST = &H8&
Private Const TOOLTIPS_CLASS = "tooltips_class32"
Private Const WS_POPUP = &H80000000
Private Const CW_USEDEFAULT = &H80000000
Private Declare Function InitCommonControlsEx Lib "comctl32" (lpInitCtrls As INITCOMMONCONTROLEXSTRUCT) As Long
Private Const ICC_WIN95_CLASSES = &HFF
Private Const ICC_BAR_CLASSES = &H4
Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const HWND_TOPMOST = -1
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOACTIVATE = &H10
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_USER = &H400
#If Not UNICODE Then
Private Const TTM_ADDTOOL = WM_USER + 4
Private Const TTM_DELTOOL = WM_USER + 5
Private Const TTM_ENUMTOOLS = WM_USER + 14
Private Const TTM_HITTEST = WM_USER + 10
Private Const TTM_NEWTOOLRECT = WM_USER + 6
Private Const TTM_SETTITLE = WM_USER + 32
Private Const TTM_UPDATETIPTEXT = WM_USER + 12
#Else
Private Const TTM_ADDTOOL = WM_USER + 50
Private Const TTM_DELTOOL = WM_USER + 51
Private Const TTM_ENUMTOOLS = WM_USER + 58
Private Const TTM_HITTEST = WM_USER + 55
Private Const TTM_NEWTOOLRECT = WM_USER + 52
Private Const TTM_SETTITLE = WM_USER + 33
Private Const TTM_UPDATETIPTEXT = WM_USER + 57
#End If
Private Const TTM_ACTIVATE = WM_USER + 1
Private Const TTM_ADJUSTRECT = WM_USER + 31
Private Const TTM_GETTOOLCOUNT = WM_USER + 13
Private Const TTM_GETBUBBLESIZE = WM_USER + 30
Private Const TTM_GETDELAYTIME = WM_USER + 21
Private Const TTM_GETMARGIN = WM_USER + 27
Private Const TTM_GETMAXTIPWIDTH = WM_USER + 25
Private Const TTM_GETTIPBKCOLOR = WM_USER + 22
Private Const TTM_GETTIPTEXTCOLOR = WM_USER + 23
Private Const TTM_POP = WM_USER + 28
Private Const TTM_SETDELAYTIME = WM_USER + 3
Private Const TTM_SETMARGIN = WM_USER + 26
Private Const TTM_SETMAXTIPWIDTH = WM_USER + 24
Private Const TTM_SETTIPBKCOLOR = WM_USER + 19
Private Const TTM_SETTIPTEXTCOLOR = WM_USER + 20
Private Const TTM_TRACKACTIVATE = WM_USER + 17
Private Const TTM_TRACKPOSITION = WM_USER + 18
Private Declare Function DestroyWindow Lib "user32" (ByVal hWnd As Long) As Long
Private Const TTF_IDISHWND = &H1
Private Const TTF_SUBCLASS = &H10
Private Type Size
cx As Long
cy As Long
End Type
Private Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (ByVal hdc As Long, ByVal lpString As String, ByVal cbString As Long, lpSize As Size) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Public Enum TooltipFlagConstants
ttfAlwaysTip = &H1
ttfNoPrefix = &H2
ttfNoAnimate = &H10
ttfNoFade = &H20
ttfBalloon = &H40
End Enum
Public Enum ToolFlagConstants
tfCenterTip = &H2
tfRtlReading = &H4
tfTrack = &H20
tfAbsolute = &H80
tfTransparent = &H100
End Enum
Private Type INITCOMMONCONTROLEXSTRUCT
dwSize As Long
dwICC As Long
End Type
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type TTHITTESTINFO
hWnd As Long
pt As POINTAPI
ti As TOOLINFO
End Type
Private Type OLECOLOR
RedOrSys As Byte
Green As Byte
Blue As Byte
Type As Byte
End Type
Private Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
Public Sub AddTool(Ctl As Control, Flags As ToolFlagConstants, Optional Text As String)
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : AddTool
' * Parameters :
' * Ctl As Control
' * Flags As ToolFlagConstants
' * Optional Text As String
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim Info As TOOLINFO
On Error Resume Next
If hWndTT = 0 Then Exit Sub
Info.cbSize = Len(Info)
Info.uFlags = Flags
If Not (Flags And tfTrack) Then
Info.uFlags = Info.uFlags Or TTF_SUBCLASS
End If
Info.uFlags = Info.uFlags Or TTF_IDISHWND
Info.hWnd = Ctl.Container.hWnd
Info.hinst = App.hInstance
Info.uId = Ctl.hWnd
If Len(Text) > 0 Then
Info.lpszText = Text
End If
SendMessage hWndTT, TTM_ADDTOOL, 0, Info
End Sub
Public Sub Create(frm As Form, Flags As TooltipFlagConstants)
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : Create
' * Parameters :
' * Frm As Form
' * Flags As TooltipFlagConstants
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim InitCtrls As INITCOMMONCONTROLEXSTRUCT
InitCtrls.dwSize = Len(InitCtrls)
InitCtrls.dwICC = ICC_WIN95_CLASSES Or ICC_BAR_CLASSES
Class_Terminate
m_Enabled = True
m_Icon = itNoIcon
m_Title = ""
InitCommonControlsEx InitCtrls
hWndTT = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, "", _
WS_POPUP Or Flags, CW_USEDEFAULT, CW_USEDEFAULT, _
CW_USEDEFAULT, CW_USEDEFAULT, frm.hWnd, 0, App.hInstance, _
ByVal 0&)
SetWindowPos hWndTT, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or _
SWP_NOSIZE Or SWP_NOACTIVATE
End Sub
Public Sub CreateHwnd(nHwnd As Long, Flags As TooltipFlagConstants)
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : CreateHnwd
' * Parameters :
' * nHwnd As Long
' * Flags As TooltipFlagConstants
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim InitCtrls As INITCOMMONCONTROLEXSTRUCT
InitCtrls.dwSize = Len(InitCtrls)
InitCtrls.dwICC = ICC_WIN95_CLASSES Or ICC_BAR_CLASSES
Class_Terminate
m_Enabled = True
m_Icon = itNoIcon
m_Title = ""
InitCommonControlsEx InitCtrls
hWndTT = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, "", _
WS_POPUP Or Flags, CW_USEDEFAULT, CW_USEDEFAULT, _
CW_USEDEFAULT, CW_USEDEFAULT, nHwnd, 0, App.hInstance, _
ByVal 0&)
SetWindowPos hWndTT, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or _
SWP_NOSIZE Or SWP_NOACTIVATE
End Sub
Public Sub AddToolHwnd(Ctl As Control, nHwndParent As Long, Flags As ToolFlagConstants, Optional Text As String)
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : AddToolHwnd
' * Parameters :
' * Ctl As Control
' * nHwndParent As Long
' * Flags As ToolFlagConstants
' * Optional Text As String
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim Info As TOOLINFO
If hWndTT = 0 Then Exit Sub
Info.cbSize = Len(Info)
Info.uFlags = Flags
If Not (Flags And tfTrack) Then
Info.uFlags = Info.uFlags Or TTF_SUBCLASS
End If
Info.uFlags = Info.uFlags Or TTF_IDISHWND
Info.hWnd = nHwndParent
Info.hinst = App.hInstance
Info.uId = Ctl.hWnd
If Len(Text) > 0 Then
Info.lpszText = Text
End If
SendMessage hWndTT, TTM_ADDTOOL, 0, Info
End Sub
Public Sub DeleteTool(Ctl As Control)
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : DeleteTool
' * Parameters :
' * Ctl As Control
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim Info As TOOLINFO
If hWndTT = 0 Then Exit Sub
Info = GetToolInfo(Ctl.hWnd)
If Info.cbSize <> 0 Then
SendMessage hWndTT, TTM_DELTOOL, 0, Info
End If
End Sub
Public Property Get Enabled() As Boolean
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : Enabled
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
If hWndTT = 0 Then Exit Property
Enabled = m_Enabled
End Property
Public Property Let Enabled(NewState As Boolean)
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : Enabled
' * Parameters :
' * NewState As Boolean
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
m_Enabled = NewState
If hWndTT = 0 Then Exit Property
SendMessage hWndTT, TTM_ACTIVATE, m_Enabled, ByVal 0&
End Property
Public Function GetDelayTime(TimeMode As DelayTimeConstants) As Long
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : GetDelayTime
' * Parameters :
' * TimeMode As DelayTimeConstants
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
If hWndTT = 0 Then Exit Function
GetDelayTime = SendMessage(hWndTT, TTM_GETDELAYTIME, TimeMode, _
0&)
End Function
Public Property Get Icon() As InfoTitleConstants
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : Icon
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
If hWndTT = 0 Then Exit Property
Icon = m_Icon
End Property
Public Function MakeLong(Int1 As Integer, Int2 As Integer) As Long
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : MakeLong
' * Parameters :
' * Int1 As Integer
' * Int2 As Integer
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim Ints(1 To 2) As Integer
CopyMemory Ints(1), Int1, Len(Int1)
CopyMemory Ints(2), Int2, Len(Int2)
CopyMemory MakeLong, Ints(1), Len(MakeLong)
End Function
Public Sub SetTracking(Ctl As Control, Tracking As Boolean)
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : SetTracking
' * Parameters :
' * Ctl As Control
' * Tracking As Boolean
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim Info As TOOLINFO
If hWndTT = 0 Then Exit Sub
Info = GetToolInfo(Ctl.hWnd)
If Info.cbSize <> 0 Then
SendMessage hWndTT, TTM_TRACKACTIVATE, Tracking, Info
End If
End Sub
Public Sub SetTrackPosition(Ctl As Control, x As Integer, y As Integer)
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : SetTrackPosition
' * Parameters :
' * Ctl As Control
' * X As Integer
' * Y As Integer
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim Info As TOOLINFO
If hWndTT = 0 Then Exit Sub
Info = GetToolInfo(Ctl.hWnd)
If Info.cbSize <> 0 Then
SendMessage hWndTT, TTM_TRACKPOSITION, 0, _
ByVal MakeLong(x, y)
End If
End Sub
Public Property Get Title() As String
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : Title
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
If hWndTT = 0 Then Exit Property
Title = m_Title
End Property
Public Property Let Icon(NewIcon As InfoTitleConstants)
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : Icon
' * Parameters :
' * NewIcon As InfoTitleConstants
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
If hWndTT = 0 Then Exit Property
m_Icon = NewIcon
SendMessage hWndTT, TTM_SETTITLE, m_Icon, ByVal Title
End Property
Public Property Let Title(newTitle As String)
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : Title
' * Parameters :
' * NewTitle As String
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
If hWndTT = 0 Then Exit Property
m_Title = newTitle
SendMessage hWndTT, TTM_SETTITLE, Icon, ByVal m_Title
End Property
Public Sub SetDelayTime(TimeMode As SetDelayTimeConstants, time As Long)
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : SetDelayTime
' * Parameters :
' * TimeMode As SetDelayTimeConstants
' * Time As Long
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
If hWndTT = 0 Then Exit Sub
SendMessage hWndTT, TTM_SETDELAYTIME, TimeMode, ByVal time
End Sub
Public Sub HideTips()
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : HideTips
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
If hWndTT = 0 Then Exit Sub
SendMessage hWndTT, TTM_POP, 0, ByVal 0&
End Sub
Public Function HitTest(Ctl As Control, x As Long, y As Long) As Boolean
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : HitTest
' * Parameters :
' * Ctl As Control
' * X As Long
' * Y As Long
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim Info As TTHITTESTINFO
If hWndTT = 0 Then Exit Function
With Info
.hWnd = Ctl.hWnd
.pt.x = x
.pt.y = y
.ti.cbSize = Len(.ti)
End With
HitTest = (SendMessage(Ctl.hWnd, TTM_HITTEST, 0, Info) <> 0)
End Function
Public Property Get MarginLeft() As Long
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : MarginLeft
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim rct As RECT
If hWndTT = 0 Then Exit Property
SendMessage hWndTT, TTM_GETMARGIN, 0, rct
MarginLeft = rct.left
End Property
Public Property Let MarginLeft(NewMargin As Long)
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : MarginLeft
' * Parameters :
' * NewMargin As Long
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim rct As RECT
If hWndTT = 0 Then Exit Property
With rct
.left = NewMargin
.top = MarginTop
.right = MarginRight
.bottom = MarginBottom
End With
SendMessage hWndTT, TTM_SETMARGIN, 0, rct
End Property
Public Property Let MarginTop(NewMargin As Long)
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : MarginTop
' * Parameters :
' * NewMargin As Long
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim rct As RECT
If hWndTT = 0 Then Exit Property
With rct
.left = MarginLeft
.top = NewMargin
.right = MarginRight
.bottom = MarginBottom
End With
SendMessage hWndTT, TTM_SETMARGIN, 0, rct
End Property
Public Property Let MarginRight(NewMargin As Long)
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : MarginRight
' * Parameters :
' * NewMargin As Long
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim rct As RECT
If hWndTT = 0 Then Exit Property
With rct
.left = MarginLeft
.top = MarginTop
.right = NewMargin
.bottom = MarginBottom
End With
SendMessage hWndTT, TTM_SETMARGIN, 0, rct
End Property
Public Property Let MarginBottom(NewMargin As Long)
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : MarginBottom
' * Parameters :
' * NewMargin As Long
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim rct As RECT
If hWndTT = 0 Then Exit Property
With rct
.left = MarginLeft
.top = MarginTop
.right = MarginRight
.bottom = NewMargin
End With
SendMessage hWndTT, TTM_SETMARGIN, 0, rct
End Property
Public Property Get MarginTop() As Long
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : MarginTop
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim rct As RECT
If hWndTT = 0 Then Exit Property
SendMessage hWndTT, TTM_GETMARGIN, 0, rct
MarginTop = rct.top
End Property
Public Property Get MarginRight() As Long
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : MarginRight
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim rct As RECT
If hWndTT = 0 Then Exit Property
SendMessage hWndTT, TTM_GETMARGIN, 0, rct
MarginRight = rct.right
End Property
Public Property Get MarginBottom() As Long
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : MarginBottom
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim rct As RECT
If hWndTT = 0 Then Exit Property
SendMessage hWndTT, TTM_GETMARGIN, 0, rct
MarginBottom = rct.bottom
End Property
Public Function GetShellVersion() As Long
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : GetShellVersion
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
End Function
Private Function GetToolInfo(ToolWnd As Long) As TOOLINFO
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips
' * Module Filename : cTooltips.cls
' * Procedure Name : GetToolInfo
' * Parameters :
' * ToolWnd As Long
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim n As Long, Info As TOOLINFO, Found As Boolean
If hWndTT = 0 Then Exit Function
Info.cbSize = Len(Info)
For n = 0 To ToolCount - 1
If SendMessage(hWndTT, TTM_ENUMTOOLS, n, Info) <> 0 Then
If Info.uId = ToolWnd Then
Found = True
Exit For
End If
End If
Next n
If Found Then GetToolInfo = Info
End Function
Public Function GetTooltipWidth(Ctl As Control) As Long
' #VBIDEUtils#************************************************************
' * Programmer Name : Thomas Kabir
' * Web Site : http://home.t-online.de/home/vbfrood/english/about.htm
' * E-Mail : contact@vbfrood.be
' * Date : 16/02/2000
' * Time : 12:58
' * Module Name : cTooltips