Preventing minimizing using Show Desktop

I have an AppBar window in my application. I want it to be Visible also when user minimizes all Windows using shortcut Windows+M (or Windows + D) or Show Desktop button in Quick Lunch toolbar.

Preventing minimizing when user uses those keyboard shortcuts is quite simple and needs receiving WM_SIZE message, I think. But I have no idea how can I have my AppBar visible when user clicks Show Desktop button. I know that Show Desktop first minimize all windows and then change Z-Order to get Desktop Window as a front window. I've read some solutions (like changing application parent window to Progman) but none of them works. I use one application (not mine) that behaves exactly like I need - stays visible all the time and it's also AppBar window.

Your solution?
JacekHAsked:
Who is Participating?
 
MerijnBConnect With a Mentor Sr. Software EngineerCommented:
the trick is like you say, setting the app parent window to program manager.

I've tested this here and it works:

procedure TForm14.Button1Click(Sender: TObject);
begin
 Windows.SetParent(Handle, FindWindow(nil, 'Program Manager'));
end;


be aware that this is a kind of hackisch way, there is no 'official' way of achieving this.
0
 
JacekHAuthor Commented:
Well, I don't know why it didn't worked on another computer I've tested last night. Now it works... So thank you, your solution is accepted.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.