private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { this.Visibility = Visibility.Hidden; _UVncHelper1.ToCloseRemoteSupport(); // 恢復正常 鎖屏睡眠狀態 OSPowerHelper.RestoreForCurrentThread(); }
public MainWindow() { InitializeComponent(); VNCHelpInitial(); // 保持主線程 阻止鎖屏 OSPowerHelper.PreventForCurrentThread(); }