Print Page | Close Window

CXTTrayIcon does not send commands to propsheet

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=13093
Printed Date: 21 May 2024 at 10:04am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTTrayIcon does not send commands to propsheet
Posted By: evoX
Subject: CXTTrayIcon does not send commands to propsheet
Date Posted: 06 January 2009 at 8:05pm

I have a CXTPPropertySheet dialog as main application window and I use CXTTrayIcon to minimize as tray icon.

The problem is that the menu commands from CXTTrayIcon are not sent to CXTPPropertySheet, only ID_APP_EXIT and SC_RESTORE is working.
 
Am I doing something wrong or this is a bug in CXTTrayIcon ?
 
Thanks !


-------------
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)



Replies:
Posted By: Oleg
Date Posted: 07 January 2009 at 1:47pm
Hi,
 
When you call m_TrayIcon.Create method do you have your propertySheet created ?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: evoX
Date Posted: 07 January 2009 at 2:11pm
I call it in the OnInitDialog of the propertysheet, after the commandbars initialization, and the commandbars toolbar is working.
 

// Create the tray icon.

if (!m_TrayIcon.Create(

_T("Application Title"), // Toolktip text

this, // Parent window

IDR_MAINFRAME, // Icon resource ID

IDR_POPUP, // Resource ID of popup menu

IDR_RESTORE, // Default menu item for popup menu

false)) // True if default menu item is located by position

{

TRACE0("Failed to create tray icon\n");

return -1;

}



-------------
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)


Posted By: Oleg
Date Posted: 07 January 2009 at 3:16pm
Hi,
Do you show Standard Menu or our CXTPPopupBar ?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: evoX
Date Posted: 07 January 2009 at 6:26pm
Hi,
Standard menu


-------------
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)


Posted By: Oleg
Date Posted: 08 January 2009 at 1:14am
Hello,
 
Works for me.
Here changed sample: https://forum.codejock.com/uploads/20090108_011411_TrayIconDlg.zip - TrayIconDlg.zip


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: evoX
Date Posted: 08 January 2009 at 10:35am
Hi,
  The sample cannot be compiled....
 

1>d:\trayicon\trayicondlg\samplesheet.cpp(36) : error C2440: 'static_cast' : cannot convert from 'BOOL (__thiscall CSampleSheet::* )(void)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'

1> None of the functions with this name in scope match the target type

1>d:\trayicon\trayicondlg\samplesheet.cpp(68) : error C2665: 'AfxMessageBox' : none of the 2 overloads could convert all the argument types

1> d:\vs\vc\atlmfc\include\afxwin.h(5372): could be 'int AfxMessageBox(LPCTSTR,UINT,UINT)'

1> d:\vs\vc\atlmfc\include\afxwin.h(5374): or 'int AfxMessageBox(UINT,UINT,UINT)'

1> while trying to match the argument list '(const char [4])'

1>d:\trayicon\trayicondlg\samplesheet.cpp(74) : error C2665: 'AfxMessageBox' : none of the 2 overloads could convert all the argument types

1> d:\vs\vc\atlmfc\include\afxwin.h(5372): could be 'int AfxMessageBox(LPCTSTR,UINT,UINT)'

1> d:\vs\vc\atlmfc\include\afxwin.h(5374): or 'int AfxMessageBox(UINT,UINT,UINT)'

1> while trying to match the argument list '(const char [5])'

1>TrayIconDlg.cpp

1>d:\trayicon\trayicondlg\trayicondlg.cpp(82) : error C2664: 'CSampleSheet::CSampleSheet(UINT,CWnd *,UINT)' : cannot convert parameter 1 from 'const char [6]' to 'UINT'

1> There is no context in which this conversion is possible



-------------
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)


Posted By: evoX
Date Posted: 08 January 2009 at 10:40am
Is it possible that in my application does not work because I am using a CommandBars toolbar in the propertyseet ? which also sends commands to propertysheet

-------------
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)


Posted By: Oleg
Date Posted: 09 January 2009 at 1:41am
No. It can't be reason.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: evoX
Date Posted: 09 January 2009 at 1:24pm
Hi,
  I have deleted the entire project files and recompiled and now it works :)
 
  It also was a problem with IDM_ABOUTBOX message which now I have added to ON_COMMAND and display the box instead of using the OnSysCommand to display it.


-------------
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)


Posted By: Oleg
Date Posted: 09 January 2009 at 3:52pm
good :)

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net