private void buttonBackGroundMain_Click(object sender, EventArgs e) { try { if (backGroundPtr == IntPtr.Zero) { formBackGround = new FormBackGround(); backGroundPtr = formBackGround.Handle; formBackGround.Show(); if (SetFile.Default.TempViewPath != null) { if (File.Exists(SetFile.Default.TempViewPath)) { formBackGround.VideoBackGroundPlay(SetFile.Default.TempViewPath); } } formBackGround.SetFullScreen(SetFile.Default.DefaultFullScreen); formBackGround.Show(); } else { //formBackGround.Show(); } } catch (DllNotFoundException ee) { MessageBox.Show(ee.Message); } catch (Exception ee) { MessageBox.Show(ee.Message); } }
private void buttonBackGround_Click(object sender, EventArgs e) { int ScreenCount = ComboBoxAllScreens.SelectedIndex; if (videoViewPanel != null) { if (videoViewPanel.Playing) { videoViewPanel.Pause(); } } try { if (backGroundPtr == IntPtr.Zero) { formBackGround = new FormBackGround(); backGroundPtr = formBackGround.Handle; if (SetFile.Default.TempViewPath != null) { formBackGround.VideoBackGroundPlay(SetFile.Default.TempViewPath); } formBackGround.SetFullScreen(ScreenCount); formBackGround.Show(); } else { formBackGround.VideoBackGroundStop(); if (SetFile.Default.TempViewPath != null) { formBackGround.VideoBackGroundPlay(SetFile.Default.TempViewPath); //SetFile.Default.NowPlayingPath = SetFile.Default.TempViewPath; } } } catch (DirectXException ee) { MessageBox.Show(ee.Message); } catch (DllNotFoundException ee) { MessageBox.Show(ee.Message); } catch (Exception ee) { MessageBox.Show(ee.Message); } }