diff --git a/include/window.h b/include/window.h index 9d70707b..8d34d6f9 100644 --- a/include/window.h +++ b/include/window.h @@ -7648,8 +7648,10 @@ MG_EXPORT DWORD GUIAPI GetWindowExStyle (HWND hWnd); * This function removes the specific style of the window * specified by \a hWnd. * - * Since 5.0.0, only the customizable window styles (bits in WS_CTRLMASK) - * can be changed by calling this function. + * Note that you should be very careful with changing the styles of a window + * on the fly by calling this function. You are strongly recommended to only + * change the customizable window styles (bits in WS_CTRLMASK) by calling + * this function. * * \param hWnd The handle to the window. * \param dwStyle The specific style which will be removed. @@ -7667,8 +7669,10 @@ MG_EXPORT BOOL GUIAPI ExcludeWindowStyle (HWND hWnd, DWORD dwStyle); * This function includes the specific style of the window * specified by \a hWnd. * - * Since 5.0.0, only the customizable window styles (bits in WS_CTRLMASK) - * can be changed by calling this function. + * Note that you should be very careful with changing the styles of a window + * on the fly by calling this function. You are strongly recommended to only + * change the customizable window styles (bits in WS_CTRLMASK) by calling + * this function. * * \param hWnd The handle to the window. * \param dwStyle The specific style which will be included. @@ -7685,9 +7689,10 @@ MG_EXPORT BOOL GUIAPI IncludeWindowStyle (HWND hWnd, DWORD dwStyle); * This function removes the specific extended style of the window * specified by \a hWnd. * - * Since 5.0.0, only the customizable window extended styles (bits in - * WS_EX_CONTROL_MASK | WS_EX_CONTROL_MASK) can be changed by calling - * this function. + * Note that you should be very careful with changing the extended styles of + * a window on the fly by calling this function. You are strongly recommended + * to only change the customizable window styles (bits in + * WS_EX_CONTROL_MASK | WS_EX_CONTROL_MASK) by calling this function. * * \param hWnd The handle to the window. * \param dwStyle The specific extended style which will be removed. @@ -7704,9 +7709,10 @@ MG_EXPORT BOOL GUIAPI ExcludeWindowExStyle (HWND hWnd, DWORD dwStyle); * This function includes the specific extended style of the window * specified by \a hWnd. * - * Since 5.0.0, only the customizable window extended styles (bits in - * WS_EX_CONTROL_MASK | WS_EX_CONTROL_MASK) can be changed by calling - * this function. + * Note that you should be very careful with changing the extended styles of + * a window on the fly by calling this function. You are strongly recommended + * to only change the customizable window styles (bits in + * WS_EX_CONTROL_MASK | WS_EX_CONTROL_MASK) by calling this function. * * \param hWnd The handle to the window. * \param dwStyle The specific extended style which will be included. diff --git a/src/gui/window.c b/src/gui/window.c index 788ecd95..2649c2b7 100644 --- a/src/gui/window.c +++ b/src/gui/window.c @@ -4989,13 +4989,8 @@ BOOL GUIAPI ExcludeWindowStyle (HWND hWnd, DWORD dwStyle) MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), FALSE); pWin = MG_GET_WINDOW_PTR (hWnd); - dwStyle &= WS_CTRLMASK; - if (dwStyle) { - pWin->dwStyle &= ~dwStyle; - return TRUE; - } - - return FALSE; + pWin->dwStyle &= ~dwStyle; + return TRUE; } BOOL GUIAPI IncludeWindowStyle (HWND hWnd, DWORD dwStyle) @@ -5005,13 +5000,8 @@ BOOL GUIAPI IncludeWindowStyle (HWND hWnd, DWORD dwStyle) MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), FALSE); pWin = MG_GET_WINDOW_PTR (hWnd); - dwStyle &= WS_CTRLMASK; - if (dwStyle) { - pWin->dwStyle |= dwStyle; - return TRUE; - } - - return FALSE; + pWin->dwStyle |= dwStyle; + return TRUE; } DWORD GUIAPI GetWindowExStyle (HWND hWnd) @@ -5031,13 +5021,8 @@ BOOL GUIAPI ExcludeWindowExStyle (HWND hWnd, DWORD dwStyle) MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), FALSE); pWin = MG_GET_WINDOW_PTR (hWnd); - dwStyle &= (WS_EX_CONTROL_MASK | WS_EX_CONTROL_MASK); - if (dwStyle) { - pWin->dwExStyle &= ~dwStyle; - return TRUE; - } - - return FALSE; + pWin->dwExStyle &= ~dwStyle; + return TRUE; } BOOL GUIAPI IncludeWindowExStyle (HWND hWnd, DWORD dwStyle) @@ -5047,13 +5032,8 @@ BOOL GUIAPI IncludeWindowExStyle (HWND hWnd, DWORD dwStyle) MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), FALSE); pWin = MG_GET_WINDOW_PTR (hWnd); - dwStyle &= (WS_EX_CONTROL_MASK | WS_EX_CONTROL_MASK); - if (dwStyle) { - pWin->dwExStyle |= dwStyle; - return TRUE; - } - - return FALSE; + pWin->dwExStyle |= dwStyle; + return TRUE; } DWORD GUIAPI GetWindowAdditionalData (HWND hWnd)