打开一个没有标题栏与win32的窗口 [英] opening a window that has no title bar with win32

查看:276
本文介绍了打开一个没有标题栏与win32的窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Windows开发一个c ++应用程序。我使用win32 API。我有一个非常简单的问题,我找不到答案。如何打开一个没有标题栏的窗口(无控件,图标和标题),不能调整大小。



我为应用程序使用的代码创建窗口:

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

更新:



c#,你只需要定义这个代码:

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


解决方案

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

SetWindowLong(hWnd,GWL_STYLE,0); //删除所有窗口样式,查看MSDN的详细信息

ShowWindow(hWnd,SW_SHOW); // display window


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;

解决方案

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

这篇关于打开一个没有标题栏与win32的窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆