Top Level Form handle

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
myleseven2Asked:
Who is Participating?
 
LRHGuyConnect With a Mentor Commented:
Try using:

H:=Screen.ActiveForm.Handle;

0
 
wolsenCommented:
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
 
myleseven2Author Commented:
That is awesome thanks
Myles
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.