Solved

Notify if any other windiw is open!

Posted on 2004-10-01
6
213 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
split53 challenge 7 97
Java Loop 6 61
hibernate insert example 13 29
Java: How do I open the default windows program for a given file type 3 28
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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 …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

778 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