# VBForums CodeBank > CodeBank - C# >  [RESOLVED] Disable Multiple Desktops

## paradox34690

Hi everyone!

I usually do VB, but for the project I'm currently working on, I'm C#. I'm working on a pretty simple video player that will be loaded onto a Windows 10 tablet/pc which will be a portable kiosk for museum exhibits. The basis, while not 100% concrete, is this:

1. Load desired video onto tablet. Currently, a folder on the desktop called 'video' which should only contain 1 video file in mp4 format.
2. On app load, load video, start playing, then stop to create initial video frame shown to museum patrons.
3. Simple UI with a restart button, a play button, and a volume slider.

The device will be housed in a portable podium so that as exhibits move, etc, so can the device - this will also allow for overnight charging, etc.

Code:



```
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Threading;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace MuseumVideoPlayer
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        
        private void btnPlay_Click(object sender, RoutedEventArgs e)
        {
            videoPlayer.Play();
        }

       

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            
            string videoPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\video\";
            string extension = @"*.mp4";
            string[] videos = Directory.GetFiles(videoPath, extension);

            string videoName = videos.GetValue(0).ToString();


            videoPlayer.Source = new Uri(videoName);
            videoPlayer.LoadedBehavior = MediaState.Manual;
            videoPlayer.UnloadedBehavior = MediaState.Manual;

            videoPlayer.Play();
            videoPlayer.Pause();

            this.WindowStyle = WindowStyle.None;
            this.WindowState = WindowState.Maximized;
            videoPlayer.Width = this.Width;
            videoPlayer.Height = this.Height;
            volslider.Value = .5;


        }

        private void volslider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            videoPlayer.Volume = (double)volslider.Value;
        }

        private void btnRestart_Click_1(object sender, RoutedEventArgs e)
        {
            videoPlayer.Stop();
            videoPlayer.Play();
        }

        private void videoPlayer_MediaEnded(object sender, RoutedEventArgs e)
        {
            videoPlayer.Stop();
            videoPlayer.Play();
            videoPlayer.Stop();

        }
    }
}
```

Now lets lead into the question:

When the application is opened, it goes full screen and - with no toolbar, window frame, or anything - makes shutting the application down slightly difficult (this is an expected and desired result). However, unknown to me when I began, Windows 10 allows for multiple desktops (I hadn't realized that Win10 has finally caught up to the rest of the world on this).

Is there a way to programmatically disable the ability to create multiple desktops? I've read about removing the "Task View" button, but that doesn't disable it; a user can swipe from the far-left of the tablet screen and create a new desktop.

Thoughts?

----------


## paradox34690

son of a b*tch.... I'm sorry guys, i just realized I posted this to the codebank....

----------


## paradox34690

Easy solution:

Create batch file which executes "taskkill /f /im explorer.exe", then for the next line, point to my executable. Done. That was easy.

When you kill explorer, it also kills all other touchscreen gestures, etc, so this, in turn, will disable the ability to create additional desktops while museum patrons use the device.

----------

