The form fails to popup in windows 8 - vb.net

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.

Related

Make form visible on Windows Lockscreen

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. :-)

How to handle Touch Keypad in Windows Forms on Windows Form Tablet

I am using Windows Forms application and I am not able to auto hide/show the touch keypad thats on the windows 10 Home OS on a tablet. How to handle the touch keypad, Can anyone help me out in this regard.
There's quite a lot of answers on google for this,
https://www.google.co.uk/search?source=hp&q=vb.net+hide+show+touch+keyboard+windows+10&oq=vb.net+hide+show+touch+keyboard+windows+10&gs_l=psy-ab.3...1296.11486.0.11948.28.27.0.0.0.0.75.1723.27.27.0....0...1.1.64.psy-ab..1.20.1290.0..0j0i131k1j0i67k1j0i22i30k1j0i13i30k1j0i8i13i30k1j33i22i29i30k1.TfxlEFKhnRI
Basically you need to create a process for the OSK, load it, and kill it (dependant on if its loaded). Loading and killing the process will show / hide the OSK.

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.

In WinRT how to create an application that is always visible?

With windows 8, is it possible to create an application that is always visible? For instance, in previous versions of windows, there is the task bar with quick launch icons. Can I create something similar to the quick launch icons that are always on the screen?
If you are referring to a Windows 8 Store app then the answer is no. You can have a live tile and toast notifications that provides updates to the user which may cause the user to launch your application.
A good article to read to understand how your Windows Store apps will run on Windows 8 go here to learn about Application lifecycle (Windows Store apps). This will explain the App execution state.
It is not possible in the RT version, but the same is possible in the desktop version. If you have a desktop app, you can pin it to the taskbar. But any Window store app cannot be pinned to the taskbar. What you can do instead is move the app to the beginning of your Home screen, so anytime you click the Windows button your app will be visible right in front.
Do you mean always visible in the Star Menu screen? If so, you can add tile updating functionality to your application. As long as the user has the application pinned to the Start Menu, he would see the updates. Check the link below for an introductory tutorial.
http://blogs.msdn.com/b/windowsappdev/archive/2012/04/16/creating-a-great-tile-experience-part-1.aspx
"Quick Launch" has a very specific meaning, which you may or may not have been referring to in your question.
Below is the Quick Launch bar in Windows 8 - essentially a toolbar pointing to a location in your %AppData% directory. Prior to Windows 7 it was available by default, but the ability to now pin items directly to the taskbar rather supersedes it. Here's how you can restore Quick Launch if you really want to :)
It's, of course, available only in the Desktop mode and not on the Modern UI, where pinning a tile is the best you can hope for, and it's all up to the user to pin it AND to determine where it shows up on their Start Screen.
Another option worth mentioning (although more like system tray than quick launch) is lock screen presence. If the user chooses so and your app supports that, he can add it to his lock screen:
either as a a badge (up to 7 apps)
or as a tile notification (single app only)
This is not a way for the user to quickly start your app (other answers have already covered these options) but a way to stay visible and keep your user informed.