Solved

Top Level Form handle

Posted on 2004-08-09
3
186 Views
Last Modified: 2010-04-05
If I have a main form in an application, and then a button on that main form that opens up a sub form on top of the Main form.

How can I get the handle of the subform (the top level form)?

regards
Myles
0
Comment
Question by:myleseven2
3 Comments
 
LVL 7

Accepted Solution

by:
LRHGuy earned 75 total points
ID: 11759262
Try using:

H:=Screen.ActiveForm.Handle;

0
 
LVL 2

Expert Comment

by:wolsen
ID: 11759431
use GetTopWindow

From the windows SDK help:

"The GetTopWindow function examines the Z order of the child windows associated with the specified parent window and retrieves the handle of the child window at the top of the Z order."
0
 

Author Comment

by:myleseven2
ID: 11759650
That is awesome thanks
Myles
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

914 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

17 Experts available now in Live!

Get 1:1 Help Now