Notify if any other windiw is open!

My problem is:
I have java swing program which is full screen size. My question is how i notify if any other program open window in a background of my program?
thank you
grajzlAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
girionisConnect With a Mentor Commented:
I am afraid you will need to use JNI for this.
0
 
objectsCommented:
you cant (without using JNI)
0
 
armoghanConnect With a Mentor Commented:
You have to use JNI for sure..
How let me give you a hint
if you are talking about windows os

Use SetWindowsHookEx to create a hook for WH_SHELL.
In your ShellProc handle HSHELL_WINDOWCREATED.
After you've launched your app, start waiting.
For each new window created, your ShellProc will be called.
For each window call GetWindowThreadProcessId(hWnd, &dwProcessID);
Compare the dwProcessID of the newly created window with the processid you got from CreateProces.
If those two processids are not equal you've found the window for the new application .

Hope it helps ;)
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.