CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    How to Custamize SDI application View???/

    Hi

    I have an SDI application. I want to fix the dimensions of the mainframe window to a perticular size.How do i do that?

    Thanx


  2. #2
    Join Date
    May 1999
    Posts
    327

    Re: How to Custamize SDI application View???/

    This is actually quite easy. Open your application's mainfrm.cp file and place a series of statements similiar to this in your program's OnCreate member function:


    int CMainFrame::OnCreate(LPCREATESTRUCT lpCr...)
    {
    wpl.length = sizeof(WINDOWPLACEMENT);
    GetWindowPlacement(&wpl);
    wpl.rcNormalPosition.top = 0;
    wpl.rcNormalPosition.left = 0;
    wpl.rcNormalPosition.right = 100;
    wpl.rcNormalPosition.bottom = 250;
    SetWindowPlacement(&wpl);
    ShowWindow(SW_SHOWNORMAL);
    ...




    Also, add the following line to the public section of mainfrm.h file:

    WINDOWPLACEMENT wpl;

    Recompile and execute. You can change the size and the position of the window.


  3. #3
    Guest

    Re: How to Custamize SDI application View???/

    Hi,

    Thanx for the solution and I could do that.But I want avoid resizing the window by user using mouse( What I mean is user should not be able to resize the window). How do I do that?

    Thanx


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