Date: 2010jun11
OS: Windows
Q. How do I programatically enable/disable the minimize and
maximize buttons?
A.
void DisableMinimizeButton(HWND hwnd)
{
SetWindowLong(hwnd, GWL_STYLE,
GetWindowLong(hwnd, GWL_STYLE) & ~WS_MINIMIZEBOX);
}
void EnableMinimizeButton(HWND hwnd)
{
SetWindowLong(hwnd, GWL_STYLE,
GetWindowLong(hwnd, GWL_STYLE) | WS_MINIMIZEBOX);
}
void DisableMaximizeButton(HWND hwnd)
{
SetWindowLong(hwnd, GWL_STYLE,
GetWindowLong(hwnd, GWL_STYLE) & ~WS_MAXIMIZEBOX);
}
void EnableMaximizeButton(HWND hwnd)
{
SetWindowLong(hwnd, GWL_STYLE,
GetWindowLong(hwnd, GWL_STYLE) | WS_MAXIMIZEBOX);
}
From
http://blogs.msdn.com/b/oldnewthing/
| What this info useful to you? You can donate to say thanks |
Add a comment
Sign in to add a comment