private void restoreBtn_Click(object sender, EventArgs e) { var princoneHwnd = Win32Wrapper.GetWindowHandle(PRICONNE_WND_CLASS, PRICONNE_WND_NAME); if ((int)princoneHwnd == 0) { MessageBox.Show(MSG_MESSAGE_START_GAME_FIST, MSG_TITLE_START_GAME_FIRST, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } Win32Wrapper.RestoreWindow(princoneHwnd); }
private void applyResolutionBtn_Click(object sender, EventArgs e) { var princoneHwnd = Win32Wrapper.GetWindowHandle(PRICONNE_WND_CLASS, PRICONNE_WND_NAME); if ((int)princoneHwnd == 0) { MessageBox.Show(MSG_MESSAGE_START_GAME_FIST, MSG_TITLE_START_GAME_FIRST, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (!(resolutionComboBox.SelectedValue is Size newResolution)) { return; } Win32Wrapper.ResizeWindow(princoneHwnd, newResolution.Width, newResolution.Height); }
private void fullscreenBtn_Click(object sender, EventArgs e) { var princoneHwnd = Win32Wrapper.GetWindowHandle(PRICONNE_WND_CLASS, PRICONNE_WND_NAME); if ((int)princoneHwnd == 0) { MessageBox.Show(MSG_MESSAGE_START_GAME_FIST, MSG_TITLE_START_GAME_FIRST, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (Win32Wrapper.CheckWindowIsFullScreen(princoneHwnd)) { MessageBox.Show(MSG_MESSAGE_ALREADY_FULLSCREEN, MSG_TITLE_ALREADY_FULLSCREEN, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } Win32Wrapper.FullScreenWindow(princoneHwnd); }