Window Position

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

    #1

    Window Position

    Does anyone have a code snippet that retrieves a windows
    coordinates within the desktop? I can't seem to get
    GetWindowPlacem ent() to work. And GetWindowRect returns
    0,0 for the top,left corner, not the current position on
    the screen.

    Thanks.

  • Nishant S

    #2
    Re: Window Position

    Use ClientToScreen to get the actual desktop co-ordinates

    --
    Regards,
    Nish [VC++ MVP]



    "insomniac" <info@u-s-tech.com> wrote in message
    news:0db001c36c 31$978eeeb0$a00 1280a@phx.gbl.. .[color=blue]
    > Does anyone have a code snippet that retrieves a windows
    > coordinates within the desktop? I can't seem to get
    > GetWindowPlacem ent() to work. And GetWindowRect returns
    > 0,0 for the top,left corner, not the current position on
    > the screen.
    >
    > Thanks.
    >[/color]


    Comment

    • pem3v78

      #3
      Re: Window Position

      This doesn't work ?

      CRect myRect;
      GetClientRect(& myRect);

      ClientToScreen( myRect);
      MoveWindow(myRe ct.left, myRect.top, myRect.Width() + 20, myRect.Height() +
      20);

      Mike

      "insomniac" <info@u-s-tech.com> wrote in message
      news:0db001c36c 31$978eeeb0$a00 1280a@phx.gbl.. .[color=blue]
      > Does anyone have a code snippet that retrieves a windows
      > coordinates within the desktop? I can't seem to get
      > GetWindowPlacem ent() to work. And GetWindowRect returns
      > 0,0 for the top,left corner, not the current position on
      > the screen.
      >
      > Thanks.
      >[/color]


      Comment

      Working...