Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. resizing a window

resizing a window

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    slah
    wrote on last edited by
    #1

    i don't want a window to be resized. i want it to be fixed but i am not getting the way to do this stuff. is there anyone who can guide me

    M I 2 Replies Last reply
    0
    • S slah

      i don't want a window to be resized. i want it to be fixed but i am not getting the way to do this stuff. is there anyone who can guide me

      M Offline
      M Offline
      Mike Upton
      wrote on last edited by
      #2

      The easiest way is not to use the WS_THICKFRAME style when creating the window. In the dialog resource editor, it's a property of the dialog box (in the styles tab, select the 'Border' dropdown and choose 'Thin'). In code, you can either remove the WS_THICKFRAME style in the call to CreateWindow (but note that WS_THICKFRAME is included in WS_OVERLAPPEDWINDOW) or, in MFC, you can override PreCreateWindow and modify the style there: cs.style &= ~WS_THICKFRAME; If you want a non-resizeable window but you want to keep the thick frame, you'll have to do something slightly more complicated involving WM_NCHITTEST.


      "We are the knights who say Ni" (The Knights Who Say Ni)

      1 Reply Last reply
      0
      • S slah

        i don't want a window to be resized. i want it to be fixed but i am not getting the way to do this stuff. is there anyone who can guide me

        I Offline
        I Offline
        Iain Clarke Warrior Programmer
        wrote on last edited by
        #3

        There are a few ways that jump to my mind. You could override OnGetMinMaxInfo / WM_GETMINMAXINFO to restrict the resizability of your window. Change the window style (in PreCreateWindow) so you don't have a border to resize. Override OnNcHitTest / WM_NCHITTEST so it returns HTCAPTION instead on HTTOP etc so you could move your window by dragging on the border rather than resizing it. A word of warning though. In general, I like being able to resize things, and I'm not alone. Don't break the windows paradigm unless you have a _really_ good reason. Good luck, Iain.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups