Friday, May 07, 2004

 

Some notes on Desktop

1.
First, we should know what hides behind.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/window_station_and_desktop_functions.asp

2.
The article below is a good try in C#. The class provided is easy to use. And it shows some basic functions.

Desktop Switching
by Nnamdi Onyeyiri
from http://www.codeproject.com/csharp/CsDesktopSwitching.asp

3.
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.
http://weblogs.asp.net/oldnewthing/archive/2004/05/27/143042.aspx

Why isn't the original window order always preserved when you undo a Show Desktop?
http://weblogs.asp.net/oldnewthing/archive/2004/09/09/227339.aspx

4.
Zhefu Zhang had already developed some interesting applications on WinStation/Desktop's DACL. For example,

COM Interface Hooking
http://www.codeguru.com/activex/ComHook.html

Super PasswordSpy++
http://www.codeguru.com/ieprogram/SPwdSpy.html

GUI-Based RunAsEx (this one is really nice!)
http://www.codeproject.com/system/RunUser.asp

5.
Lock Windows Desktop
By afeijao
http://www.thecodeproject.com/w2k/AntonioWinLock.asp

6.
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.



<< Home

This page is powered by Blogger. Isn't yours?