Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

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

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
joey9394
Asked:
joey9394
1 Solution
 
dipak_kr_ghoshCommented:
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
 
joey9394Author Commented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now