Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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;
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
321 views
Welcome To Ask or Share your Answers For Others

1 Answer

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...