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 to create a window with a thin border?! I can't believe this isn't working any more! [modified]

How to create a window with a thin border?! I can't believe this isn't working any more! [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestionc++csscom
3 Posts 2 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 messaging. I got an easy question. How can you make a window with a thin (2D) border? BECAUSE I DID THIS IN THE PAST! Less than 3 weeks ago! And now I can't do it any more. It's incredible! I'm totally frustrated! I tried combining so many flags that I think I went through all the possible combinations except the right one. Take for example this simple way to create a window in a standard Win32 application. This shoud create that 2D window but it's still 3D!!! I remember that in the past when I removed that WS_THICKFRAME attribute, it looked 2D. But it isn't working any more. Aaaaaaaaargh!!!!! LRESULT CALLBACK WindowEngine (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { return DefWindowProc(hwnd, uMsg, wParam, lParam); //If there is no registered Smart Window found, calling default procedure. } int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MSG Msg; WNDCLASSEX wceData; //Used to create the Window Class. HWND a; wceData.cbSize = sizeof(wceData); wceData.style = 0; wceData.lpfnWndProc = WindowEngine; wceData.cbClsExtra = NULL; wceData.cbWndExtra = NULL; wceData.hInstance = hInstance; wceData.hIcon = NULL; wceData.hCursor = LoadCursor(NULL, IDC_ARROW); wceData.hbrBackground = NULL; wceData.lpszMenuName = NULL; wceData.lpszClassName = "testClass"; wceData.hIconSm = NULL; RegisterClassEx(&wceData); a = CreateWindowEx ( NULL, "testClass", "Some title", WS_OVERLAPPEDWINDOW &~ WS_THICKFRAME, 10, 10, 100, 200, NULL, NULL, NULL, NULL ); ShowWindow(a, 1); while(GetMessage(&Msg, NULL, 0, 0) > 0) { TranslateMessage(&Msg); DispatchMessage(&Msg); } return 0; } -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^ -- modified at 17:14 Tuesday 11th July, 2006

    L 1 Reply Last reply
    0
    • A Axonn Echysttas

      Hi everybody. Long time no messaging. I got an easy question. How can you make a window with a thin (2D) border? BECAUSE I DID THIS IN THE PAST! Less than 3 weeks ago! And now I can't do it any more. It's incredible! I'm totally frustrated! I tried combining so many flags that I think I went through all the possible combinations except the right one. Take for example this simple way to create a window in a standard Win32 application. This shoud create that 2D window but it's still 3D!!! I remember that in the past when I removed that WS_THICKFRAME attribute, it looked 2D. But it isn't working any more. Aaaaaaaaargh!!!!! LRESULT CALLBACK WindowEngine (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { return DefWindowProc(hwnd, uMsg, wParam, lParam); //If there is no registered Smart Window found, calling default procedure. } int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MSG Msg; WNDCLASSEX wceData; //Used to create the Window Class. HWND a; wceData.cbSize = sizeof(wceData); wceData.style = 0; wceData.lpfnWndProc = WindowEngine; wceData.cbClsExtra = NULL; wceData.cbWndExtra = NULL; wceData.hInstance = hInstance; wceData.hIcon = NULL; wceData.hCursor = LoadCursor(NULL, IDC_ARROW); wceData.hbrBackground = NULL; wceData.lpszMenuName = NULL; wceData.lpszClassName = "testClass"; wceData.hIconSm = NULL; RegisterClassEx(&wceData); a = CreateWindowEx ( NULL, "testClass", "Some title", WS_OVERLAPPEDWINDOW &~ WS_THICKFRAME, 10, 10, 100, 200, NULL, NULL, NULL, NULL ); ShowWindow(a, 1); while(GetMessage(&Msg, NULL, 0, 0) > 0) { TranslateMessage(&Msg); DispatchMessage(&Msg); } return 0; } -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^ -- modified at 17:14 Tuesday 11th July, 2006

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Hope this helps (taken from MS Win32 Developer's Reference) CreateWindow dwStyle parameter

      Axonn Echysttas wrote:

      WS_THICKFRAME

      Creates a window that has a sizing border. Same as the WS_SIZEBOX style.

      Axonn Echysttas wrote:

      thin (2D) border

      WS_BORDER Creates a window that has a thin-line border. WS_CAPTION Creates a window that has a title bar (includes the WS_BORDER style).

      A 1 Reply Last reply
      0
      • L Lost User

        Hope this helps (taken from MS Win32 Developer's Reference) CreateWindow dwStyle parameter

        Axonn Echysttas wrote:

        WS_THICKFRAME

        Creates a window that has a sizing border. Same as the WS_SIZEBOX style.

        Axonn Echysttas wrote:

        thin (2D) border

        WS_BORDER Creates a window that has a thin-line border. WS_CAPTION Creates a window that has a title bar (includes the WS_BORDER style).

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

        Hi Richard. Nope, unfortunately it doesn't help. Did you try WS_BORDER with the code above? If you put that WS_BORDER style, the window will still have a title bar. There is not noticeable difference between WS_BORDER and WS_CAPTION. Pf... totally weird. WS_POPUP | WS_BORDER creates something of a 2D window but I am definitely sure that I was able to create a window with caption, maximize, minimze buttons AND 2D ASPECT! And now I can't do it no more. Aarggggghh! I'm so pissed off! I gotta dug up from the grave some of my old code apparently. -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

        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