Notify bug ?
Posted: Thu Mar 03, 2011 12:25 pm
Hi all
I need an application that runs without a visible window and I am trying to use the notify options in the window class.
But it did not work as I expect...
If the main window is visible everything goes Ok.
But the application closes itself when the main window is hidden.
See this sample code:
If I open the notify menu in the tray bar and click Hide Main Window the main window goes invisible as expected.
But if I left-click the icon in the tray, executing the :OnNotifyClick block, the block is executed and after that the application simply closes...
I tried to review the code but was unable to identify why is this happening.
I need an application that runs without a visible window and I am trying to use the notify options in the window class.
But it did not work as I expect...
If the main window is visible everything goes Ok.
But the application closes itself when the main window is hidden.
See this sample code:
Code: Select all
#include "hbqtgui.ch"
#include "hmg.ch"
Function Main
public oWindow
With Object oWindow := Window():New()
:Width := 400
:Height := 400
:Title := 'Hide bug...'
:Type := WND_MAIN
:NotifyIcon := 'Hide bug...'
:NotifyToolTip := 'Hi All!'
:OnNotifyClick := { || msginfo('Notify Icon Clicked!') }
With Object oNotify := NotifyMenu():New(oWindow)
oItemHide := MenuItem():New( 'Hide Main Window' , { || oWindow:Hide() } ) ; :AddItem(oItemHide)
:AddSeparator()
oItemShow := MenuItem():New( 'Show Main Window' , { || oWindow:Show() } ) ; :AddItem(oItemShow)
End With
End With
oWindow:Activate()
Return Nil
But if I left-click the icon in the tray, executing the :OnNotifyClick block, the block is executed and after that the application simply closes...
I tried to review the code but was unable to identify why is this happening.