Solved

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

Posted on 2000-03-15
2
235 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
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.

747 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

14 Experts available now in Live!

Get 1:1 Help Now