Solved

runing Java app in background, and iconized in the system tray

Posted on 2000-03-15
2
237 Views
Last Modified: 2006-11-17
I need to start a Java app in the background (winNT/9x), and iconized itself in the system tray.  I know I have to write a native program to call the VRM to call the app.  Would someone please point me to some web sites have detail instructions and templates?

Many thanks
Joey :)
0
Comment
Question by:joey9394
2 Comments
 

Accepted Solution

by:
dipak_kr_ghosh earned 50 total points
ID: 2622720
you will have to follow as shown below to iconize something into system tray.

#define TRAYMSSAGE WM_USER+1

NOTIFYICONDATA nic;

nic.cbSize = sizeof(nic);
nic.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_ICON));
nic.hwnd = hwnd;
nic.szTip = (char*)malloc(30);
strcpy(nic.szTip,"Review Sheet Generator"
);
nic.uCallbackMessage = WM_TRAYMSSAGE;
nic.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP
nic.uID = 1
Shell_NotifyIcon(NIM_ADD,nic);

When a user interacts with the icon in the tray it will send WM_TRAYMSSAGE message to the window procedure for the window(hwnd). wParam gives you the iconID which is here 1 and lParam gives you the mouse event.

You have to be a bit tricky. you can use JNI and call a VC dll. create a invisible window. use its handle as value of the 3rd member of nic. and in event-handling, you communicate with your java application.

Fell free for any clarification.
0
 

Author Comment

by:joey9394
ID: 2626398
dipak_kr_ghosh,

  Thanks for your quick response.  I am not familiar with the Win32's system functions. Your code is pretty alien to me, but you gave me a starting point to dig in now.  Thanks a lot!!

Joey :)
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

770 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