]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/windows/dwmapi/dwmapi.factor
some windows dwm api calls to play with
[factor.git] / basis / windows / dwmapi / dwmapi.factor
diff --git a/basis/windows/dwmapi/dwmapi.factor b/basis/windows/dwmapi/dwmapi.factor
new file mode 100755 (executable)
index 0000000..e7e0b4b
--- /dev/null
@@ -0,0 +1,28 @@
+! (c)2009 Joe Groff bsd license
+USING: alien.c-types alien.libraries alien.syntax classes.struct windows.types ;
+IN: windows.dwmapi
+
+STRUCT: MARGINS
+    { cxLeftWidth    int }
+    { cxRightWidth   int }
+    { cyTopHeight    int }
+    { cyBottomHeight int } ;
+
+STRUCT: DWM_BLURBEHIND
+    { dwFlags                DWORD   }
+    { fEnable                BOOL    }
+    { hRgnBlur               HANDLE  }
+    { fTransitionOnMaximized BOOL    } ;
+
+: <MARGINS> ( l r t b -- MARGINS )
+    MARGINS <struct-boa> ; inline
+
+: full-window-margins ( -- MARGINS )
+    -1 -1 -1 -1 <MARGINS> ; inline
+
+<< "dwmapi" "dwmapi.dll" "stdcall" add-library >>
+
+LIBRARY: dwmapi
+
+FUNCTION: HRESULT DwmExtendFrameIntoClientArea ( HWND hWnd, MARGINS* pMarInset ) ;
+FUNCTION: HRESULT DwmEnableBlurBehindWindow ( HWND hWnd, DWM_BLURBEHIND* pBlurBehind ) ;