Screensaver in Windows 8 - windows-8

I have a screensaver written in C# which takes a screenshot of the Desktop and displays it as the, guess what, screensaver.
This works pretty well except in Windows 8 where the screensaver launches in, what looks like, a separate Desktop with a solid background and thus i am only taking a screenshot of this solid background instead of the actual desktop.
This only counts if the screensaver is launched by the timeout by windows itself, not if you execute the screensaver directly (by double-clicking the *.scr) nor in the preview-panel (/p switch) or if you preview it using the "Test" button (which imho invokes the /s Switch).
According to a Moderator at Microsoft-Answer and so far the only information i found regarding this:
"A design change was made in Windows 8 that prevents screensavers from drawing over an image of the desktop." - Source: http://answers.microsoft.com/en-us/windows/forum/windows_8-desktop/bubbles-screensaver-has-black-background/e0807324-5ca6-4abe-b6ba-716848b41ff5
tl;dr: I'm looking for a way to take a screenshot of the actual desktop through a screensaver in Windows 8.
Thanks in advanced.

Related

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.

Why is my Visual Studio (VB.NET) layout different in Design View vs. at run-time on my home computer, but identical on my work computer?

I've been developing a program with Windows Forms on my work computer in VB.NET using Visual Studio 2013. When I run it on my work computer, the forms at run-time look identical to the forms in design view - the same overall size, the same layout, etc. Here is what it looks like on my work computer - AND when I access my work computer over remote desktop from my home computer.
However, on my home computer, it looks different in design view than at run-time. The form in design view is smaller and labels are misaligned.
Both computers are running Visual Studio 2013 with the same settings. I'm working on a larger monitor at home, but the fact that things look right when I access my work computer over Remote Desktop makes me think it's not my monitor.
My work computer is Windows 7 while my work computer is Windows 8.1.
Things I've tried:
Anchoring/docking the labels, but the layout ends up looking wrong
Changing the AutoScaleMode to DPI instead of Font, but that only changes the appearance at runtime, not in design view, and it still doesn't match design view.
Any ideas?
I figured it out! It was a setting in Windows on my home computer. (Still unclear why it looked right via Remote Desktop, but maybe it uses the remote computer's settings instead of the local one's).
The solution was:
Right click, choose "Screen Resolution"
Click "Make text and other items larger or smaller"
Check "Let me choose one scaling level for all my displays" and set size to "smaller - 100%"
For some reason, on my home computer the size was set to 125%.
After searching for a solution online this worked for me:
this.AutoSize = false;<br>
this.AutoScaleMode = AutoScaleMode.Font;
I put this code on form load and the display remained the same.

Why is my VB app invisible to the screen recorder?

I have written a VB application in VS2010. When I try to record its operation for a demo video with Windows Media Encoder x64 or Apowersoft free screen recorder, I get a recording of everything on the desktop except my application. It's like the application is invisible to the recorder. It has worked in the past (2 weeks ago). It must be something I have done but I'm baffled. Is there a "feature" in VB that can prevent you from recording the Form?
BTW, a still screen capture works fine and sub forms I bring up are captured. Only the main form is invisible to the recorder.
Thank you for your help and time.
Not a VS or VB problem after all. What I found was that windows 7 was switching me from Aero Theme to Windows 7 Basic. The message that showed up was that I was low on display memory. (A quick pop-up in the bottom right corner that I was ignored during the recording). However, I have 4.75 G of display memory?
BTW on a video conf call it produced the same invisibility "feature" until I found the Theme switch.
I haven't actually fixed anything but now know to watch for the tell tale screen blink as it switches mode. I pause the recording, and switch it back before restarting the recording. Got through the recordings I needed for now. I was using MS Media Encoder. I have now replaced it with Adobe Premier elements but haven't tried it yet to see if I still have the problem. Need to get the "how to" videos out the door first.
Thanks again. I have read many of your Answers to others in the past that have helped me solve numerous other VB and VS problems.
Michael
That's weird since it's recording forms from the application and not other forms (main form) from the same application.
Make sure you run the recorder as administrator and not the application.

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 8 incompaitbility with sysinternals Desktops utility

After Googling for about the past hour and a half, I have been unable to find out any definitive information on how the start menu and how windows 8 style applications work behind the scenes. I was under the impression that Windows 8 Style applications were processes which created fullscreen windows and that the Windows 8 start menu was created by explorer.exe in much the same way. But there are incompatibilities between Windows 8 the 1.x version Sysinternal's Desktops utility, I have to imagine that something more complex is going on.
However, in Spy++, each Windows 8 style application appears as standard Window with the WS_EX_TOPMOST style set, which would make sense, assuming they are nothing special. With respect to the Start Menu, it appears as a window of class ImmersiveLauncher created by explorer.exe. Perhaps explorer has developed an aversion to having multiple instances...
Using the old version of SysInternal's Desktops, the explorer instances in the additional desktops work fine, but do not load pinned items nor load the desktop background and icons.
Is there any documentation on why Windows 8 behaves differently from past versions when multiple copies of explorer.exe are running in different desktops?
(This is purely for curiosity's sake)
(Yes, I know there is a Desktops 2.0 version available which supports Windows 8, but it uses interesting workarounds, like switching to the original desktop when the windows key is pressed. It also seems to trigger some initialization within explorer.exe when the desktop is loaded for the first time beyond simply starting the process.)