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