Get Window handle from point

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sinisa

    #1

    Get Window handle from point

    Hi, first sorry on awkward english.

    I'll try to illustrate my problem:
    (dont know how will this look on your scrren)

    |--Dialog----------------------------------------------------------------------------|
    |
    |
    | |-------groupbox----
    -----------------------------------------------------| |
    | |
    | |
    | |
    | |
    | | |-------------------------------|
    | |
    | | | Button P(x,y) |
    | |
    | | |-------------------------------|
    | |
    | |
    | |
    | |
    | |
    |
    |-------------------------------------------------------------------------------|
    |
    |
    |
    |
    |
    |-----------------------------------------------------------------------------------------|


    P(x,y) represents (point) position of cursor with coordinates x,y
    , and that point
    lies on button.

    Button and groupbox are childs from dialog.

    My problem is how to get handle form Button.

    i tryed something like:
    (this is only part of code)

    HWND hwDlg;
    HWND hwGroup;
    HWND hwButt;

    hwGroup = :: WindowFromPoint (p);
    /* this is working, i get valid handle*/

    hwDlg = ::GetParent(hwG roup);
    /* this is also working */

    hwButt = ::RealChildWind owFromPoint(hwD lg,p);
    /* but here i always get NULL */

    as i understand from msdn RealChildWindow FromPoint should return child
    handle if
    window(in this case button) if point is "over" window , and window is
    in transparent area of groupbox .

    any advice is most welcome.



  • Howard

    #2
    Re: Get Window handle from point


    "Sinisa" <sipetar@inet.h r> wrote in message
    news:1136729450 .109739.295180@ g47g2000cwa.goo glegroups.com.. .

    You need to ask in a Windows newsgroup. The C+ language knows nothing about
    windows or mouse coordinates.

    -Howard


    Comment

    • Artie Gold

      #3
      Re: Get Window handle from point

      Howard wrote:[color=blue]
      > "Sinisa" <sipetar@inet.h r> wrote in message
      > news:1136729450 .109739.295180@ g47g2000cwa.goo glegroups.com.. .
      >
      > You need to ask in a Windows newsgroup. The C+ language knows nothing about
      > windows or mouse coordinates.
      >[/color]

      ....and we know nothing of the C+ language either! ;-)
      [yeah, I know it's a typo...just couldn't resist!]

      Cheers,
      --ag
      --
      Artie Gold -- Austin, Texas
      I will (ir)regularly write about things that are important to me -- that I hope interest you. Of course, since I see most things as being political, that will be most of it.

      http://www.cafepress.com/goldsays
      "If you have nothing to hide, you're not trying!"

      Comment

      • Howard

        #4
        Re: Get Window handle from point


        "Artie Gold" <artiegold@aust in.rr.com> wrote in message
        news:42foglF1ir p6kU1@individua l.net...[color=blue]
        > Howard wrote:[color=green]
        >> "Sinisa" <sipetar@inet.h r> wrote in message
        >> news:1136729450 .109739.295180@ g47g2000cwa.goo glegroups.com.. .
        >>
        >> You need to ask in a Windows newsgroup. The C+ language knows nothing
        >> about windows or mouse coordinates.
        >>[/color]
        >
        > ...and we know nothing of the C+ language either! ;-)
        > [yeah, I know it's a typo...just couldn't resist!]
        >
        > Cheers,
        > --ag[/color]

        What...this isn't the C+ newsgroup??? Oh, crap... no wonder my programs
        aren't working!

        -Howard



        Comment

        • Mike Wahler

          #5
          Re: Get Window handle from point

          "Howard" <alicebt@hotmai l.com> wrote in message
          news:7eywf.4421 52$zb5.190155@b gtnsc04-news.ops.worldn et.att.net...[color=blue]
          >
          > "Artie Gold" <artiegold@aust in.rr.com> wrote in message
          > news:42foglF1ir p6kU1@individua l.net...[color=green]
          >> Howard wrote:[color=darkred]
          >>> "Sinisa" <sipetar@inet.h r> wrote in message
          >>> news:1136729450 .109739.295180@ g47g2000cwa.goo glegroups.com.. .
          >>>
          >>> You need to ask in a Windows newsgroup. The C+ language knows nothing
          >>> about windows or mouse coordinates.
          >>>[/color]
          >>
          >> ...and we know nothing of the C+ language either! ;-)
          >> [yeah, I know it's a typo...just couldn't resist!]
          >>
          >> Cheers,
          >> --ag[/color]
          >
          > What...this isn't the C+ newsgroup??? Oh, crap... no wonder my programs
          > aren't working![/color]

          I'm developing the C-squared language. A massive project
          requiring much energy.

          -Mike


          Comment

          • Marcus Kwok

            #6
            Re: Get Window handle from point

            Mike Wahler <mkwahler@mkwah ler.net> wrote:[color=blue]
            > I'm developing the C-squared language. A massive project
            > requiring much energy.[/color]

            Mike's C-squared = MC^2
            Maybe you should just call it E.

            --
            Marcus Kwok

            Comment

            • W Marsh

              #7
              Re: Get Window handle from point

              On Tue, 10 Jan 2006 14:15:58 +0000 (UTC), ricecake@gehenn om.net
              (Marcus Kwok) wrote:
              [color=blue]
              >Mike Wahler <mkwahler@mkwah ler.net> wrote:[color=green]
              >> I'm developing the C-squared language. A massive project
              >> requiring much energy.[/color]
              >
              >Mike's C-squared = MC^2
              >Maybe you should just call it E.[/color]

              E already exists. http://en.wikipedia.org/wiki/E_programming_language

              Comment

              • Mike Wahler

                #8
                Re: Get Window handle from point


                "Marcus Kwok" <ricecake@gehen nom.net> wrote in message
                news:dq0fiu$k2a $1@news-int.gatech.edu. ..[color=blue]
                > Mike Wahler <mkwahler@mkwah ler.net> wrote:[color=green]
                >> I'm developing the C-squared language. A massive project
                >> requiring much energy.[/color]
                >
                > Mike's C-squared = MC^2
                > Maybe you should just call it E.[/color]

                That was the point of my joke. (Someone else
                has already created 'D').


                -Mike


                Comment

                • Mike Wahler

                  #9
                  Re: Get Window handle from point

                  "W Marsh" <wayne.marsh@gm ail.com> wrote in message
                  news:hhn7s15vv1 tfee7geimd3hlqg jmddbedam@4ax.c om...[color=blue]
                  > On Tue, 10 Jan 2006 14:15:58 +0000 (UTC), ricecake@gehenn om.net
                  > (Marcus Kwok) wrote:
                  >[color=green]
                  >>Mike Wahler <mkwahler@mkwah ler.net> wrote:[color=darkred]
                  >>> I'm developing the C-squared language. A massive project
                  >>> requiring much energy.[/color]
                  >>
                  >>Mike's C-squared = MC^2
                  >>Maybe you should just call it E.[/color]
                  >
                  > E already exists. http://en.wikipedia.org/wiki/E_programming_language[/color]

                  Ack. Working at the speed of light, and I'm
                  still too late. :-)

                  -Mike


                  Comment

                  Working...