//private void CreateDesktopBuddy(Buddy buddy, Point? point) //{ // MessageCenter.MessageFilter messageFilter = null; // DesktopBuddy buddy2 = null; // object obj2 = CoreMessenger.Instance.WindowManager.FireEvent("DesktopBuddy", WindowEvent.FindWindow, buddy, null); // if (obj2 is DesktopBuddy) // { // buddy2 = (DesktopBuddy)obj2; // if (point.HasValue) // { // buddy2.MoveTo(point.Value); // } // } // else // { // ContactSession contactSession = this._contactSessionManager.GetContactSession(buddy.Uin, true); // buddy2 = new DesktopBuddy(buddy, contactSession, point); // if (messageFilter == null) // { // messageFilter = delegate(IAPro.Core.Message message) // { // if (message.Type == IAPro.Core.MessageType.ContactMessage) // { // ContactMessage message2 = message as ContactMessage; // if (message2.Uin == buddy.Uin) // { // return true; // } // } // return false; // }; // } // foreach (IAPro.Core.Message message in this._messageCenter.PopMessages(messageFilter, true)) // { // buddy2.ReceiveMessage(contactSession, message); // } // } // buddy2.Show(); //} public static void FlashConversationWindow(Window win) { if (!win.IsActive) { WinAPI.FLASHWINFO flashwinfo; flashwinfo = new WinAPI.FLASHWINFO { //cbSize = (uint)Marshal.SizeOf(flashwinfo), hwnd = new WindowInteropHelper(win).Handle, dwFlags = 2, uCount = 3, dwTimeout = 400 }; WinAPI.FlashWindowEx(ref flashwinfo); } }
public MainForm() { InitializeComponent(); // タスクバー点滅用 構造体 準備 fInfo = new WinAPI.FLASHWINFO(); fInfo.cbSize = Convert.ToUInt32(Marshal.SizeOf(fInfo)); fInfo.hwnd = this.Handle; fInfo.dwFlags = WinAPI.FLASHWFLAGS.FLASHW_ALL | WinAPI.FLASHWFLAGS.FLASHW_TIMERNOFG; fInfo.uCount = 0; fInfo.dwTimeout = 0; // フォーム位置の復元 if (AppSetting.IsLoad && !AppSetting.MainFormSize.IsEmpty) { this.Size = AppSetting.MainFormSize; this.DesktopLocation = AppSetting.MainFormLocation; } else { this.StartPosition = FormStartPosition.WindowsDefaultLocation; } this.MaximumSize = new Size(int.MaxValue, this.Height); startTime = DateTime.Now; endTime = startTime; exit = false; setRadioButton(); preCheckTime = !AppSetting.RecordTimeEnable || checkRecordTime(endTime.TimeOfDay); if (preCheckTime) { recordStart(); } else { recordStop(); } setActivate(AppSetting.Activate); // 記録タイマ開始 timer1.Enabled = true; }
static void Main() { #region alphaBuildWarning if (RAFManagerUpdater.Versioning.CurrentVersion.flags != "") { Console.WriteLine("Note: This is a beta/alpha build of RAF Manager. Not all features have been"); Console.WriteLine(" thoroughly tested. Expect the worst to happen. You will be accessing"); Console.WriteLine(" the nightly build updates. You may choose to update to them if you wish,"); Console.WriteLine(" though you must realize that there WILL occasionally be bugs stuck into"); Console.WriteLine(" the nightly, which might take a while [a day or two] to fix... Since"); Console.WriteLine(" you are working with a different directory than your normal RAF Manager"); Console.WriteLine(" RC, the backup directories will be different to, so if you pack a file"); Console.WriteLine(" with 1 build, you can't revert that pack with the beta. "); Console.WriteLine(""); Console.WriteLine("If you plan on using the 'add to archive' feature, you must go to options and"); Console.WriteLine("check the big checkbox. To restore you MUST do this too!"); Console.WriteLine("I am working on a prettier file browser for others to use... Release TBA..."); Console.WriteLine(""); Console.WriteLine("Build Timestamp: " + RAFManagerUpdater.Versioning.CurrentVersion.ApproximateBuildTime); } #endregion /* * RMPropInterpreter interpreter = new RMPropInterpreter( * File.ReadAllLines(@"C:\LoLModProjects\colorblindnomore_u3_v3\rafmanagerproperties") * ); * Console.WriteLine("-------"); * interpreter.RunPacktimeCommand(); * Console.WriteLine("-------"); * interpreter.RunRestoreTimeCommand(); * return; */ #region check for duplicate instances Process[] dupes = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName); if (dupes.Length != 1) { //This doesn't always work. if (dupes[0] != Process.GetCurrentProcess()) { Console.WriteLine("This application is already open. Setting focus to other application's main window"); Console.WriteLine("MWT: " + dupes[0].MainWindowTitle); Rectangle rect = ItzWarty.WinAPI.GetWindowRect(dupes[0].MainWindowHandle); WinAPI.MoveWindow(dupes[0].MainWindowHandle, (Screen.PrimaryScreen.Bounds.Width - rect.Width) / 2, (Screen.PrimaryScreen.Bounds.Height - rect.Height) / 2, rect.Width, rect.Height, true ); WinAPI.ShowWindow(dupes[0].MainWindowHandle, ItzWarty.WinAPI.ShowWindowParam.SW_SHOWNORMAL); WinAPI.SetForegroundWindow(dupes[0].MainWindowHandle); WinAPI.FLASHWINFO fwInfo = new WinAPI.FLASHWINFO(); fwInfo.cbSize = (UInt32)Marshal.SizeOf(fwInfo); fwInfo.hwnd = dupes[0].MainWindowHandle; fwInfo.dwFlags = WinAPI.FLASHW_TRAY | WinAPI.FLASHW_CAPTION; fwInfo.uCount = 2; fwInfo.dwTimeout = 0; WinAPI.FlashWindowEx(ref fwInfo); //ItzWarty.WinAPI.SetFocus(dupes[0].MainWindowHandle); Application.Exit(); Environment.Exit(0); } } #endregion Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //Application.Run(new RAFManagerCleanWizard()); new RAFManagerClass(new MainForm()); }