Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Burak Petekkaya
|
Apr 11, 2007 - 1:14 PM
|
Hi,
I have a visual c++ mfc application with prof-UIS.
I init Theme Switcher Toolbar on my MainFrame OnCreated Method.
I want to realize Theme Changes permanently.So,my MainFrame should take message from Theme Switcher Toolbar control.
How can my MainFrame take message when Theme Switcher Toolbar Button Clicked At Runtime?
|
|
Suhai Gyorgy
|
Apr 12, 2007 - 1:51 AM
|
Go for Support’s solution, and forget about ThemeSwitcher_OnButtonInvoke. You can’t take a message. But I guess you’d use the message to associate a message-handler with it anyway. So if you use Support’s solution on your CMainFrame, your code would look something like this: // In .h file:
class CMainFrame
: public CFrameWnd
, public CExtPmBridge
{
public:
DECLARE_CExtPmBridge_MEMBERS( CMainFrame );
CMainFrame();
~CMainFrame();
virtual void PmBridge_OnPaintManagerChanged(
CExtPaintManager * pGlobalPM
);
. . .
};
// In .cpp file:
IMPLEMENT_CExtPmBridge_MEMBERS( CMainFrame );
CMainFrame::CMainFrame()
{
PmBridge_Install(); // Subscribe
...
}
CMainFrame::~CMainFrame()
{
...
PmBridge_Uninstall(); // Unsubscribe
}
void CMainFrame::PmBridge_OnPaintManagerChanged(
CExtPaintManager * pGlobalPM
)
{
// place code here that you’d like to put in you message-handler
...
//call base class method to have the theme changed
CExtPmBridge::PmBridge_OnPaintManagerChanged(
pGlobalPM
);
}
So PmBridge_OnPaintManagerChanged method could act like your message-handler method.
|
|