Implementing Windows System tray
From: ouj (ouj_at_aludra.usc.edu)
Date: 10/28/04
- Previous message: Bryan Oakley: "Re: How to change current directory in Expect Script?"
- Next in thread: Melissa Schrumpf: "Re: Implementing Windows System tray"
- Reply: Melissa Schrumpf: "Re: Implementing Windows System tray"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 28 Oct 2004 11:26:36 -0700
First of all, I know that winico is there. The purpose of doing it myself
is to help me to better understand the programming model of Tcl/Tk and
compare them with Java. Also, it seems that winico follows different
approach from mine for handling this issue.
I developed a Java JNI class dealing with System tray on Windows myself.
Now, I want to move my code from Java to Tk. Every thing is fine until the
last step of my code requires the following loop.
This loop is fine for Java since Java is multithreaded. Java won't wait
for the completion of an command and continue to execute the other stuff.
Thus, having such an event loop in JNI is fine for Java. However, Tcl/Tk
is single-threaded by default. It seems to me that Tk uses some loops to
handle its own messages. However, I have to deal with the event loops for
the Windows system tray. Is there any way that I can add this message loop
to the Tk's own event loop? Or is there any better solution for this
kind of problems?
Sincerely hope that some one can help me out. Thanks a lot in advance!
Jingzhao
========================================
MSG msg; BOOL bRet;
// Start the message loop.
while((bRet = GetMessage(&msg, NULL, 0, 0)) != 0)
{
if (bRet == -1)
{
// handle the error and possibly exit
}
else
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
========================================
- Previous message: Bryan Oakley: "Re: How to change current directory in Expect Script?"
- Next in thread: Melissa Schrumpf: "Re: Implementing Windows System tray"
- Reply: Melissa Schrumpf: "Re: Implementing Windows System tray"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|