Hi,
I would like to know if it is possible to hook onto Windowless controls
Thanks In Advance
Printable View
Hi,
I would like to know if it is possible to hook onto Windowless controls
Thanks In Advance
Most probably not possible.
Why and what control you want to hook ? Maybe someone will find another way.
I wanted to hook a Windowless TextBox
But if there isn't a way...
what is a windowless textbox?
A textbox is a window
A windowless textbox is precisely what the name means.
It's a TextBox that isn't a window and hasn't got am handle
There is a .ocx file in vb6 that allows us to use windowless controls
AFAIK, there is no 'windowless' textbox that comes with VB.
Post a screenshot. Or better attatch a demo project.
What is the ocx ? Give us its name (and what it shows in the components window).
What is the default name of this 'textbox' when you add in your form ?
Rightclick the ocx file, goto properties, and see if you can find company information.
The ocx file is <VB6 CD>\Common\Tools\VB\Winless\Mswless.ocx. There you will find the ocx file, a .reg file to make it available to vb6 after registering with regsvr32.exe and a chm file with the documentation.
Unfortunately, I'm not on my PC so I cannot post the files here
Ah ! I see !
Sorry, no idea about these controls. :(
I also am not familiar with this control and I don't have the install disks with me right now.
If the control is truly windowless then you cannot hook it because it probably does not have a message queue.
Messages are probably handled by its container, i.e. the window that it sits on.
Try looking at the messages the container form receives when you enter text into this windowless textbox.
See "Windowless Activation" in VS help.
Quote:
Since windowless controls do not have their own windows, the container (which does have a window) is responsible for providing services that would otherwise have been provided by the control’s own window. For example, if your control needs to query the keyboard focus, capture the mouse, or obtain a device context, these operations are managed by the container. The container routes user input messages sent to its window to the appropriate windowless control, using the IOleInPlaceObjectWindowless interface. (See the ActiveX SDK for a description of this interface.) COleControl member functions invoke these services from the container.
ok i'll try it but the enablewindow function among others will not work with this type of controls
Do you know any way to still use the functions???
Why do you want to use the windowless textbox? It gives no advantage over a regular textbox (it doesn't support Unicode either afaik).
Yes, you are right. But it gives more security.Quote:
Originally Posted by Merri
Anyway, there is a program with a windowless textbox (I don't have the source code) and I want to hook the textbox. That's why I need a way to use some functions.
BTW, is there any other way to enable/disable a TextBox?
EDIT: I now have the CD's with me. Here are the files:
What is it you are wanting to do? You haven't really specified what you are wanting to do other than "know" if theres a way to hook a windowless textbox.
How are you wanting to interact with this textbox? get the text in it? change it? disable/enable it? You may not need to use any 'hook'. anywho, need more information on what you're doing.
Check out the code in this thread
http://www.vbforums.com/showthread.php?t=426193
What I wanted to do was use EnableWindow and SendMessage on that text box
Hmm, did someone delete my other post? Maybe it didn't get posted right (I'm kind of absent minded, might have missed the Post button and closed the tab). Here it is:
A windowless control is created, drawn, and handled by the program itself. Everything you can do with it is defined in a function. If you want to disable it, you need a Enable/Disable function that will stop it from receiving input and draw on the Disabled state.
You cannot use API calls on a windowless control. Anything you do with it, you need to write from scratch.
However, since you're not actually writing this control (you got it from a windows DLL, did you not?), you will need to explore the functions available from that DLL, since you won't be able to write your own.
Why do you need a windowless control? The main reason to use them would be if you have many many controls, and cannot have handles for all of them. Windows has a limit of 10,000 handles per process. So, for example, web browsers like Firefox and Internet explorer use windowless controls in webpages, because one page can easily take up a ton of control handles. It is very hard to make controls that look and act like the standard windows controls, but it is usually well worth it. I doubt that what you are doing really needs windowless controls, but as I don't know what it is, I may be wrong.