I'm building a calendar and it needs to stay on desktop.
My form needs to be transparent and to stay maximized when the user press Show Desktop button or Win+D.
I'm using Delphi.
Windows XP, Vista and 7.
1) In order to make the form transparent, I'm using the following code:
if SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) or WS_EX_LAYERED) = 0
2) In order to make the form stay on desktop even when user press Win+D:
procedure TForm1.FormCreate(Sender: TObject);
var hWindow: hwnd;
hWindow := FindWindow(nil,PChar('Prog
if hWindow <> 0 then Form1.ParentWindow := hWindow;
The problem is when I set the form to stay on desktop using the code #2 the code #1 doesn't work, i.e. the form can't appear transparent.
These two code pieces work fine when tested separately.
My question is: Is there any way to put these two codes to work togheter?