Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTTrayIcon does not send commands to propsheet
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTTrayIcon does not send commands to propsheet

 Post Reply Post Reply
Author
Message
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Topic: CXTTrayIcon does not send commands to propsheet
    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)
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 07 January 2009 at 3:16pm
Hi,
Do you show Standard Menu or our CXTPPopupBar ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Posted: 07 January 2009 at 6:26pm
Hi,
Standard menu
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 08 January 2009 at 1:14am
Hello,
 
Works for me.
Here changed sample: TrayIconDlg.zip
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 09 January 2009 at 1:41am
No. It can't be reason.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 09 January 2009 at 3:52pm
good :)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.