Getting hWnd of a Forms 2.0 Textbox

I need to get the hWnd of a Forms 2.0 textbox.

The hWnd needs to work with the GetScrollPos API and similar functions.

I've tried the Setfocus/Getfocus method, but the hWnd I get doesn't work with the API.

The textbox is located in a picturebox on the form.

Any suggestions?
LVL 2
davidnsc1Asked:
Who is Participating?
 
DarkoLordConnect With a Mentor Commented:
Hmm I tried to enumerate all child windows, but then I looked it with the Spy++ and "forms 2.0 textbox" doesn't even appear as a window...

Darko
0
 
DarkoLordCommented:
You can't get a Form 2.0 object's hwnd easily...

I think this is because of that:  The use of these Microsoft Forms components in your own compiled applications, such as those written with Microsoft Visual C++ and Microsoft Visual Basic, is not recommended or supported. These controls were designed and tested to work exclusively within Microsoft Office and its Visual Basic for Applications environment.

http://support.microsoft.com/default.aspx?kbid=224305

Darko
0
 
davidnsc1Author Commented:
Is there a non-easy way of getting the hWnd?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
davidnsc1Author Commented:
Does this mean it doesn't have a hWnd?
0
 
DarkoLordCommented:
It looks so... although I'm not 100% sure...

Darko
0
 
davidnsc1Author Commented:
Hmm...thanks for the help.  Do you know of any better unicode-aware plain-text textboxes?
0
 
DarkoLordCommented:
Here is an example of how to "extend" a label to display unicode: http://www.vbforums.com/attachment.php?s=&postid=1380475 
I think you can do the same with a textbox...

Darko
0
 
davidnsc1Author Commented:
Unfortunatly, that kind of "extending" is just changing character sets--I need full unicode functionality, as there are generally multiple character sets being displayed at the same time.
0
 
danaseamanConnect With a Mentor Commented:
unicode-aware plain-text textboxes:
Depends on desired platform. If you need it to work on Win98 as well as NT/2000/XP you should look at RichEdit. Excellent freeware control available at http://www.mvps.org/emorcillo/vb6/controls/ctl_riched.msi I've been using it for over a year and it works great. For more info about Unicode controls see http://www.cyberactivex.com/UnicodeTutorialVb.htm
0
 
danaseamanCommented:
By the way I think Forms 2.0 TextBox is a windowless control thus the reason why you can't get a hWnd.
0
 
davidnsc1Author Commented:
Thanks.  I ended up going with the RichEdit control.  Points to both of you for your timely help!
0
All Courses

From novice to tech pro — start learning today.