本文整理匯總了C#中System.IntPtr.CastToInt32方法的典型用法代碼示例。如果您正苦於以下問題:C# IntPtr.CastToInt32方法的具體用法?C# IntPtr.CastToInt32怎麽用?C# IntPtr.CastToInt32使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.IntPtr
的用法示例。
在下文中一共展示了IntPtr.CastToInt32方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SourceHook
protected virtual IntPtr SourceHook(IntPtr hWnd, int message, IntPtr wParam, IntPtr lParam, ref bool handled)
{
if (handled)
{
return IntPtr.Zero;
}
switch ((WM)message)
{
case WM.SYSCHAR:
case WM.SYSKEYDOWN:
case WM.SYSKEYUP:
case WM.KEYDOWN:
case WM.KEYUP:
case WM.CHAR:
case WM.IME_CHAR:
if (!IsKeyboardFocused)
{
break;
}
if (message == (int)WM.SYSKEYDOWN &&
wParam.ToInt32() == KeyInterop.VirtualKeyFromKey(Key.F4))
{
// We don't want CEF to receive this event (and mark it as handled), since that makes it impossible to
// shut down a CefSharp-based app by pressing Alt-F4, which is kind of bad.
return IntPtr.Zero;
}
handled = managedCefBrowserAdapter.SendKeyEvent(message, wParam.CastToInt32(), lParam.CastToInt32());
break;
}
return IntPtr.Zero;
}