public void SetWindowFocus(WindowSelection windowSelection) { switch (windowSelection) { case WindowSelection.MAME: var MameProc = Process.GetProcessesByName("mame").FirstOrDefault(); if (MameProc != null) { IntPtr intPtrM = MameProc.MainWindowHandle; SetFocus(intPtrM); } break; case WindowSelection.FrontEnd: var FeProc = Process.GetProcessesByName("FrontEnd").FirstOrDefault(); if (FeProc != null) { IntPtr intPtrFE = FeProc.MainWindowHandle; SetFocus(intPtrFE); } break; default: break; } }
public bool SetForeGroundWindw(WindowSelection windowSelection) { switch (windowSelection) { case WindowSelection.MAME: var procM = Process.GetProcessesByName("mame").FirstOrDefault(); IntPtr intPtrM = IntPtr.Zero; if (procM != null) { intPtrM = procM.MainWindowHandle; } return(SetForegroundWindow(intPtrM)); case WindowSelection.FrontEnd: var procFE = Process.GetProcessesByName("FrontEnd").FirstOrDefault(); IntPtr intPtrFE = IntPtr.Zero; if (procFE != null) { intPtrFE = procFE.MainWindowHandle; } return(SetForegroundWindow(intPtrFE)); default: break; } return(false); }
public bool ShowWindow(WindowSelection windowSelection) { bool shown = false; switch (windowSelection) { case WindowSelection.MAME: var procM = Process.GetProcessesByName("mame").FirstOrDefault(); if (procM != null) { IntPtr intPtrM = procM.MainWindowHandle; shown = ShowWindowAsync(intPtrM, (int)ShowWindowCommands.Restore); } break; case WindowSelection.FrontEnd: var procFE = Process.GetProcessesByName("FrontEnd").FirstOrDefault(); if (procFE != null) { IntPtr intPtrFE = procFE.MainWindowHandle; shown = ShowWindowAsync(intPtrFE, (int)ShowWindowCommands.Restore); } break; default: break; } return(shown); }
private void cancelButton_Click(object sender, EventArgs e) { selection = WindowSelection.CANCEL; this.Hide(); }
private void rejectButton_Click(object sender, EventArgs e) { selection = WindowSelection.REJECT; this.Hide(); }
private void nextButton_Click(object sender, EventArgs e) { selection = WindowSelection.NEXT; this.Hide(); }