Friday, May 07, 2004
Some notes on Desktop
First, we should know what hides behind.
The article below is a good try in C#. The class provided is easy to use. And it shows some basic functions.
by Nnamdi Onyeyiri
The following two articles about the order of windows on a desktop are written by Raymond Chen.
A commenter asked why the original window order is not always preserved when you undo a Show Desktop.
Why isn't the original window order always preserved when you undo a Show Desktop?
Zhefu Zhang had already developed some interesting applications on WinStation/Desktop's DACL. For example,
COM Interface Hooking
GUI-Based RunAsEx (this one is really nice!)
Lock Windows Desktop
OK, finally we arrive our application: switch desktop to hide the screen when boss is coming. My friends asked me to write such a program for them. I think it is quite easy, we need to
a) first create a new desktop;
b) then regist two special hotkey: one for switching, the other for closing;
c) finally detect your boss and switch the screen in time.
It has been proven that The RegisterHotKey function defines a system-wide hot key. That's to say, WM_HOTKEY messages can be triggered in all the desktops.
The most difficult task is c). However, I do not need to worry about it. My boss does not care what you are doing. He just cares what you can give him.