Solved

Give the focus to my window

Posted on 1998-12-30
6
155 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
6 Comments
 
LVL 5

Accepted Solution

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

Hope this helps
0
 
LVL 5

Expert Comment

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

Expert Comment

by:Madshi
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 10

Expert Comment

by:viktornet
Comment Utility
You could do this...

MyForm.BringToFront;

or you could do ....

SetActiveForm(Whatever);

-Viktor
--Ivanov
0
 
LVL 10

Expert Comment

by:viktornet
Comment Utility
actually SetActiveWindow(Whatever); isntead of SetActiveForm(Whatever);
0
 

Author Comment

by:Shellman
Comment Utility
Thank you. This helps.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now