Hey Hyperz... Another question. Is this how you extended the frame into the client area?

PHP Code: 
[StructLayout(LayoutKind.Sequential)]
public 
struct MARGINS
{
    public 
int cxLeftWidth;      // width of left border that retains its size
    
public int cxRightWidth;     // width of right border that retains its size
    
public int cyTopHeight;      // height of top border that retains its size
    
public int cyBottomHeight;   // height of bottom border that retains its size
};


[
DllImport("DwmApi.dll")]
public static 
extern int DwmExtendFrameIntoClientArea(
    
IntPtr hwnd,
    
ref MARGINS pMarInset); 
or

PHP Code: 
void OnLoaded(object senderRoutedEventArgs e)
{
   try
   {
      
// Obtain the window handle for WPF application
      
IntPtr mainWindowPtr = new WindowInteropHelper(this).Handle;
      
HwndSource mainWindowSrc HwndSource.FromHwnd(mainWindowPtr);
      
mainWindowSrc.CompositionTarget.BackgroundColor Color.FromArgb(0000);

      
// Get System Dpi
      
System.Drawing.Graphics desktop System.Drawing.Graphics.FromHwnd(mainWindowPtr);
      
float DesktopDpiX desktop.DpiX;
      
float DesktopDpiY desktop.DpiY;

      
// Set Margins
      
NonClientRegionAPI.MARGINS margins = new NonClientRegionAPI.MARGINS();

      
// Extend glass frame into client area
      // Note that the default desktop Dpi is 96dpi. The  margins are
      // adjusted for the system Dpi.
      
margins.cxLeftWidth Convert.ToInt32(* (DesktopDpiX 96));
      
margins.cxRightWidth Convert.ToInt32(* (DesktopDpiX 96));
      
margins.cyTopHeight Convert.ToInt32(((int)topBar.ActualHeight 5) * (DesktopDpiX 96));
      
margins.cyBottomHeight Convert.ToInt32(* (DesktopDpiX 96));

      
int hr NonClientRegionAPI.DwmExtendFrameIntoClientArea(mainWindowSrc.Handleref margins);
      
//
      
if (hr 0)
      {
         
//DwmExtendFrameIntoClientArea Failed
      
}
   }
   
// If not Vista, paint background white.
   
catch (DllNotFoundException)
   {
      
Application.Current.MainWindow.Background Brushes.White;
   }

R4Z0R3 Reviewed by R4Z0R3 on . Hyperz.. I need your help. Hey Hyperz... Another question. Is this how you extended the frame into the client area? public struct MARGINS { public int cxLeftWidth; // width of left border that retains its size public int cxRightWidth; // width of right border that retains its size public int cyTopHeight; // height of top border that retains its size public int cyBottomHeight; // height of bottom border that retains its size }; Rating: 5