Activate window from taskbar [closed]?

Up vote 1 down vote favorite 2 share g+ share fb share tw.

Delphi taskbar link|improve this question asked Feb 20 '11 at 5:53Maxefficiently112.

This is a duplicate of stackoverflow.com/questions/4901965/…, even if the title of this question might not be the best. – Andreas Rejbrand Feb 20 '11 at 11:35 You only need to include the WS_MINIMIZEBOX window style. But I won't post this as an example, for that wouldn't be right against David that first discovered that in the first question about this.

– Andreas Rejbrand Feb 20 '11 at 11:51 I'm also voting to Close. – Cosmin Prund Feb 20 '11 at 12:15 @Andreas, @CloseVoters - This question has no constraint for excluding the WS_POPUP style, which is the entire point of the other question. – Sertac Akyuz Feb 20 '11 at 13:44 1 @Sertac: I think that the WS_POPUP part of the old question was merely an unintentional red herring (is there a better word for this?

). The OP just thought the problem was related to that window style. His actual problem was exactly the same as in this question, namely, if the form is borderless, then Win+M, the taskbar etc. stop working.

– Andreas Rejbrand Feb 20 '11 at 13:52.

I'm guessing you're using an older version of Delphi (I've just done my testing on Delphi 2010, and I'm guessing you're using something older because in my version I don't need to do anything, restoring the window just works). Problem 1: How do you MINIMIZE a border-less form? A border-less form doesn't have an "minimize" button!

Are you sure it's minimized and it's not actually hidden? I've just attempted this, and I was only able to minimize the form by placing a button on it and running this code from the button: ShowWindow(Handle, SW_MINIMIZE); If I clicked on the application's button in my Windows 7 taskbar it came right up without problem. This brings us to the second problem.

Problem 2: What version of Delphi are you using? What version of Windows? Unfortunately it matters.

There were changes in what Windows did with the taskbar button, and those changes prompted more changes in what Delphi does to support the taskbar button. If you're on some old version of Delphi and on some new version of Windows you might try dropping a TApplicationEvents on your form, and from it's OnRestore event do this: ShowWindow(Handle, SW_SHOW or SW_RESTORE).

It doesn't need to be very old. Delphi 2009 displays this problem. Anyhow, this question is a duplicate.

– Andreas Rejbrand Feb 20 '11 at 11:33 1 A more VCL way to minimize is to set WindowState, which calls ShowWindow after checking state etc.. – Sertac Akyuz Feb 20 '11 at 13:43.

The solution is to do type TForm1 = class(TForm) private protected procedure CreateParams(var Params: TCreateParams); override; { Private declarations } public { Public declarations } end; where procedure TForm1. CreateParams(var Params: TCreateParams); begin inherited; Params. Style := Params.

Style or WS_MINIMIZEBOX; end; exactly as David did in the old question about this topic.

That didn't work for me in Win7. It had weird side effects. – Warren P Feb 21 '11 at 2:01 @Warren P: Still you did accept David's answer?

Could you describe the side effects? – Andreas Rejbrand Feb 21 '11 at 11:39 The taskbar malfunctions in Windows 7, with this. – Warren P Feb 22 '11 at 15:49.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions