Results 1 to 6 of 6

Thread: Maximizing windows

  1. #1

    Thread Starter
    Fanatic Member Wynd's Avatar
    Join Date
    Dec 2000
    Location
    In a bar frequented by colossal death robots
    Posts
    772

    Maximizing windows

    Hi, how can I prevent a window from being maximized or gray out the maximize button? If you need my code it is just the basic window from winprog.org.
    Alcohol & calculus don't mix.
    Never drink & derive.

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    I think this will prevent the maximizing of a window (not tested):
    Code:
    HMENU m = GetSystemMenu(hWnd, FALSE)
    RemoveMenu m, SC_MAXIMIZE, MF_BYCOMMAND
    Last edited by Vlatko; May 29th, 2001 at 05:42 PM.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3

    Thread Starter
    Fanatic Member Wynd's Avatar
    Join Date
    Dec 2000
    Location
    In a bar frequented by colossal death robots
    Posts
    772
    Well, that sort of works. The maximize button is clickable, but nothing happens when you click it. You can still resize the window by dragging, however.
    Alcohol & calculus don't mix.
    Never drink & derive.

  4. #4
    Hyperactive Member AAG's Avatar
    Join Date
    Aug 2000
    Location
    United States
    Posts
    411

    Here You Go.

    In You CreateWindowEx Procedure, simply use the following in your dWstyle.

    Code:
    WS_OVERLAPPEDWINDOW - WS_MAXIMIZEBOX - WS_SIZEBOX
    this creates a window that cannot be sized and a window that does not have its maximize button enabled.

  5. #5

    Thread Starter
    Fanatic Member Wynd's Avatar
    Join Date
    Dec 2000
    Location
    In a bar frequented by colossal death robots
    Posts
    772
    AAG, thanks a lot! That works perfectly.
    Alcohol & calculus don't mix.
    Never drink & derive.

  6. #6
    Hyperactive Member AAG's Avatar
    Join Date
    Aug 2000
    Location
    United States
    Posts
    411

    Sure :)

    No Problem. Glad To Help

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