Solved

Give the focus to my window

Posted on 1998-12-30
6
161 Views
Last Modified: 2010-04-04
How can I get a window of my program to the front (When I click on the tray icon my program should come to the front)
?
0
Comment
Question by:Shellman
[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
6 Comments
 
LVL 5

Accepted Solution

by:
heathprovost earned 50 total points
ID: 1353867
Try this
.....your onclick code here
SetForeGroundWindow(YourForm.Handle);

Hope this helps
0
 
LVL 5

Expert Comment

by:heathprovost
ID: 1353868
Does my solution work? Waiting for a response....
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1353869
You should call
  SetForegroundWindow(Application.Handle);
and
  Application.ProcessMessages;
before displaying anything like popup menus. Only these two commands in this order will make sure that everything is fine...

Regards, Madshi.
0
Technology Partners: 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: 1353870
You could do this...

MyForm.BringToFront;

or you could do ....

SetActiveForm(Whatever);

-Viktor
--Ivanov
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1353871
actually SetActiveWindow(Whatever); isntead of SetActiveForm(Whatever);
0
 

Author Comment

by:Shellman
ID: 1353872
Thank you. This helps.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

752 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