Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Disable Windows Navigation

Disable Windows Navigation

Scheduled Pinned Locked Moved C#
csharpvisual-studiowpfsecurityquestion
6 Posts 5 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aymen Tn
    wrote on last edited by
    #1

    Hi I'm developing a wpf application using visual studio 2010 in c#. for security reason, the navigation in the operating system is not allowed while running the application. That means once it is launched, all Windows menu, icons, toolbars ... must be hidden, and only the application must appear. (it's a kind of that the PC becomes only dedicated to it). Any suggestion or Idea ? Thanks in advance

    G E 2 Replies Last reply
    0
    • A aymen Tn

      Hi I'm developing a wpf application using visual studio 2010 in c#. for security reason, the navigation in the operating system is not allowed while running the application. That means once it is launched, all Windows menu, icons, toolbars ... must be hidden, and only the application must appear. (it's a kind of that the PC becomes only dedicated to it). Any suggestion or Idea ? Thanks in advance

      G Offline
      G Offline
      GuyThiebaut
      wrote on last edited by
      #2

      I don't have any code but what I think you might want to look into is running the application in what is known as 'kiosk' mode.

      “That which can be asserted without evidence, can be dismissed without evidence.”

      ― Christopher Hitchens

      1 Reply Last reply
      0
      • A aymen Tn

        Hi I'm developing a wpf application using visual studio 2010 in c#. for security reason, the navigation in the operating system is not allowed while running the application. That means once it is launched, all Windows menu, icons, toolbars ... must be hidden, and only the application must appear. (it's a kind of that the PC becomes only dedicated to it). Any suggestion or Idea ? Thanks in advance

        E Offline
        E Offline
        Emmanuel Medina
        wrote on last edited by
        #3

        Sounds like what you want is a "kiosk" mode kinda thing. If so, you should add WindowStyle="None" and WindowState="Maximized" to the XAML of your main window. Further, you can even disable resizing and make it be the windows at the top from the start, adding ResizeMode="NoResize" and Topmost="True". Code would look like this:

        Note that Windows keyboard shortcuts still work (Alt+Tab, Windows Key, Alt+F4). If you want to "disable" those, you will have to capture them, although opening applications in this manner (for example Windows+E for Windows Explorer) won't display the newly opened application since yours is Topmost as set in the property. [EDIT] The same can be achieved modifying those properties in the constructor, like so:

        namespace WpfApplicationTest1
        {
        public partial class MainWindow : Window
        {
        public MainWindow()
        {
        InitializeComponent();
        WindowStyle = WindowStyle.None;
        WindowState = WindowState.Maximized;
        ResizeMode = ResizeMode.NoResize;
        Topmost = true;
        }
        }
        }

        If you think you can do a thing or think you can't do a thing, you're right - Henry Ford Emmanuel Medina Lopez

        A 1 Reply Last reply
        0
        • E Emmanuel Medina

          Sounds like what you want is a "kiosk" mode kinda thing. If so, you should add WindowStyle="None" and WindowState="Maximized" to the XAML of your main window. Further, you can even disable resizing and make it be the windows at the top from the start, adding ResizeMode="NoResize" and Topmost="True". Code would look like this:

          Note that Windows keyboard shortcuts still work (Alt+Tab, Windows Key, Alt+F4). If you want to "disable" those, you will have to capture them, although opening applications in this manner (for example Windows+E for Windows Explorer) won't display the newly opened application since yours is Topmost as set in the property. [EDIT] The same can be achieved modifying those properties in the constructor, like so:

          namespace WpfApplicationTest1
          {
          public partial class MainWindow : Window
          {
          public MainWindow()
          {
          InitializeComponent();
          WindowStyle = WindowStyle.None;
          WindowState = WindowState.Maximized;
          ResizeMode = ResizeMode.NoResize;
          Topmost = true;
          }
          }
          }

          If you think you can do a thing or think you can't do a thing, you're right - Henry Ford Emmanuel Medina Lopez

          A Offline
          A Offline
          aymen Tn
          wrote on last edited by
          #4

          Hello Thanks for your reply. but with this solution the windows expolorer still work, for example when I push the keybord start button it still works, What I want to do is to diable all windows fonctionnality (like Windows +E ....) Thanks

          F L 2 Replies Last reply
          0
          • A aymen Tn

            Hello Thanks for your reply. but with this solution the windows expolorer still work, for example when I push the keybord start button it still works, What I want to do is to diable all windows fonctionnality (like Windows +E ....) Thanks

            F Offline
            F Offline
            Freak30
            wrote on last edited by
            #5

            I don't think, you can do this. And even if you did, the user could still press Ctrl + Alt + Del (which can't be intercepted as far as I know), open Task Manager and kill your application. I would suggest another appoach. Give the user only minimal rights (just to his user directory). Start your application under a different user who has access to the necessary directories. Require a password to close your application. Under this setup the Task Manager is of no use because the user can't kill other users' processes.

            The good thing about pessimism is, that you are always either right or pleasently surprised.

            1 Reply Last reply
            0
            • A aymen Tn

              Hello Thanks for your reply. but with this solution the windows expolorer still work, for example when I push the keybord start button it still works, What I want to do is to diable all windows fonctionnality (like Windows +E ....) Thanks

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              aymen amri wrote:

              but with this solution the windows expolorer still work, for example when I push the keybord start button it still works

              The keyword was "Kiosk mode". DuckDuckGo it, and you'll come across checklists like this one[^].

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups