本文整理匯總了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);
}