Make form visible on Windows Lockscreen - vb.net

TL;DR Can I make a VB.net form visible on the Windows lock screen [i.e. when a user hits WIN+L]?
I wrote an alert system that notifies staff of a 'lockdown' in vb.net. This has been tested in drills a few times but today it was noted that the 'alert window' does not appear when the screen is locked.
The alert window does make an alarm sound, which can still be heard even when the computer is locked but this is dependant on the machine having speakers that are turned on...
The workstations are running Windows 7.
Edit
I am not looking to spawn a separate process, just get the 'lockdown.vb' form showing on top of the windows lock screen.
Googling this has just given me a load of tutorials on making a lockscreen...which is not what I'm after, hence the question. :-)

Related

Clicks going to background window in Adobe AIR app on OS X High Sierra

We have a fairly large AIR desktop application (captive AIR, using Runtime version 21).
Recently our QA have confirmed and reproduced an odd report by a Mac user:
When the app is in full screen, running on OS X High Sierra, then some clicks on the main user interface go through to whatever application is running behind the window. Whatever background window has been clicked, it will jump to the front and the click is processed, e.g. if the click was sent to a Finder window and happened to be in the location of a favorites folder, that folder will be opened as if you clicked it when the Finder window was open.
If no window is behind our app at the click location, the desktop will receive focus.
This is not consistent and even clicks in the same spot (as much as one can hit the same pixel twice) sometimes go to the background window and sometimes end up, as expected, in our window.
I know that this sound weird but it's been verified both by our QA and by me and another developer working on different machines.
Ideas would be most welcome.
Answering my own question after some trial and error:
Upgrading to AIR SDK 28 solved the problem.
Bonus tip: Avoid Adobe AIR. Great technology, zero support, dead forums.

Windows 8 .net focus issue form.activate has different behaviour when running with debugger

I have written a WinForms driver safety application for a windows tablet device that will blank the screen (display a full screen blank topmost window) when it detects that the car is moving at say more that 15km/h (using the tablets GPS).
The software has worked fine under Windows 7 but I'm struggling a bit to get it working under Windows 8. My first challenge is to display the blank screen when the Metro start menu is currently displayed. So if the user has the Metro start menu displayed and the car starts moving > 15 km/h my blank screen should display... I need to steal the focus from the metro interface and display my blank window on the desktop.
To test this I wrote a simple vb.net app in 2010. It had a form with a timer firing every 3 seconds. In the Tick event I had the code:
Beep()
Me.Activate()
When I ran this with the debugger and pressed the windows key to show the Metro Start Menu, it worked... The focus switched back to the desktop (and my window). However, when I ran this without the debugger and did the same thing I could hear the beeps but the focus never switched back to the desktop.
Any ideas why the behaviour would be different? Any ideas on how I replicate the same behaviour I get when the debugger is attached?
I have tried a few things like AppActivate, setting the form TopMost, BringToFront but unfortunately this hasn't worked.
The only half solution I have come up with is to send a windows button keystroke but this has other issues.
Windows specifically tries to prevent applications from stealing the foreground from other apps. See the SetForegroundWindow documentation for commentary on this and the factors that can let an application come to the foreground (all of the methods you are trying essentially come down to a SetForegroundWindow call).
Note that one of the explicit blocking circumstances is "The foreground process is not a Modern Application or the Start Screen."
This works for you when debugging because "The process is being debugged" is one of the cases which explicitly allows foreground privileges.
Because this is a generally user-unfriendly thing to do there isn't a good general purpose way to bypass this behaviour and steal the foreground.
Likewise, normal apps cannot run on top of Modern applications or the start screen.
You may be better off locking the system by calling the LockWorkStation function.

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

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.

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.

Windows Phone SDK 7.1.1 update freezes on Windows 8 Release Preview

I can't get WinPhone 7 SDK update v7.1.1 to install. It freezes my computer everytime I try to install, the mouse still work but after a while whole system locked up and I need to hold power button to turn it off. Looked at task manager and look like it freeze when configure the emulator. Tried several time, even reinstall Windows and still no luck. Anyone know a work around on this? I saw some others faced this problem but no solution.
When it freezes (in particular, when the spinning icon freezes), try hitting Ctrl+Alt+Del once. Two things can happen:
The first is that the machine will completely freeze within a minute or two, which will require a hard reboot.
The second is that the screen will flicker quickly, attempting to show the "Lock/Switch user/Sign out/Change password/Task manager" screen, and then will jump back to the setup screen. You'll then see the progress icon start spinning again, but it will hesitate several more times. It will either freeze the machine again (and if so, do a hard reboot and try again), or setup will eventually complete (which on my machine took no longer than 10 minutes).