如何通过在C ++ openGL中拖动边框来禁用调整大小窗口? [英] How can I disable resizing window by dragging borders in C++ openGL?
本文介绍了如何通过在C ++ openGL中拖动边框来禁用调整大小窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用C ++ openGL,我需要保持窗口大小不变。
我使用了以下函数来禁用最大化按钮:
I''m using C++ openGL and I need my window size to remain constant.
I''ve used the following function to disable the maximize button:
void toggleGlutWindowMaximizeBox(char *szWindowTitle)
{
long dwStyle;
HWND hwndGlut;
hwndGlut = FindWindow(NULL, szWindowTitle);
dwStyle = GetWindowLong(hwndGlut, GWL_STYLE);
dwStyle ^=WS_MAXIMIZEBOX;
SetWindowLong(hwndGlut, GWL_STYLE, dwStyle);
}
确实有效=)按钮显示为灰色但仍然可以通过其边框操纵窗口的大小!
我google了很多但是我找不到任何有用的东西。
可以有人帮忙吗?
It did work =) the button appeared gray but still the size of the window can be manipulated through its borders!
I googled it a lot but still I couldn''t find anything useful.
Can anyone help?
推荐答案
你真的非常非常接近。你选择了不相关的风格,控制最大化的操作。按边框调整大小由另一位WS_SIZEBOX
控制,与WS_THICKFRAME
相同。你必须清除这一点。请参阅:
http ://msdn.microsoft.com/en-us/library/windows/desktop/ms632600%28v=vs.85%29.aspx [ ^ ]。
同样,您可以小心删除最小化框和其他一些东西。请自己看看。
-SA
You were really, really close. You picked unrelated style, controlling maximize operation. Resizing by the border is controlled by another bit,WS_SIZEBOX
, same asWS_THICKFRAME
. You have to clear this bit. Please see:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms632600%28v=vs.85%29.aspx[^].
Likewise, you could take care about removing of minimize box and some other things. Please look by yourself.
—SA
这篇关于如何通过在C ++ openGL中拖动边框来禁用调整大小窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文