|
|
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » tray icon & balloon notification
tray icon & balloon notification [message #772] |
Wed, 01 February 2006 16:32  |
hojtsy
Messages: 241 Registered: January 2006 Location: Budapest, Hungary
|
Experienced Member |
|
|
I would like to to put an icon into the tray (notification area) on Windows. I also would like to display notification balloons even when my application is not in focus. Is this supported by U++?
|
|
|
|
Re: tray icon & balloon notification [message #778 is a reply to message #772] |
Thu, 02 February 2006 08:51   |
|
I have modified a TaskbarButton class posted by Tom to work with my Ultimate Player (it was not compatybile with newest upp). It is not finished, but you can use it 
This is how I use it:
struct MyApp : TopWindow
{
TaskbarButton tray;
}
main...
MyApp app;
app.Open()
app.tray.Icon(MyIcon()).Label("MyApp");
app.tray.Init(app.GetHWND());
app.Run();
Use WhenDouble and WhenBar callbacks to add action for double click and popup menu.
Here it is the question to Mirek. As you can see I have to open appilication first to get the HWND for tray. It isn't the upp way . I saw that Tom was using (overloading) CrateInit(HWND hwnd) method wich is not supported now and which was called when hwnd was known (I suppose so). This was very useful and made code much clener. Is it possible to get this method back?
|
|
|
|
Re: tray icon & balloon notification [message #790 is a reply to message #788] |
Thu, 02 February 2006 21:32   |
|
Hmm, what you mean by that?
Are you suggesting adding Open mathod to the TaskbarButton class like this one...
TaskbarButton::Open(TopWindow &wnd)
{
wnd.Open()
}
.. to reduce main initialize code?
Frankly I would like to have a better solution. I had the same problem with other 3rd party libraries which required to pass to them hwnd value. What about adding WhenShow callback in TopWindow class which should be called when hwnd is accessible?
|
|
|
|
Re: tray icon & balloon notification [message #804 is a reply to message #796] |
Fri, 03 February 2006 08:45   |
|
Yes, I know, but to make the condition reason == OPEN true I need call Add in main application constructor:
App()
{
Add(tray);
}
I don't want to do that, because tray control is not a layout control and the final result is a red box (in debug mode) displayed in the left-upper corner (it is ok as I did not set position and tray dosn't have a Paint method).
Could you add another value for reason - WINDOW? In this state GetHWND() should return a proper handle.
|
|
|
|
|
|
|
|
|
|
|
Re: tray icon & balloon notification [message #890 is a reply to message #872] |
Tue, 07 February 2006 13:09   |
hojtsy
Messages: 241 Registered: January 2006 Location: Budapest, Hungary
|
Experienced Member |
|
|
ExStyle(GetExStyle() | WS_EX_TOPMOST); Still not OK in 602 beta. It results in some kind of freezing of the window. It can no longer be resized, only moved, controls in the window no longer react to mouse clicks, and right click on the title bar opens up an incorrectly aligned menu, which contains the only way to close the application (not counting killing from Task Manager).
[Updated on: Tue, 07 February 2006 13:10] Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Tue Apr 29 00:18:02 CEST 2025
Total time taken to generate the page: 0.01111 seconds
|
|
|