Author: gadamopoulos
Date: Tue Dec 9 22:01:46 2014
New Revision: 65599
URL:
http://svn.reactos.org/svn/reactos?rev=65599&view=rev
Log:
[EXPLORER]
* Make SetWindowStyle and SetWindowExStyle simple wrappers around SHSetWindowBits. There
is no reason to reinvent the wheel.
Modified:
trunk/reactos/base/shell/explorer/precomp.h
trunk/reactos/base/shell/explorer/util.cpp
Modified: trunk/reactos/base/shell/explorer/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/precom…
==============================================================================
--- trunk/reactos/base/shell/explorer/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/precomp.h [iso-8859-1] Tue Dec 9 22:01:46 2014
@@ -56,15 +56,23 @@
* explorer.c
*/
+static inline
LONG
SetWindowStyle(IN HWND hWnd,
IN LONG dwStyleMask,
-IN LONG dwStyle);
-
+IN LONG dwStyle)
+{
+ return SHSetWindowBits(hWnd, GWL_STYLE, dwStyleMask, dwStyle);
+}
+
+static inline
LONG
SetWindowExStyle(IN HWND hWnd,
IN LONG dwStyleMask,
-IN LONG dwStyle);
+IN LONG dwStyle)
+{
+ return SHSetWindowBits(hWnd, GWL_EXSTYLE, dwStyleMask, dwStyle);
+}
HMENU
LoadPopupMenu(IN HINSTANCE hInstance,
Modified: trunk/reactos/base/shell/explorer/util.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/util.c…
==============================================================================
--- trunk/reactos/base/shell/explorer/util.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/util.cpp [iso-8859-1] Tue Dec 9 22:01:46 2014
@@ -28,50 +28,6 @@
/* We're dealing with the same object if the IUnknown pointers are equal */
return (punk1 == punk2) ? S_OK : S_FALSE;
-}
-
-LONG
-SetWindowStyle(IN HWND hWnd,
- IN LONG dwStyleMask,
- IN LONG dwStyle)
-{
- LONG PrevStyle, Style;
-
- ASSERT((~dwStyleMask & dwStyle) == 0);
-
- PrevStyle = GetWindowLong(hWnd, GWL_STYLE);
- if (PrevStyle != 0 &&
- (PrevStyle & dwStyleMask) != dwStyle)
- {
- Style = PrevStyle & ~dwStyleMask;
- Style |= dwStyle;
-
- PrevStyle = SetWindowLong(hWnd, GWL_STYLE, Style);
- }
-
- return PrevStyle;
-}
-
-LONG
-SetWindowExStyle(IN HWND hWnd,
- IN LONG dwStyleMask,
- IN LONG dwStyle)
-{
- LONG PrevStyle, Style;
-
- ASSERT((~dwStyleMask & dwStyle) == 0);
-
- PrevStyle = GetWindowLong(hWnd, GWL_EXSTYLE);
- if (PrevStyle != 0 &&
- (PrevStyle & dwStyleMask) != dwStyle)
- {
- Style = PrevStyle & ~dwStyleMask;
- Style |= dwStyle;
-
- PrevStyle = SetWindowLong(hWnd, GWL_EXSTYLE, Style);
- }
-
- return PrevStyle;
}
HMENU