Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

handles in VBA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ctrl+X - 17 Feb 2005 10:59 GMT
hi all

(I'm quite cross posting, sorry, since I have already asked this question
elsewhere)
I'd like to use a multi-line tooltip in VBA, adapting the subs I found here:
http://www.vb-helper.com/howto_multi_line_tooltip.html

Unfortunately it's necessary to know the handles of forms and controls; in
VBA the handle of a form is easy to find:

Dim hFrm As Long
hFrm = FindWindow(vbNullString, Me.Caption)

But what about controls? I tried with EnumChildWindows :

...
EnumChildWindows hFrm, AddressOf EnumChildProc, ByVal 0&
...
Public Function EnumChildProc(ByVal hwnd As Long, ByVal lParam As Long) As
Long
Debug.Print hwnd
EnumChildProc = 1
End Function

But I have just learnt it's wrong, since EnumChildWindows expects true
windows-controls, while VBA-controls are "windowless controls"; in
microsoft.public.vb.winapi Mike D Sutton wrote :
"IIRC none of the controls on a VBA form are 'really' windows at least in
the way the OS defines them (and EnumChildWindows() expects them), but are
simply drawn onto the parent at runtime. This is the same behaviour as label
and image controls exhibit within VB, they're known as windowless controls"

Is it possible to retrieve those handles in VBA or is it simply impossible?
Jonathan West - 17 Feb 2005 14:16 GMT
Hi Ctrl-X

I think you may be out of luck. VBA controls are mostly windowless.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

> hi all
>
[quoted text clipped - 33 lines]
> Is it possible to retrieve those handles in VBA or is it simply
> impossible?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.