Solved

Notify if any other windiw is open!

Posted on 2004-10-01
6
201 Views
Last Modified: 2010-05-19
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
0
Comment
Question by:grajzl
  • 2
6 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 63 total points
ID: 12198227
I am afraid you will need to use JNI for this.
0
 
LVL 35

Expert Comment

by:girionis
ID: 12198228
0
 
LVL 92

Expert Comment

by:objects
ID: 12198229
you cant (without using JNI)
0
 
LVL 18

Assisted Solution

by:armoghan
armoghan earned 62 total points
ID: 12198447
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

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

Title # Comments Views Activity
Systems talking to each other 5 123
Running Jira on Raspberry PI 2? 3 246
micro services spring boot application error 3 136
Java SE 8u111  Lot of stuff broke 11 52
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

943 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

6 Experts available now in Live!

Get 1:1 Help Now