本文整理汇总了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;
}