Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening a window that has no title bar with Win32

I'm developing a C++ application for Windows. I'm using the Win32 API. How can I open a window without a title bar (without controls, icon and title) and that can not be resized.

The 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); 

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

 FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;  ControlBox = false; 
like image 232
blejzz Avatar asked Sep 16 '11 09:09

blejzz


People also ask

What is window title?

The window title for a page (often called the "title tag") is, most simply, the text that appears at the top of a visitor's web browser when viewing that page.


2 Answers

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 
like image 180
Mike Avatar answered Sep 20 '22 23:09

Mike


HWND hWnd ; hWnd = CreateWindow(szWindowClass, 0, (WS_BORDER ), 0, 0, 100, 100, NULL, NULL, Instance, NULL);  SetWindowLong(hwnd, GWL_STYLE, WS_BORDER );  // With 1 point border //OR SetWindowLong(hwnd, GWL_STYLE, 0 );  // Without 1 point border = white rectangle  SetWindowPos(hwnd, 0, 150, 100, 250, 250, SWP_FRAMECHANGED);   if (!hWnd)  return FALSE ; else ShowWindow(hwnd, SW_SHOW); 
like image 21
mohammad bagher kenari Avatar answered Sep 22 '22 23:09

mohammad bagher kenari