I need to write one JAVA application.
The requirement is ,
when the user clicked anywhere in the
screen ( It may be upon an icon in
Desktop or upon one word in Microft
word ) , my java program should be
notified to do some action.
How can I write such an application.
You are talking about creating a system wide hook (windows API call SetWindowsHookEx with WM_MOUSE or WM_MOUSELL). This is not for the faint of heart. Doing this for a single process that you own is a bit tricky. Doing it system-wide (for processes that you don’t own) is really, really tricky – lot’s of pitfalls (I’m pretty sure I’ve hit every single one), and this is one severely under-documented area of the Win32 API.
This will absolutely require using the Windows API, as well as DLLs, an understanding of injection of DLLs into different processes and a host of other things. Java isn’t going to get this particular job done (in fact, based on your specification, I can’t imagine why Java would be the language of choice here).
Time to break out the C.