Getting cursor coordinates relative to a child window... - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Getting cursor coordinates relative to a child window...

SephirothSephiroth Fayetteville, NC, USAPosts: 1,035Member
OK, aside from my grid drawing problem, I also need to figure out how to retrieve my mouse cursor coordinates in a specific child window, not my parent window. How could I do this? The window is a static child window with the ss_bitmap style, and is also the window that I am trying to divide into 50 grid squares. Thanks for any help you can give.


-[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red]

Comments

  • pingpongpingpong Posts: 937Member
    where are u processing the mouse message? if in child window (where it should be), why convert?

    anyways, to convert from one window to another do this..

    say, POINT pt holds the mouse pos, hwndFrom and hwndTo are self-explainary :o)

    ClientToScreen(hwndFrom, &pt);
    ScreenToClient(hwndTo, &pt);


    : OK, aside from my grid drawing problem, I also need to figure out how to retrieve my mouse cursor coordinates in a specific child window, not my parent window. How could I do this? The window is a static child window with the ss_bitmap style, and is also the window that I am trying to divide into 50 grid squares. Thanks for any help you can give.
    :
    : -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red]
    :




Sign In or Register to comment.