本文整理匯總了C#中System.IntPtr.ToLoWord方法的典型用法代碼示例。如果您正苦於以下問題:C# IntPtr.ToLoWord方法的具體用法?C# IntPtr.ToLoWord怎麽用?C# IntPtr.ToLoWord使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.IntPtr
的用法示例。
在下文中一共展示了IntPtr.ToLoWord方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: WindowProcedure
private IntPtr WindowProcedure(IntPtr hwnd, int message, IntPtr wParam, IntPtr lParam, ref bool handled)
{
var lresult = IntPtr.Zero;
switch ((WindowMessage)message)
{
case WindowMessage.NonClientAreaHitTest:
handled = true;
lresult = OnNonClientAreaHitTest(hwnd, message, wParam, lParam);
break;
case WindowMessage.DpiChanged:
{
var dpiX = wParam.ToLoWord();
var dpiY = wParam.ToHiWord();
var suggested = (NativeRect)System.Runtime.InteropServices.Marshal.PtrToStructure(lParam, typeof(NativeRect));
this.OnDpiChanged(new Dpi(dpiX, dpiY), suggested);
handled = true;
break;
}
case WindowMessage.EnterSizeMove:
this.OnEnterSizeMove();
break;
case WindowMessage.ExitSizeMove:
this.OnExitSizeMove();
break;
}
return lresult;
}
示例2: HwndHook
private IntPtr HwndHook(IntPtr hWnd, int message, IntPtr wParam, IntPtr lParam, ref bool handled)
{
var returnval = IntPtr.Zero;
switch (message)
{
case Constants.WM_DPICHANGED:
if (this.isPerMonitorDpiSupported)
{
var dpiX = wParam.ToLoWord();
var dpiY = wParam.ToHiWord();
this.ChangeDpi(new Dpi(dpiX, dpiY));
handled = true;
}
break;
case Constants.WM_NCLBUTTONDOWN:
this.window.isSystemMenuOpened = false;
break;
}
return returnval;
}
示例3: WndProc
private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
if (msg == (int)WM.DPICHANGED)
{
var dpiX = wParam.ToHiWord();
var dpiY = wParam.ToLoWord();
this.ChangeDpi(new Dpi(dpiX, dpiY));
handled = true;
}
return IntPtr.Zero;
}
示例4: WndProc
private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
if (msg == (int)WM.NCHITTEST)
{
if (this.ResizeMode == ResizeMode.CanResizeWithGrip
&& this.WindowState == WindowState.Normal
&& this.resizeGrip != null)
{
var ptScreen = lParam.ToPoint();
var ptClient = this.resizeGrip.PointFromScreen(ptScreen);
var rectTarget = new Rect(0, 0, this.resizeGrip.ActualWidth, this.resizeGrip.ActualHeight);
if (rectTarget.Contains(ptClient))
{
handled = true;
return (IntPtr)HitTestValues.HTBOTTOMRIGHT;
}
}
}
else if (msg == (int)WM.DPICHANGED)
{
var dpiX = wParam.ToLoWord();
var dpiY = wParam.ToHiWord();
this.ChangeDpi(new Dpi(dpiX, dpiY));
handled = true;
}
return IntPtr.Zero;
}