KIOSK in Windows App

Brief:

A windows app which can be shown full screen with all shortcut keys disabled and operate through a touch panel. It gives a feeling of handling a KIOSK panel. Internally it is a windows app with Web browser control showing any html pages or web application.

Need:


Now a days touch panels are widely used. Everywhere we can see touch screen mobile phones, tablets and KIOSK panel in bank & ATM. At many places in exhibitions organizations are using touch panels to provide information about their product or services. Some times it has interactive screens like a feedback form or a quick online test or a questionnaire for customers.
To fulfill this requirement the easiest way is to create responsive web site or application and present it in full screen in browsers. But sometimes browsers does not help as one can play with it. So we have another option to present same thing through a Windows Application, where we can control user actions and do not let them do anything they are not suppose to do.

How It Works:


In Windows Forms we have WebBrowser control which can be shown in full screen with no form border and no any toolbar. We can also disable keyboard shortcut keys and also can modify behavior of a shortcut key. Then use Navigate method of WebBrowser control to open the desired web site. Rest of the things are implemented and managed by website.

To show the WebBrowser control in full screen we can set the Dock property of control to Fill.
this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill;

Attach event handlers for Navigating and Navigated if you want to control navigation to any url or do something after navigation.

this.webBrowser1.Navigated += new System.Windows.Forms.WebBrowserNavigatedEventHandler(this.webBrowser1_Navigated);
this.webBrowser1.Navigating += new System.Windows.Forms.WebBrowserNavigatingEventHandler(this.webBrowser1_Navigating);


If you want to do something after the page is loaded completely then you can use DocumentCompleted event of WebBrowser control.

this.webBrowser1.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.webBrowser1_DocumentCompleted);

To disable context menu of WebBrowser make IsWebBrowserContextMenuEnabled property false.

this.webBrowser1.IsWebBrowserContextMenuEnabled = false;

To disable short keys we can use below method.

// Disable CTRL+W - exit

RegisterGlobalHotKey(Keys.W, USE_CTRL);

// Disable CTRL+N - new window

RegisterGlobalHotKey(Keys.N, USE_CTRL);

// Disable CTRL+S - save
RegisterGlobalHotKey(Keys.S, USE_CTRL);

// Disable CTRL+A - select all

RegisterGlobalHotKey(Keys.A, USE_CTRL);

// Disable CTRL+C - copy

RegisterGlobalHotKey(Keys.C, USE_CTRL);

// Disable CTRL+X - cut

RegisterGlobalHotKey(Keys.X, USE_CTRL);

private void RegisterGlobalHotKey(Keys hotkey, int modifiers)
        {
            try
            {

                // increment the hot key value - we are just identifying
                // them with a sequential number since we have multiples

                mHotKeyId++;

                if (mHotKeyId > 0)
                {

                    // register the hot key combination
                    if (RegisterHotKey(this.Handle, mHotKeyId, modifiers, Convert.ToInt16(hotkey)) == 0)
                    {

                        // tell the user which combination failed to register -
                        // this is useful to you, not an end user; the end user
                        // should never see this application run

                    }
                }
            }
            catch
            {

                // clean up if hotkey registration failed -
                // nothing works if it fails

                UnregisterGlobalHotKey();
            }
        }

Podcast

Michael Patterson sat down with the CEO of Boston Byte, Mustapha Shaikh to discuss the significance and rapid digitization of the healthcar...