Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Taskbar Button is not pushed when activating a form

Posted on 2002-07-03
6
Medium Priority
?
270 Views
Last Modified: 2010-04-04
Hi!

I have a main form which creates more windows at run time, every window have in the CreateParams the WS_EX_APPWINDOW style in order to have a button in the taksbar for each new form created.

Problem is that, when i click the window the associated taskbar button is not pressed,  if i activate the windows by clicking the associated taskbar button everything goes fine, but never clicking each form....

How can i make the button goes pushed?  i think that there's some message the windows are not sending since they weren't meant to have a taskbar button...


Thanks!
0
Comment
Question by:tearsoftragedy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 800 total points
ID: 7129106
hi,
make your other forms createparams like so:
(the Params.WndParent := GetDesktopWindow will give you the button in taskbar that will be depressed when you select the form on screen)

private
{ Private declarations }
procedure CreateParams(var Params : TCreateParams); override;
public
{ Public declarations }
end;

var
Form2: TForm2;

implementation

{$R *.DFM}

procedure TForm2.CreateParams(var Params : TCreateParams);
begin
inherited CreateParams(Params);
Params.WndParent := GetDesktopWindow;
end;
0
 
LVL 17

Expert Comment

by:geobul
ID: 7129380
Hi,
I don't use CreateParams. Try the following instead:

procedure TForm1.Button1Click(Sender: TObject);
begin
  SetWindowLong(Form2.Handle, GWL_EXSTYLE, WS_EX_APPWINDOW);
  Form2.Show;
end;

Regards, Geo
0
 

Author Comment

by:tearsoftragedy
ID: 7134655
Sorry for the delay Inthe, it works as i need, how easy it was ;)

thanks for your time!

:]


-----
geobul:
thanks for answering too, but i begun with the code you supplied, then i changed the params i thought i was the best place...


--
;D
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 17

Expert Comment

by:geobul
ID: 7134686
I'm afraid that I can't manage it working properly as I expect setting WndParent in CreateParams. I'm using Delphi 5 Ent and WinXP. But most important is that you can.

Regards, Geo
0
 

Author Comment

by:tearsoftragedy
ID: 7144708
this is the code Geo, try and see if it works now.. maybe you missed something... ¿?

.....
  protected
    procedure CreateParams(var Params: TCreateParams); override;


.....

procedure TYourMDI.CreateParams(var Params: TCreateParams);
begin
  inherited;
  Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
  Params.WndParent := GetDesktopWindow;
end;
0
 
LVL 17

Expert Comment

by:geobul
ID: 7145475
Thanks, I've got it.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question