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. How can I have a window with thick frame but no resize?

How can I have a window with thick frame but no resize?

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++wpfhelpcareer
5 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.
  • A Offline
    A Offline
    Axonn Echysttas
    wrote on last edited by
    #1

    Hi everybody :- ). Long time no postin'. I worked in other areas lately but now I'm back in C++ at a problem left unsolved some time ago. The problem is quite severe as in I am lacking some very important information (which apparently I can't find in MSDN). You see... I want to create a window which has a control box, minimize and close buttons and a thick frame, but NO RESIZE. So far, I used this: hwndThis = CreateWindowEx //Creating the window. ( NULL, //ExStyles. sClassName, //Class name. Created somewhere above. Title, //Window name. WS_OVERLAPPEDWINDOW &~ WS_THICKFRAME &~ WS_MAXIMIZEBOX, //Styles. X, //X. Y, //Y. W, //Width. H, //Height. NULL, //Parent. NULL, //Menu. hHost, //Parent. NULL //CreateStruct. ); As you can probably already guess, this does the job, but creates a window with a very thin border and I don't like that. If I remove WS_THICKFRAME, of course, it works but then I can resize it again. Soooooooooo? Any ideas anybody? :- ). Thank you in advance! -= E C H Y S T T A S =- The Greater Mind Balance

    B PJ ArendsP 2 Replies Last reply
    0
    • A Axonn Echysttas

      Hi everybody :- ). Long time no postin'. I worked in other areas lately but now I'm back in C++ at a problem left unsolved some time ago. The problem is quite severe as in I am lacking some very important information (which apparently I can't find in MSDN). You see... I want to create a window which has a control box, minimize and close buttons and a thick frame, but NO RESIZE. So far, I used this: hwndThis = CreateWindowEx //Creating the window. ( NULL, //ExStyles. sClassName, //Class name. Created somewhere above. Title, //Window name. WS_OVERLAPPEDWINDOW &~ WS_THICKFRAME &~ WS_MAXIMIZEBOX, //Styles. X, //X. Y, //Y. W, //Width. H, //Height. NULL, //Parent. NULL, //Menu. hHost, //Parent. NULL //CreateStruct. ); As you can probably already guess, this does the job, but creates a window with a very thin border and I don't like that. If I remove WS_THICKFRAME, of course, it works but then I can resize it again. Soooooooooo? Any ideas anybody? :- ). Thank you in advance! -= E C H Y S T T A S =- The Greater Mind Balance

      B Offline
      B Offline
      basementman
      wrote on last edited by
      #2

      You can handle the WM_SIZING message and simply modify the rect to the app size.  onwards and upwards...

      A 1 Reply Last reply
      0
      • A Axonn Echysttas

        Hi everybody :- ). Long time no postin'. I worked in other areas lately but now I'm back in C++ at a problem left unsolved some time ago. The problem is quite severe as in I am lacking some very important information (which apparently I can't find in MSDN). You see... I want to create a window which has a control box, minimize and close buttons and a thick frame, but NO RESIZE. So far, I used this: hwndThis = CreateWindowEx //Creating the window. ( NULL, //ExStyles. sClassName, //Class name. Created somewhere above. Title, //Window name. WS_OVERLAPPEDWINDOW &~ WS_THICKFRAME &~ WS_MAXIMIZEBOX, //Styles. X, //X. Y, //Y. W, //Width. H, //Height. NULL, //Parent. NULL, //Menu. hHost, //Parent. NULL //CreateStruct. ); As you can probably already guess, this does the job, but creates a window with a very thin border and I don't like that. If I remove WS_THICKFRAME, of course, it works but then I can resize it again. Soooooooooo? Any ideas anybody? :- ). Thank you in advance! -= E C H Y S T T A S =- The Greater Mind Balance

        PJ ArendsP Offline
        PJ ArendsP Offline
        PJ Arends
        wrote on last edited by
        #3

        Handle the WM_GETMINMAXINFO message. Set the minimum and maximum sizes the same and the window will not be resizable.


        You may be right I may be crazy -- Billy Joel -- Within you lies the power for good - Use it!

        Within you lies the power for good; Use it!

        1 Reply Last reply
        0
        • B basementman

          You can handle the WM_SIZING message and simply modify the rect to the app size.  onwards and upwards...

          A Offline
          A Offline
          Axonn Echysttas
          wrote on last edited by
          #4

          Not good because I will still see that annoying arrow-resize icon. There has to be another way. A style or something. Something I missed in the MSDN documentation. -= E C H Y S T T A S =- The Greater Mind Balance

          PJ ArendsP 1 Reply Last reply
          0
          • A Axonn Echysttas

            Not good because I will still see that annoying arrow-resize icon. There has to be another way. A style or something. Something I missed in the MSDN documentation. -= E C H Y S T T A S =- The Greater Mind Balance

            PJ ArendsP Offline
            PJ ArendsP Offline
            PJ Arends
            wrote on last edited by
            #5

            Axonn Echysttas wrote:

            I will still see that annoying arrow-resize icon

            WM_NCHITEST, check if the mouse if over a resizing border, if it is return HT_BORDER.


            You may be right I may be crazy -- Billy Joel -- Within you lies the power for good - Use it!

            Within you lies the power for good; Use it!

            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