Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Getting a the real object from it's handle

Getting a the real object from it's handle

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpcomhelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shyam K Pananghat
    wrote on last edited by
    #1

    Hi, I am having the handle to a combo box's dropdown list control which i have grabed by subclassing and overriding the "WNDProc" to receive window message. is there any way by which i can know what is the real object behind this handle.So if it is list control can i assign it to a .Net list control and start using that list control in .Net. i tried control.FromHandle.. Listbox.Fromhandle and and some methods inside the marshal class in .Net so can you please help me getting the real control behind this handle

    Shyam my blog dotnetscoups.blogspot.com . swthoughts.blogspot.com .

    D 1 Reply Last reply
    0
    • S Shyam K Pananghat

      Hi, I am having the handle to a combo box's dropdown list control which i have grabed by subclassing and overriding the "WNDProc" to receive window message. is there any way by which i can know what is the real object behind this handle.So if it is list control can i assign it to a .Net list control and start using that list control in .Net. i tried control.FromHandle.. Listbox.Fromhandle and and some methods inside the marshal class in .Net so can you please help me getting the real control behind this handle

      Shyam my blog dotnetscoups.blogspot.com . swthoughts.blogspot.com .

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      It doesn't work that way. In most cases, you cannot simply slap a .NET controls over a window's handle and treat that handle like a control. Not every control has an unmanaged control sitting behind it.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      S 1 Reply Last reply
      0
      • D Dave Kreskowiak

        It doesn't work that way. In most cases, you cannot simply slap a .NET controls over a window's handle and treat that handle like a control. Not every control has an unmanaged control sitting behind it.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        S Offline
        S Offline
        Shyam K Pananghat
        wrote on last edited by
        #3

        First of all Thanks very much for your reply.. and about the scenario..... Hmmm .. that i know.. in my scenario i am having the handle to the dropdown area (control) of a combobox. so i want to know whether we can assign/create a list control from this handle. so that i can treat it is a list control and add a control in it or do whatever accoding to the project requirement

        Shyam my blog dotnetscoups.blogspot.com . swthoughts.blogspot.com .

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups