Solved

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

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How  can  i  resolve  HTTP Status 404 -? 8 76
Which non-HTML GUI front end to use with Java? 3 65
Is there a simpler dropbox system? 10 51
Session in java desktop 5 36
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
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 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:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

738 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