Re: Repositioning items inside a Dialog

"Igor Tandetnik" <[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>
amante1il <[email protected]> wrote:
> I am using a dialog that inherits from CDialogRegionT in order to
> have a bitmap as a background.
>
> The problem is that for some reason i can't reposition the items
> inside the dialog when i change the background image.
>
> I tried:
> void SetBuddy(int x, int y)
> {
> RECT rc;
> m_ctrlButton.GetWindowRect(&rc);
> rc.top += 50;
> rc.bottom += 50;
>>> SetWindowPos(GetDlgItem(IDOK), HWND_NOTOPMOST, rc.top, rc.left,
>>> rc.right, rc.bottom, SWP_SHOWWINDOW | SWP_NOSIZE);

First, GetWindowRect gives you screen coordinates. SetWindowPos expects 
client coordinates relative to the parent window.

Second, read the documentation on SetWindowPos carefully. Pay attention 
to the order of parameters.
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925





------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.