Show Networks Flyout (the "connect-to-network" thingie) without explorer.exe running - windows-8

Requirements:
Our application replaces the usual windows shell (explorer.exe). This is a product requirement for a closed system that we're supplying.
We oughtta let the user select a wi-fi network and connect to it.
The problem: The wi-fi networks dialog only shows up when explorer.exe is running
What we tried:
Write our own wi-fi manager that uses wlan API. It lists connectible networks and allows the user to connect/disconnect. Problem: too many network types/configuratons that have to be tested, especially when the wheel has already been invented and reinvented all over.
Try and check how is the networks dialog implemented. It appears that it's and undocumented COM interface (IUIRAdioManager). Problem: it's undocumented, so no API
Use an existing network manager, for instance the one that comes with the driver. Problems: it's ugly, not to the product's taste; and it opens too many options for the user, like creating and loading profiles, browsing for files on a file system - these things are unacceptable.
Running explorer.exe just for the purpose of showing the networks dialog and then killing it. Problem: once we run explorer.exe - it pops up metro view and hides our fullscreen application or shows the taskbar.
The latter seems like the preferred solution: no need to reinvent the wheel, it does what's needed. Just gotta make explorer.exe not pop out, keep it quiet in the background.
So, we're down to two options:
How to show the networks flyout dialog without explorer.exe?
How to run explorer.exe without it popping out metro or taskbar above our application?

Your first solution would be incredibly difficult to implement. I am almost certain that the Networks window is dependent on explorer.
However, your second is entirely possible.
To hide the taskbar, you will need to find a window (using FindWindowEx) to find the taskbar (name is Shell_traywnd). This will hide the taskbar and start button. EDIT: Unless you are implementing your own taskbar, you might want to set the taskbar to autohide.
Next you will need to hide all of the metro programs. In a similar fashion as above, find the class named EdgeUiInputWndClass and close it. You should be able to get the process name of it and then kill the process.
Windows key. This is a little more difficult. You will probably need to use a program and delete the key or a keyboard hook (a low level keyboard hook) and just ignore key presses with the same scancode as the windows key. Left Windows is 0x5b and Right is 0x5c (source). Note that this will not block Ctrl+Alt+Del.
Finally, to show the Flyout, you can run %windir%\explorer.exe shell:::{38A98528-6CBF-4CA9-8DC0-B1E1D10F7B1B}
(source).
EDIT2:
You should also be able to hide toast notifications via this
Of course, I don't see why you cannot just use Windows 8/8.1 and put the app in kiosk mode.

Related

How can i keep focus on my own application or regain it when lost in delphi? [duplicate]

I need to create a simple Delphi application, kiosk style.
It is a very simple thing, a single form where the user writes some personal info to register to an event. 4 TEdit and a TButton.
What I want to achieve is to avoid the user does any action different then typing in TEdit or clicking on the TButton. For example I don't want he does ALT TAB (switchin applications), pressing windows key on keyboard, doing ctrl-alt-canc, etc...
I can add a passowrd protected Button that enables/disables this "Kiosk mode", in this way as I need to exit the kiosk mode I simply press that button and exit.
How to achieve this "kiosk mode" in Delphi without intercepting all the keystrokes manually? Or did anyone already develop this so it can be shared?
I think you'd better create a new desktop, and run your app in there. When your app is done, you can bring back user's desktop. That is how Windows login screen works. Of course Windows login screen uses a special secure desktop. Your app in a separate desktop would be isolated. You will have a desktop background with no start menu, taskbar, or desktop icons because explorer.exe is not running there automatically. Of course a can start a new process, using Task Manager, but desktops in Windows are securable objects; therefore, you can make restrictions if you want. Of course if your app has sufficient permissions.
To create a new desktop, you can use CreateDesktop Windows API, and to switch to the newly created desktop, you can use OpenDesktop function.
You can try Change the Windows Shell.
When you start windows, you don't execute the default shell (explorer.exe), you can execute your application.
Al internet you can find alternative Shell (more attractive) to default windows like:
BlueBox or
SharpE
This option is used for purposes similars at the application that you are developing. Kiosks or TPV.
For change the default applicacion you must modify a registry key:
In Win3.x and Win9x, SYSTEM.INI file:
[boot]
shell=MiAplicacion.exe
In Win2k and WinXP, use Registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
Shell=MiAplicacion.exe
If you test this option, think the mode to turn the configuration to the original value (button or option). You must reboot to test changes.
ADDED: In addition, if you search on the web some similar at this "Delphi Change default windows shell", you can find more code, samples and information about this.
Regards
P.D: Excuse me for mistakes with english.
Well but if someone can open the taskmgr he could just create a new task and run explorer.exe from there so its not really secure though...
Ok Taskmgr can be stopped with policies...
Well and for disabling the cad sequence you can use saslibex which Remko Weijnen had created you can find it here: SASLibEx
kindest regrads,
s!

How to disable the CTRL key in vb.net

I have written a program for work that kills windows explorer (effectively hides desktop icons, taskbar and start menu) so no users can access the internet from our machines, this works well as most machines are touch screen so no keys can be pressed and no access to OSK, but to go a step further I am needing to disable the CTRL key when explorer is not running (Killed in my program) then enable it when they are back (Active in my program).
I've searched Google and seen a lot of ideas but none seems to work, i've got a timer that kills task manager if it starts up, the reason i need to stop CTRL is incase a keyboard is present on the machine i need to stop any shortcuts from being activated and they mostly seem to use the CTRL key.
I know they might be other short cuts but the guys who use my machines aren't the brightest bunch of people in the world but they might be one that 'is reight good ont tinternet'.
Cheers for any advice
Mark
You should look into Kiosk mode.
Here is an example of enabling it in Windows 8.1:
Enable Kiosk Mode in Windows 8.1
If you are still using Windows 7, there are workarounds, like this one:
Creating a Kiosk Machine with Windows 7 and Two Free Applications

The form fails to popup in windows 8

I have a chat application written in VB.net which is used to chat between users who are connected in LAN inside a office . The application popups whenever user gets new chat message. It works fine in windows XP. But sometimes in windows 8 the application fails to popup the chat window. So my chat window is not appearing at the top when popup occurs for new messages.
I have tried using setwindowspos, form.Show(), form.BringToFront() which can bring the form to topmost. But sometimes this will not work properly.
So is there any other method other than those three(which i have mentioned above) i have used which can make the form popup and bring it to front.
Your WinForms app is a desktop application, so it's likely that the reason the pop-up is not being displayed in Windows 8 is because the desktop is not visible.
Remember that Windows 8 brings with it a whole new Start Screen interface and relegates the desktop to an alternate mode. All desktop applications still run, but they run in this separate mode and cannot interact with the new Metro applications (or whatever they're calling them nowadays). Yes, it's too bad that the usability folks at Microsoft didn't listen to Larry Tesler and have decided instead to mode us in, but c'est la vie.
So anyway, the pop-up is still being displayed, but it's being displayed on the desktop, which is not visible. Bringing it to the top isn't doing any good because it's already at the top of all the other windows on the desktop. If you click on the "Desktop" tile in the Start Screen, you should see your window.
Fixing this problem is going to take some work. Forcing a focus switch to the desktop mode is a horrible idea from a usability perspective, and I'm not sure it's even possible. A better solution would be to look into using Toast notifications instead, which can be done from a desktop application.

Prevent other windows from receiving focus in Cocoa

How can I prevent other windows within my application from receiving focus? I want to bring a loading window to the front and let it do its thing, but I don't want the user to be able to interact with the other windows in the app.
I could simply hide the other windows in the app, but that feels kind of jarring for users to have their windows just suddenly disappear. At the same time, I can't let the user continue interacting with the other windows during a load since the load will be updating data on every window (synchronization problems would occur). I can add additional locking mechanisms, but I'd rather not if it is as simple as forcing a single window to stay on top and remain in focus.
Thanks!
Look into modal windows.
https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/WinPanel/Concepts/UsingModalWindows.html
You can make a whole window or panel run in application-modal fashion,
using the application’s normal event loop machinery but restricting
input to the modal window or panel. Modal operation is useful for
windows and panels that require the user’s attention before an action
can proceed. Examples include error messages and warnings, as well as
operations that require input, such as open dialogs, or dialogs that
apply to multiple windows.

Controlling USB keyboard and mouse

We have a hardware device, with an LCD display. It supports an USB interface to connect keyboard and mose. Using these keyboard and mouse, we can navigate to varios menu items and edit entries.
We have couple of test cases written to verify that mouse click and keyboard input events are working when pressed respective key.
My task is to automate these test cases.
I donot have any control to the hardware device, as I can not access the o/s kernel or any application running there. There is one way to verify what is currently displayed on the UI. So I have to use that and verify whether the mouse/keyboard has performed the appropriate events.
As I have gone through couple of previous posts, it seems like that one of the way to achieve this is through virual HID device driver rather than actual keyboard and mosue. But I am not sure how to achieve it.
Please do help me for it. I am fine with any programming language.
I am more interested to simulate the mouse and keyboard events.
You probably don't need to write your own driver. AutoHotKey does pretty much anything you can think of, and the scripting language is quite easy to learn.
You can get it here:
http://www.autohotkey.com/
Since you're using linux, here's a similar project that will run on linux:
http://sikuli.org/