opening a window that has no title bar with win32

blejzz picture blejzz · Sep 16, 2011 · Viewed 39k times · Source

I'm developing a c++ application for windows. I'm using win32 API. I have a very simple question, which i couldn't find an answer to. How can i open a window without a title bar (without controls, icon and title) and that can not be resized.

Piece of code that i am using for the application to create a window:

      hWnd = CreateWindow(szWindowClass, 0, (WS_BORDER ),
             0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, NULL, NULL, hInstance, NULL);

UPDATE:

To do this in c#, you just define this code:

 FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
 ControlBox = false;

Answer

Mike picture Mike · Sep 16, 2011
hWnd = CreateWindow(szWindowClass, 0, (WS_BORDER ), 0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, NULL, NULL, hInstance, NULL); 

SetWindowLong(hWnd, GWL_STYLE, 0); //remove all window styles, check MSDN for details

ShowWindow(hWnd, SW_SHOW); //display window