Solved

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

Posted on 2000-03-15
2
238 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
fibonacci ten numbers 4 54
How  Can  I  resolve   this  Error "java.sql.SQLException: Invalid column index" 4 56
runtime exception 2 50
learn programming 8 66
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…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
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 covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

735 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