Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //reference Desktop Windows Manager (DWM API)
- [DllImport( "dwmapi.dll" )]
- static extern void DwmIsCompositionEnabled( ref bool pfEnabled );
- [DllImport( "dwmapi.dll" )]
- static extern int DwmExtendFrameIntoClientArea( IntPtr hWnd, ref MARGINS pMarInset );
- //then on form load
- //check for Vista
- if ( Environment.OSVersion.Version.Major >= 6 )
- {
- //check for support
- bool isGlassSupported = false;
- DwmIsCompositionEnabled( ref isGlassSupported );
- if ( isGlassSupported )
- DwmExtendFrameIntoClientArea( this.Handle, ref margins );
- ...
- //finally on print draw a black box over the alpha-ed area
- //Before SP1 you could also use a black form background
Add Comment
Please, Sign In to add comment