]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/windows/dwmapi/dwmapi.factor
reset frame inset when windows dwm is toggled off and on, and use the system dialog...
[factor.git] / basis / windows / dwmapi / dwmapi.factor
index e7e0b4b8efc9e89f882a21cfd14cea313f07a028..998846ebc2bbe272ab9a9abb8cc029ad1b87ee88 100755 (executable)
@@ -1,5 +1,6 @@
 ! (c)2009 Joe Groff bsd license
-USING: alien.c-types alien.libraries alien.syntax classes.struct windows.types ;
+USING: alien.c-types alien.data alien.libraries alien.syntax
+classes.struct kernel math system-info.windows windows.types ;
 IN: windows.dwmapi
 
 STRUCT: MARGINS
@@ -26,3 +27,11 @@ LIBRARY: dwmapi
 
 FUNCTION: HRESULT DwmExtendFrameIntoClientArea ( HWND hWnd, MARGINS* pMarInset ) ;
 FUNCTION: HRESULT DwmEnableBlurBehindWindow ( HWND hWnd, DWM_BLURBEHIND* pBlurBehind ) ;
+FUNCTION: HRESULT DwmIsCompositionEnabled ( BOOL* pfEnabled ) ;
+
+CONSTANT: WM_DWMCOMPOSITIONCHANGED HEX: 31E
+
+: composition-enabled? ( -- ? )
+    windows-major 6 >=
+    [ 0 <int> [ DwmIsCompositionEnabled drop ] keep *int c-bool> ]
+    [ f ] if ;