Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

select form

Posted on 1998-09-10
10
Medium Priority
?
147 Views
Last Modified: 2010-04-06
i have a icon in the system tray for my application when i double click the icon the to show the app it shows but the other apps still have focus.How cani give the form and bring to top. I tried setfocus and topmostWindow  in windows API.
I use delphi 1. thanx
Mits
0
Comment
Question by:Mitsy
[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
  • 5
  • 4
10 Comments
 

Expert Comment

by:belgianbasman
ID: 1339223
Suppose the form you want to show up is called FORM1.

In the OnResize event of this form, put FORM1.ACTIVATE;

I think this should do it.

0
 

Author Comment

by:Mitsy
ID: 1339224
no the form does not have focus and remains hidden under other apps, when i double click the icon.
Mits
0
 
LVL 10

Accepted Solution

by:
viktornet earned 200 total points
ID: 1339225
SetForegroundWindow(FormName.Handle);

Regards,
Viktor Ivanov
0
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!

 
LVL 10

Expert Comment

by:viktornet
ID: 1339226
You could also use this......

FormName.BringToFront;

Regards,
Viktor Ivanov
0
 

Author Comment

by:Mitsy
ID: 1339227
It doesnt work it still does not have focus, i think focus has been given to the icon in the tray
Mits
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1339228
It depends on where do you call that......Did you try in OnShow()
0
 

Author Comment

by:Mitsy
ID: 1339229
hey viktornet
i can now bring the form to front with setWindowPos in win API but still cant give focus, the title bar is greyed.
Mitsy
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1339230
Would you please send me the project so I can take a loot at it???
0
 

Author Comment

by:Mitsy
ID: 1339231
ok i will
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1339232
I sent you some suggestions........You could also try this.....

public
  Procedure ActiveApp(Sender : TObject);
{...}
In OnCreate() enter this code...
Application.OnActivate := ActiveApp;
//The code for the AcitveApp() procedure...
procedure TForm1.ActiveApp(Sender : TObject);
begin
  if Visible then
    Hide
  else
  begin
    if not(GetForegroundWindow = Handle) then
      SetForegroundWindow(Handle);
  end;
end;

Try this if the suggestions I gave you don't work....

Regards,
Viktor Ivanov
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

604 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