CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2003
    Location
    San Jose, CA
    Posts
    78

    just simple one, not important

    Why this doesn't work?
    public CMyTestView: class CView

    BOOL CMyTestView::PreCreateWindow(CREATESTRUCT& cs)
    {
    // TODO: Modify the Window class or styles here by modifying
    // the CREATESTRUCT cs
    cs.cy = 400;
    cs.cx = 200;


    return CView::PreCreateWindow(cs);
    }

    the windows is always big, witdh = 1000.( use mouse clikc to check position).
    thanks

  2. #2
    Join Date
    Feb 2004
    Posts
    232
    cx and cy are definitions of the position of the window. x and y is what you are really looking for.
    Need help with anything related to audio programming? I can help!

  3. #3
    Join Date
    Feb 2003
    Location
    San Jose, CA
    Posts
    78
    are you sure

    cx and cy are the width adn the height of the window, x and y is the position of the left top corner.

  4. #4
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917
    Originally posted by sjcguy
    cx and cy are the width adn the height of the window, x and y is the position of the left top corner.
    Correct.

    Why are you trying to change initial size of the view?

    Views are always created as child window of the frame. Of course you can create view as a top window but that is not reasonable.

    After creation of a frame and view, frame resizes view to fit frame’s client area.

    Instead try to adjust parent’s size.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  5. #5
    Join Date
    Feb 2003
    Location
    San Jose, CA
    Posts
    78

    Yes, my mistake. Thanks

    Yeah, i was confused. it should be in CFrameWnd.
    thanks.
    Btway,
    Is there anyway I can find out what is the resolution setting on the current screen?
    thanks.

  6. #6
    Join Date
    Apr 2002
    Location
    Australia
    Posts
    54
    I think this is what you are after:

    GetSystemMetrics(SM_CXSCREEN)
    GetSystemMetrics(SM_CYSCREEN)

    This will return: Width and height, in pixels, of the screen of the primary display monitor. These are the same values you obtain by callingGetDeviceCaps(hdcPrimaryMonitor, HORZRES/VERTRES).

    Em

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured