Active X Control as Container


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Active X Control as Container

  1. #1
    Anthony Lucidi Guest

    Active X Control as Container


    I have an ActiveX control that is a container for other controls. I would
    like to subclass to the children controls and capture certain windows messages.
    I step through the Controls collection and try to obtain the HWND for each
    child control in the ActiveX control. The ListView and TreeView do not seem
    to have HWND's when in development. I get a "Write Only" error when I try
    to read the Hwnd. Have you ever seen this problem,and is there another way
    of getting the HWNDs.

    Thanks is advance for any help
    Share on Google+

  2. #2
    Dan Appleman Guest

    Re: Active X Control as Container


    "Anthony Lucidi" <alucidi@estee.com> wrote:
    >
    >I have an ActiveX control that is a container for other controls. I would
    >like to subclass to the children controls and capture certain windows messages.
    > I step through the Controls collection and try to obtain the HWND for each
    >child control in the ActiveX control. The ListView and TreeView do not

    seem
    >to have HWND's when in development. I get a "Write Only" error when I try
    >to read the Hwnd. Have you ever seen this problem,and is there another

    way
    >of getting the HWNDs.
    >
    >Thanks is advance for any help


    It has an HWND, you just can't get it through the properties.
    You'll need to use API techniques (EnumWindows, GetWindow, etc.) to get the
    handles.
    Check out examples in my "Visual Basic Programmer's Guide to the Win32 API".
    Also, if you're
    using SpyWorks for the subclassing, you'll find examples of API based techniques
    there (and
    have access to Desaware's tech support if you run into trouble).

    Dan

    Share on Google+

  3. #3
    Phil Weber Guest

    Re: Active X Control as Container

    > I have an ActiveX control that is a container for other controls.
    > I would like to subclass to the children controls and capture
    > certain windows messages. I step through the Controls collec-
    > tion and try to obtain the hWnd for each child control.


    Anthony: Have you tried the UserControl's .ContainedControls collection?
    ---
    Phil Weber


    Share on Google+

  4. #4
    Anthony Lucidi Guest

    Re: Active X Control as Container


    "Phil Weber" <pweber@teleport.com> wrote:
    > > I have an ActiveX control that is a container for other controls.
    > > I would like to subclass to the children controls and capture
    > > certain windows messages. I step through the Controls collec-
    > > tion and try to obtain the hWnd for each child control.

    >
    >Anthony: Have you tried the UserControl's .ContainedControls collection?
    >---
    >Phil Weber
    >
    >


    Yes Phil That is how I am getting the controls within the container, but
    when I try to get the HWND for the listview or treeview I get the error message
    saying the HWND is a write only property and when I try to write to it I
    get a message saying the HWND property is Read only..



    Share on Google+

Similar Threads

  1. Replies: 1
    Last Post: 08-27-2002, 02:28 AM
  2. Container Control and Keypress
    By Steve Ariel in forum VB Classic
    Replies: 0
    Last Post: 02-14-2001, 01:47 AM
  3. Active X Control on web page
    By Mike Hamilton in forum VB Classic
    Replies: 4
    Last Post: 12-21-2000, 04:41 AM
  4. Form Container Control in VB5
    By Mark Alexander Bertenshaw in forum VB Classic
    Replies: 6
    Last Post: 05-05-2000, 07:10 AM
  5. Form Container Control in VB5
    By Mark Alexander Bertenshaw in forum VB Classic
    Replies: 0
    Last Post: 05-03-2000, 11:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center