Home | History | Annotate | Download | only in include
      1 /*
      2  * dwmapi.h
      3  *
      4  * Some dwmapi.dll exported functions such as
      5  *   DwmFlush
      6  *   DwmAttachMilContent
      7  *   DwmDetachMilContent
      8  * are not declared in this header for not being documented by Microsoft
      9  *
     10  */
     11 
     12 #ifndef __WINAPI_DWMAPI_H
     13 #define __WINAPI_DWMAPI_H
     14 
     15 #include <wtypes.h>
     16 
     17 /* for MARGINS structure declaration.  */
     18 #include <uxtheme.h>
     19 
     20 /*
     21  * This API is available only on Vista+ versions. It's not guarded by version check
     22  * because that would cause problems with Mozilla code (and MSVC doesn't seem to be
     23  * doing that as well).
     24  */
     25 
     26 #ifdef __cplusplus
     27 extern "C" {
     28 #endif
     29 
     30 /* FIXME: move to winuser.h */
     31 /* DWM messages.  */
     32 #define WM_DWMCOMPOSITIONCHANGED 0x031E
     33 #define WM_DWMNCRENDERINGCHANGED 0x031F
     34 #define WM_DWMCOLORIZATIONCOLORCHANGED 0x0320
     35 #define WM_DWMWINDOWMAXIMIZEDCHANGE 0x0321
     36 /* FIXME end */
     37 
     38 
     39 
     40 #define DWM_EC_DISABLECOMPOSITION 0
     41 #define DWM_EC_ENABLECOMPOSITION 1
     42 
     43 #define DWM_BB_ENABLE     0x00000001
     44 #define DWM_BB_BLURREGION 0x00000002
     45 #define DWM_BB_TRANSITIONONMAXIMIZED 0x00000004
     46 
     47 typedef struct _DWM_BLURBEHIND {
     48     DWORD dwFlags;
     49     BOOL fEnable;
     50     HRGN hRgnBlur;
     51     BOOL fTransitionOnMaximized;
     52 } DWM_BLURBEHIND, *PDWM_BLURBEHIND;
     53 
     54 typedef struct _UNSIGNED_RATIO {
     55     UINT32 uiNumerator;
     56     UINT32 uiDenominator;
     57 } UNSIGNED_RATIO;
     58 
     59 typedef enum _DWM_SOURCE_FRAME_SAMPLING {
     60     DWM_SOURCE_FRAME_SAMPLING_POINT = 1,
     61     DWM_SOURCE_FRAME_SAMPLING_COVERAGE,
     62     DWM_SOURCE_FRAME_SAMPLING_LAST
     63 } DWM_SOURCE_FRAME_SAMPLING;
     64 
     65 typedef ULONGLONG DWM_FRAME_COUNT;
     66 
     67 typedef struct _DWM_PRESENT_PARAMETERS {
     68     UINT32 cbSize;
     69     BOOL fQueue;
     70     DWM_FRAME_COUNT cRefreshStart;
     71     UINT cBuffer;
     72     BOOL fUseSourceRate;
     73     UNSIGNED_RATIO rateSource;
     74     UINT cRefreshesPerFrame;
     75     DWM_SOURCE_FRAME_SAMPLING eSampling;
     76 } DWM_PRESENT_PARAMETERS;
     77 
     78 typedef ULONGLONG QPC_TIME;
     79 
     80 typedef struct _DWM_TIMING_INFO {
     81     UINT32 cbSize;
     82     UNSIGNED_RATIO rateRefresh;
     83     QPC_TIME qpcRefreshPeriod;
     84     UNSIGNED_RATIO rateCompose;
     85     QPC_TIME qpcVBlank;
     86     DWM_FRAME_COUNT cRefresh;
     87     UINT cDXRefresh;
     88     QPC_TIME qpcCompose;
     89     DWM_FRAME_COUNT cFrame;
     90     UINT cDXPresent;
     91     DWM_FRAME_COUNT cRefreshFrame;
     92     DWM_FRAME_COUNT cFrameSubmitted;
     93     UINT cDXPresentSubmitted;
     94     DWM_FRAME_COUNT cFrameConfirmed;
     95     UINT cDXPresentConfirmed;
     96     DWM_FRAME_COUNT cRefreshConfirmed;
     97     UINT cDXRefreshConfirmed;
     98     DWM_FRAME_COUNT cFramesLate;
     99     UINT cFramesOutstanding;
    100     DWM_FRAME_COUNT cFrameDisplayed;
    101     QPC_TIME qpcFrameDisplayed;
    102     DWM_FRAME_COUNT cRefreshFrameDisplayed;
    103     DWM_FRAME_COUNT cFrameComplete;
    104     QPC_TIME qpcFrameComplete;
    105     DWM_FRAME_COUNT cFramePending;
    106     QPC_TIME qpcFramePending;
    107     DWM_FRAME_COUNT cFramesDisplayed;
    108     DWM_FRAME_COUNT cFramesComplete;
    109     DWM_FRAME_COUNT cFramesPending;
    110     DWM_FRAME_COUNT cFramesAvailable;
    111     DWM_FRAME_COUNT cFramesDropped;
    112     DWM_FRAME_COUNT cFramesMissed;
    113     DWM_FRAME_COUNT cRefreshNextDisplayed;
    114     DWM_FRAME_COUNT cRefreshNextPresented;
    115     DWM_FRAME_COUNT cRefreshesDisplayed;
    116     DWM_FRAME_COUNT cRefreshesPresented;
    117     DWM_FRAME_COUNT cRefreshStarted;
    118     ULONGLONG cPixelsReceived;
    119     ULONGLONG cPixelsDrawn;
    120     DWM_FRAME_COUNT cBuffersEmpty;
    121 } DWM_TIMING_INFO;
    122 
    123 typedef enum _DWMWINDOWATTRIBUTE {
    124     DWMWA_NCRENDERING_ENABLED = 1,
    125     DWMWA_NCRENDERING_POLICY,
    126     DWMWA_TRANSITIONS_FORCEDISABLED,
    127     DWMWA_ALLOW_NCPAINT,
    128     DWMWA_CAPTION_BUTTON_BOUNDS,
    129     DWMWA_NONCLIENT_RTL_LAYOUT,
    130     DWMWA_FORCE_ICONIC_REPRESENTATION,
    131     DWMWA_FLIP3D_POLICY,
    132     DWMWA_EXTENDED_FRAME_BOUNDS,
    133     DWMWA_LAST
    134 } DWMWINDOWATTRIBUTE;
    135 
    136 #define DWM_TNP_RECTDESTINATION 0x00000001
    137 #define DWM_TNP_RECTSOURCE      0x00000002
    138 #define DWM_TNP_OPACITY         0x00000004
    139 #define DWM_TNP_VISIBLE         0x00000008
    140 #define DWM_TNP_SOURCECLIENTAREAONLY 0x00000010
    141 
    142 typedef struct _DWM_THUMBNAIL_PROPERTIES {
    143     DWORD dwFlags;
    144     RECT rcDestination;
    145     RECT rcSource;
    146     BYTE opacity;
    147     BOOL fVisible;
    148     BOOL fSourceClientAreaOnly;
    149 } DWM_THUMBNAIL_PROPERTIES, *PDWM_THUMBNAIL_PROPERTIES;
    150 
    151 typedef enum _DWMFLIP3DWINDOWPOLICY {
    152     DWMFLIP3D_DEFAULT,
    153     DWMFLIP3D_EXCLUDEBELOW,
    154     DWMFLIP3D_EXCLUDEABOVE
    155 } DWMFLIP3DWINDOWPOLICY;
    156 
    157 typedef enum _DWMNCRENDERINGPOLICY {
    158     DWMNCRP_USEWINDOWSTYLE,
    159     DWMNCRP_DISABLED,
    160     DWMNCRP_ENABLED,
    161     DWMNCRP_LAST
    162 } DWMNCRENDERINGPOLICY;
    163 
    164 typedef HANDLE HTHUMBNAIL;
    165 typedef HTHUMBNAIL* PHTHUMBNAIL;
    166 
    167 BOOL WINAPI DwmDefWindowProc(
    168     HWND hwnd,
    169     UINT msg,
    170     WPARAM wParam,
    171     LPARAM lParam,
    172     LRESULT *plResult
    173 );
    174 
    175 HRESULT WINAPI DwmEnableBlurBehindWindow(
    176     HWND hWnd,
    177     const DWM_BLURBEHIND *pBlurBehind
    178 );
    179 
    180 HRESULT WINAPI DwmEnableComposition(
    181     UINT uCompositionAction
    182 );
    183 
    184 HRESULT WINAPI DwmEnableMMCSS(
    185     BOOL fEnableMMCSS
    186 );
    187 
    188 HRESULT WINAPI DwmExtendFrameIntoClientArea(
    189     HWND hWnd,
    190     const MARGINS *pMarInset
    191 );
    192 
    193 HRESULT WINAPI DwmGetColorizationColor(
    194     DWORD *pcrColorization,
    195     BOOL *pfOpaqueBlend
    196 );
    197 
    198 HRESULT WINAPI DwmGetCompositionTimingInfo(
    199     HWND hwnd,
    200     DWM_TIMING_INFO *pTimingInfo
    201 );
    202 
    203 HRESULT WINAPI DwmGetWindowAttribute(
    204     HWND hwnd,
    205     DWORD dwAttribute,
    206     PVOID pvAttribute,
    207     DWORD cbAttribute
    208 );
    209 
    210 HRESULT WINAPI DwmIsCompositionEnabled(
    211     BOOL *pfEnabled
    212 );
    213 
    214 HRESULT WINAPI DwmModifyPreviousDxFrameDuration(
    215     HWND hwnd,
    216     INT cRefreshes,
    217     BOOL fRelative
    218 );
    219 
    220 HRESULT WINAPI DwmQueryThumbnailSourceSize(
    221     HTHUMBNAIL hThumbnail,
    222     PSIZE pSize
    223 );
    224 
    225 HRESULT WINAPI DwmRegisterThumbnail(
    226     HWND hwndDestination,
    227     HWND *hwndSource,
    228     PHTHUMBNAIL phThumbnailId
    229 );
    230 
    231 HRESULT WINAPI DwmSetDxFrameDuration(
    232     HWND hwnd,
    233     INT cRefreshes
    234 );
    235 
    236 HRESULT WINAPI DwmSetPresentParameters(
    237     HWND hwnd,
    238     DWM_PRESENT_PARAMETERS *pPresentParams
    239 );
    240 
    241 HRESULT WINAPI DwmSetWindowAttribute(
    242     HWND hwnd,
    243     DWORD dwAttribute,
    244     LPCVOID pvAttribute,
    245     DWORD cbAttribute
    246 );
    247 
    248 HRESULT WINAPI DwmUnregisterThumbnail(
    249     HTHUMBNAIL hThumbnailId
    250 );
    251 
    252 HRESULT WINAPI DwmUpdateThumbnailProperties(
    253     HTHUMBNAIL hThumbnailId,
    254     const DWM_THUMBNAIL_PROPERTIES *ptnProperties
    255 );
    256 
    257 #ifdef __cplusplus
    258 }
    259 #endif
    260 
    261 #endif /* __WINAPI_DWMAPI_H */
    262 
    263