c++ - CreateWindowEx WS_POPUP 为什么要打边框?

标签 c++ winapi opengl

我试图找出为什么我的应用程序有一个小的、很少像素的边框。

我的理解是 WS_POPUP 应该解决这个问题;

DWORD wndExStyle = WS_EX_OVERLAPPEDWINDOW;
DWORD wndStyle =  WS_POPUP | WS_SYSMENU;
g_hWnd = CreateWindowEx(wndExStyle, wcl.lpszClassName, L"junk",
wndStyle, 0, 0, 0, 0, 0, 0, wcl.hInstance, 0);
//Somewhere later
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
wglCreateContextAttribsARB(g_hDC, 0, attribList);
//Finally
ShowWindow(g_hWnd, SW_MAXIMIZE);
UpdateWindow(g_hWnd);

编辑 1: 移除 WS_BORDER

enter image description here

最佳答案

那个边框是由于使用WS_EX_OVERLAPPEDWINDOW引起的. WS_EX_OVERLAPPEDWINDOW 被定义为 WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE 非常清楚发生了什么。

删除扩展样式,边框消失。

关于c++ - CreateWindowEx WS_POPUP 为什么要打边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17384837/

相关文章:

c++ - 是否可以在 directx dc/buffer 上使用 opengl 进行绘制?

c++ - 如何在 AVX 中实现 floor(double)?

c++ - 如何将常量中的值设置为struct c++

c++ - 为什么 wchar_t* 变量被破坏了?

c++ - 如何在 C 中显示 _getch() 字符的整数值?

opengl - glReadPixels 不将数据写入数组

c++ - 如何在 C++ 中注册和使用钩子(Hook)?

c++ - 仅使用一个端口将两台服务器设计在一起

winapi - win32 CreateFile2 api调用的目的是什么?

c - opengl UI 安全问题