當前位置: 首頁>>代碼示例>>C#>>正文


C# IntPtr.ToLoWord方法代碼示例

本文整理匯總了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;
		}
開發者ID:mntone,項目名稱:Windows.PerMonitorDpiSupport,代碼行數:30,代碼來源:PerMonitorDpiSupportWindow.cs

示例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;
        }
開發者ID:mntone,項目名稱:Fluent.Ribbon,代碼行數:23,代碼來源:WindowSizing.cs

示例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;
        }
開發者ID:nirvaeld,項目名稱:KanColleViewer,代碼行數:12,代碼來源:MetroWindow.cs

示例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;
        }
開發者ID:Grabacr07,項目名稱:MetroRadiance,代碼行數:29,代碼來源:MetroWindow.cs


注:本文中的System.IntPtr.ToLoWord方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。