/// <summary> /// ウィンドウ選択開始 /// </summary> /// <exception cref="WindowSelectionStartException"></exception> public void StartWindowSelection() { try { if (Handle == System.IntPtr.Zero) { SelectedHwnd = System.IntPtr.Zero; FrameWindow = new FrameWindow { BackColor = ColorFrameWindow, Visible = false }; FrameWindow.Show(); HookCallback = MouseHookProcedure; Handle = NativeMethods.SetWindowsHookEx(14, HookCallback, System.Runtime.InteropServices.Marshal.GetHINSTANCE(System.Reflection.Assembly.GetEntryAssembly().GetModules()[0]), 0); // 14 = WH_MOUSE_LL if (Handle == System.IntPtr.Zero) { throw new System.ComponentModel.Win32Exception(); } } } catch { Dispose(); throw new WindowSelectionStartException(); } }
public override void Create() { JArray ja_elements = FrameWindow.SelectedWorkspaceCommon.jo ["ElementFiles"] as JArray; if (FrameWindow.jElements.FirstOrDefault(_ => _.Name == Name) == null) { string jsonName = MakeJsonName(); JObject jo = new JObject(); jo.Add("DocType", "Element"); jo.Add("Name", Name); jo.Add("File", jsonName); ja_elements.Add(jo); FrameWindow.SaveCommonFile(); CreateJson(MakeJsonName(), FrameWindow.SelectedWorkspaceCommon.Workspace, Name); FrameWindow.NeedRefresh = true; } else { PRDebug.TagLog(PGFrameWindow.lt, PGFrameWindow.lc, "该工作空间中已经含有名字: " + Name); } }
/// <summary> /// <p><span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span></p> /// <p>Adds a child to this window, for shutdown purposes.</p> /// </summary> /// <param name="child">the child window to associate with this window</param> public void AddChildWindow(FrameWindow child) { lock (childWindows_) { childWindows_.Add(child); } }
/// <summary> /// 破棄 /// </summary> private void Dispose() { if (FrameWindow != null) { FrameWindow.Close(); FrameWindow.Dispose(); FrameWindow = null; } }
public FrameWindow CreateFrameWindow(string type, string name) { IntPtr cPtr = CeguiBindingsPINVOKE.WindowManager_CreateFrameWindow(swigCPtr, new CeguiDotNet.String(type).HandleRef, new CeguiDotNet.String(name).HandleRef); FrameWindow ret = (cPtr == IntPtr.Zero) ? null : new FrameWindow(cPtr, false); if (CeguiBindingsPINVOKE.SWIGPendingException.Pending) { throw CeguiBindingsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
/// <summary> /// /// </summary> private FrameWindow GetFrameWindow() { FrameWindow window = base.NamedDependencyObjects["FrameWindow"] as FrameWindow; if (window == null) { Dialog.ShowMessage("Error Message", "Not found FrameWindow", MessageBoxButton.OK); } return(window); }
private void HandlePackage() { uint curFrameNum = Singleton <FrameSynchr> .GetInstance().CurFrameNum; while (!MonoSingleton <GameLoader> .GetInstance().isLoadStart&& this._pkgQueue.get_Count() > 0) { object obj = this._pkgQueue.Peek(); CSDT_FRAPBOOT_INFO cSDT_FRAPBOOT_INFO = obj as CSDT_FRAPBOOT_INFO; if (cSDT_FRAPBOOT_INFO != null) { if (cSDT_FRAPBOOT_INFO.dwKFrapsNo > this.EndFrameNo || cSDT_FRAPBOOT_INFO.dwKFrapsNo <= curFrameNum || cSDT_FRAPBOOT_INFO.dwKFrapsNo > curFrameNum + 60u) { break; } this._pkgQueue.Dequeue(); FrameWindow.HandleFraqBootInfo(cSDT_FRAPBOOT_INFO); } else { this._pkgQueue.Dequeue(); CSPkg cSPkg = obj as CSPkg; NetMsgDelegate msgHandler = Singleton <NetworkModule> .GetInstance().GetMsgHandler(cSPkg.stPkgHead.dwMsgID); if (msgHandler != null) { try { Singleton <GameReplayModule> .instance.CacheRecord(cSPkg); msgHandler(cSPkg); } catch (Exception var_5_BA) { } } } } if (this.SpeedRate > 1 && this.EndFrameNo < curFrameNum + 120u) { this.SpeedRate = 1; } }
private void HandlePackage() { uint curFrameNum = Singleton <FrameSynchr> .GetInstance().CurFrameNum; while (!MonoSingleton <GameLoader> .GetInstance().isLoadStart&& (this._pkgQueue.Count > 0)) { object obj2 = this._pkgQueue.Peek(); CSDT_FRAPBOOT_INFO fbid = obj2 as CSDT_FRAPBOOT_INFO; if (fbid != null) { if (((fbid.dwKFrapsNo > this.EndFrameNo) || (fbid.dwKFrapsNo <= curFrameNum)) || (fbid.dwKFrapsNo > (curFrameNum + 60))) { break; } this._pkgQueue.Dequeue(); FrameWindow.HandleFraqBootInfo(fbid); } else { this._pkgQueue.Dequeue(); CSPkg msg = obj2 as CSPkg; NetMsgDelegate msgHandler = Singleton <NetworkModule> .GetInstance().GetMsgHandler(msg.stPkgHead.dwMsgID); if (msgHandler != null) { try { msgHandler(msg); continue; } catch (Exception) { continue; } } } } if ((this.SpeedRate > 1) && (this.EndFrameNo < (curFrameNum + 120))) { this.SpeedRate = 1; } }
private void StopSelectWindow(Window window) { Focusable = false; ReleaseMouseCapture(); Mouse.OverrideCursor = null; Image.Source = _defaultImageSource; _currentWindowHwnd = IntPtr.Zero; _currentWindow = null; if (_currentFrameWindow != null) { _currentFrameWindow.Hide(); _currentFrameWindow.Close(); _currentFrameWindow = null; } OnEndSelectWindow(new RoutedWindowEventArgs(EndSelectWindowEvent, window)); }
/// <summary> /// /// </summary> /// <param name="type"></param> private void OnSwitchContent(ContentType type) { FrameWindow window = this.GetFrameWindow(); if (window == null) { return; } switch (type) { case ContentType.Login: window.HideOverlay(); window.ShowOverlay(new Views.LoginContent()); break; case ContentType.Check: window.HideOverlay(); window.ShowOverlay(new Views.CheckContent()); break; case ContentType.Main: window.HideOverlay(); window.MenuItems = new Wpf.Controls.MenuItemCollection() { new Wpf.Controls.MenuItem() { Name = "구독", Source = new Uri("pack://application:,,,/Inse.Fiproject.Subscription;component/Views/SubscriptionFrame.xaml") } }; window.HomeUri = new Uri("pack://application:,,,/Inse.Fiproject.Home;component/Views/HomeFrame.xaml"); window.SettingsUri = new Uri("pack://application:,,,/Inse.Fiproject.Settings;component/Views/SettingsFrame.xaml"); break; } }
protected override void OnMouseMove(MouseEventArgs e) { // do not run unless we are actually selecting a window. if (!Focusable) { return; } var pos = new POINT(); if (!GetCursorPos(ref pos)) { return; } var hwnd = WindowFromPoint(pos); if (_currentFrameWindow != null && hwnd == _currentFrameWindow.Hwnd) { return; } // select the main window. while (true) { var parentHwnd = GetParent(hwnd); if (parentHwnd == IntPtr.Zero) { break; } hwnd = parentHwnd; } if (hwnd == _currentWindowHwnd) { return; } int processId; var threadId = GetWindowThreadProcessId(hwnd, out processId); var process = Process.GetProcessById(processId); _currentWindow = new Window { Hwnd = hwnd, Process = process, }; _currentWindowHwnd = hwnd; _canSelectCurrentWindow = _selfProcessId != processId; if (_canSelectCurrentWindow) { try { var path = _currentWindow.Process.MainModule.FileName; _canSelectCurrentWindow = Path.GetFileName(path) != "explorer.exe"; } catch (Win32Exception) { // NB when this application is not running in 64-bit we'll get a: // System.ComponentModel.Win32Exception // A 32 bit processes cannot access modules of a 64 bit process. _canSelectCurrentWindow = false; } } if (_canSelectCurrentWindow) { RECT rect; if (GetWindowRect(hwnd, out rect)) { if (_currentFrameWindow == null) { _currentFrameWindow = new FrameWindow(); } _currentFrameWindow.Hide(); _currentFrameWindow.Resize(rect); } else { _canSelectCurrentWindow = false; } } if (_currentFrameWindow != null) { if (_canSelectCurrentWindow) { _currentFrameWindow.Show(); } else { _currentFrameWindow.Hide(); } } OnSelectWindow(new RoutedWindowEventArgs(SelectWindowEvent, _canSelectCurrentWindow ? _currentWindow : null)); }
public void OnEnable() { instance = this; levelGenerator = LevelGenerator.instance; }