本文整理汇总了C#中System.Windows.Interop.WindowInteropHelper.ToInt32方法的典型用法代码示例。如果您正苦于以下问题:C# WindowInteropHelper.ToInt32方法的具体用法?C# WindowInteropHelper.ToInt32怎么用?C# WindowInteropHelper.ToInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Interop.WindowInteropHelper
的用法示例。
在下文中一共展示了WindowInteropHelper.ToInt32方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public override void Init()
{
SbsdkEvents.OnXYMove += new SBSDKComWrapperLib._ISBSDKBaseClass2Events_OnXYMoveEventHandler(this.OnXYMove);
SbsdkEvents.OnXYDown += new SBSDKComWrapperLib._ISBSDKBaseClass2Events_OnXYDownEventHandler(this.OnXYDown);
SbsdkEvents.OnXYUp += new SBSDKComWrapperLib._ISBSDKBaseClass2Events_OnXYUpEventHandler(this.OnXYUp);
var handle = new WindowInteropHelper(mainWindow).Handle;
var int_handle = handle.ToInt32();
Sbsdk.SBSDKAttachWithMsgWnd(int_handle, false, int_handle);
Sbsdk.SBSDKSetSendMouseEvents(handle.ToInt32(), _SBCSDK_MOUSE_EVENT_FLAG.SBCME_NEVER, -1);
HwndSource.FromHwnd(handle).AddHook(new_message);
_backgrounndThreadStart = new ThreadStart(RaiseEvents);
_backgroundThread = new Thread(_backgrounndThreadStart);
//_backgroundThread.Start();
}
示例2: ShowWindowTopMost
public static void ShowWindowTopMost(System.Windows.Window Window)
{
IntPtr WindowHandle = new WindowInteropHelper(Window).Handle;
SetWindowPos(WindowHandle.ToInt32(),
HWND_TOPMOST,
Convert.ToInt32(Window.Left),
Convert.ToInt32(Window.Top),
Convert.ToInt32(Window.Width),
Convert.ToInt32(Window.Height),
SWP_SHOWWINDOW);
SetWindowPos(WindowHandle.ToInt32(),
HWND_NONTOPMOST,
Convert.ToInt32(Window.Left),
Convert.ToInt32(Window.Top),
Convert.ToInt32(Window.Width),
Convert.ToInt32(Window.Height),
SWP_SHOWWINDOW);
}