Results 1 to 1 of 1
Hybrid View
-
4th Jun 2010, 05:25 AM #1OPMemberWebsite's:
mourya.comHyperz.. I need your help.
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);
PHP Code:void OnLoaded(object sender, RoutedEventArgs 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(0, 0, 0, 0);
// 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(5 * (DesktopDpiX / 96));
margins.cxRightWidth = Convert.ToInt32(5 * (DesktopDpiX / 96));
margins.cyTopHeight = Convert.ToInt32(((int)topBar.ActualHeight + 5) * (DesktopDpiX / 96));
margins.cyBottomHeight = Convert.ToInt32(5 * (DesktopDpiX / 96));
int hr = NonClientRegionAPI.DwmExtendFrameIntoClientArea(mainWindowSrc.Handle, ref 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
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Review Hyperz.net
By ServSilla in forum Site ReviewsReplies: 10Last Post: 17th Mar 2011, 05:20 PM -
[Selling] Hyperz.net & PSRevolution.net
By ServSilla in forum Completed TransactionsReplies: 2Last Post: 15th Mar 2011, 03:19 AM -
C# help (jayfella / hyperz)
By litewarez in forum Web Development AreaReplies: 30Last Post: 25th Jun 2010, 10:04 PM -
Hyperz.. I need your help.
By R4Z0R3 in forum Technical Help Desk SupportReplies: 8Last Post: 3rd Jun 2010, 02:52 AM
themaCreator - create posts from...
Version 3.45 released. Open older version (or...