Print Page | Close Window

CLOSE Button functionality overridden: SKIN

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=12680
Printed Date: 04 December 2024 at 9:27pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CLOSE Button functionality overridden: SKIN
Posted By: prashant
Subject: CLOSE Button functionality overridden: SKIN
Date Posted: 14 November 2008 at 4:39am
I have small pop up window within my application having CLOSE button over it.

If I include following piece of code in my applications InitInstance() then I am unable to Click on Pop up windows Close button.

CODE:-

    TCHAR szStylesPath[_MAX_PATH];
    CString m_strStylesPath;

    VERIFY(::GetModuleFileName(
        AfxGetApp()->m_hInstance, szStylesPath, _MAX_PATH));       
   
    m_strStylesPath = szStylesPath;
    int nIndex  = m_strStylesPath.ReverseFind(_T('\\'));
    if (nIndex > 0) {
        m_strStylesPath = m_strStylesPath.Left(nIndex);
    }
    else {
        m_strStylesPath.Empty();
    }
    m_strStylesPath += _T("\\Styles\\");

    XTPSkinManager()->SetApplyOptions(XTPSkinManager()->GetApplyOptions() | xtpSkinApplyMetrics );
 
    BOOL bRes=XTPSkinManager()->LoadSkin(m_strStylesPath + _T("WinXP.Luna.cjstyles"), _T("NORMALBLUE.INI"));


CALL STACK:-

CXTPSkinManagerApiHook::CallWindowProcOrig(long (HWND__ *, unsigned int, unsigned int, long)* 0x5f492613 AfxWndProcBase(HWND__ *, unsigned int, unsigned int, long), HWND__ * 0x001a0862, unsigned int 273, unsigned int 33155, long 0) line 209 + 25 bytes
CXTPSkinManager::DoCallWindowProc(long (HWND__ *, unsigned int, unsigned int, long)* 0x5f492613 AfxWndProcBase(HWND__ *, unsigned int, unsigned int, long), HWND__ * 0x001a0862, unsigned int 273, unsigned int 33155, long 0) line 637
CXTPSkinManager::HookWndProc(HWND__ * 0x001a0862, unsigned int 273, unsigned int 33155, long 0) line 690 + 25 bytes

Please suggest me some solution. Thanks in advance.




Replies:
Posted By: prashant
Date Posted: 14 November 2008 at 5:24am
Window Creation Parameters as follows:

hWnd = ::CreateWindow(f_class, string,
                WS_CLIPSIBLINGS | WS_CHILD | WS_BORDER | WS_CAPTION | DS_LOCALEDIT | WS_SYSMENU ,
                WNDX, WNDY,
                WNDWIDTH, WNDHEIGHT,
                m_hWnd, 0, hInstPim, NULL);

Also I f I applied following line of code after CreateWindow() then CLOSE button working fine but now Skin is disabled for Pop up window.

XTPSkinManager()->Remove(hWnd);  


Posted By: prashant
Date Posted: 17 November 2008 at 8:05am
Please find attached sample. uploads/20081117_080439_Test.zip - uploads/20081117_080439_Test.zip


Posted By: Oleg
Date Posted: 17 November 2008 at 8:54am
Hi,
BUTTON with WS_CAPTION too difficult for SkinFramework. Create simple frame and add button as child.


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


Posted By: prashant
Date Posted: 17 November 2008 at 9:25am
Please explain, I commented out WS_CAPTION without success.

Let me explain how I am creating this popup window.

1) I am creating CXTPCalendarControl

2) Inside Codejock Calendar control I am creating this popup window using following piece of code

hWnd = ::CreateWindow(f_class, string,
                WS_CLIPSIBLINGS | WS_CHILD | WS_BORDER | WS_CAPTION |   DS_LOCALEDIT | WS_SYSMENU ,
                WNDX, WNDY,
                WNDWIDTH, WNDHEIGHT,
                m_hWnd, 0, hInstPim, NULL);

Please send me modified sample application or explain the resolution in detail.

Thanks for your valuable feedback.


Posted By: Oleg
Date Posted: 17 November 2008 at 1:10pm
Hi,
 
Add lines
 
::SetWindowPos(hwndG1B1, HWND_TOP, 0, 0, 100, 100, SWP_NOMOVE|SWP_NOSIZE);
 
GetCalendarCtrl().ModifyStyle(0, WS_CLIPSIBLINGS|WS_CLIPCHILDREN);
 
after you create popup.


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


Posted By: prashant
Date Posted: 21 November 2008 at 2:07am
uploads/20081121_030501_Test.zip - uploads/20081121_030501_Test.zip

Hi Oleg,

Tried the above code with no success.
Can you please provide any other alternative?

Problem exists in attached sample project. Please send me modified project with the resolution.

Thanks a lot.


Posted By: prashant
Date Posted: 24 November 2008 at 6:04am
Hi Oleg,

Please suggest alternative. It's bit urgent.


Posted By: Oleg
Date Posted: 24 November 2008 at 6:31am
Hi,
 
I don't see suggested lines in attached sample.
 
Add lines
 
::SetWindowPos(hwndG1B1, HWND_TOP, 0, 0, 100, 100, SWP_NOMOVE|SWP_NOSIZE);
 
GetCalendarCtrl().ModifyStyle(0, WS_CLIPSIBLINGS|WS_CLIPCHILDREN);
 
in the end of CCalViewNew::OnCreate.


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


Posted By: prashant
Date Posted: 24 November 2008 at 8:21am
Thanks, Good news is working in attached sample.
But strangely enough, not working in my Project

(Styles folder was not present when I tested this, problem still exists after applying 2 lines suggested by you.)


Posted By: prashant
Date Posted: 26 November 2008 at 3:27am
uploads/20081126_044116_Test.zip - uploads/20081126_044116_Test.zip

Hi Oleg,

Added two lines of code suggested by you, still able to reproduce CLOSE button problem.

1) Please find attached sample (Code suggested by you is present)

2) Also while running please copy "Styles" folder in your uploads/20081126_032711_Test.zip - application path .

Please suggest me some solution as early as possible.

Thanks.


Posted By: prashant
Date Posted: 26 November 2008 at 6:41am
Hi Oleg,

Please suggest some solution. This is the last problem remained in my product and a show stopper too. ( For this release )


Posted By: Oleg
Date Posted: 26 November 2008 at 7:44am
Hi,
 
Now it works for me :(
What exactly doesn't work ? You can't click Close button in caption ? What SkinFramework version you have ?


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


Posted By: prashant
Date Posted: 26 November 2008 at 11:38pm
Hi Oleg,

I can see "CLOSE" (X) button on caption bar but unable to click on the same.

I am using CodeJock version 11.2.2 and Copied "Styles folder" from following path in the Debug folder of my App:-
"C:\Program Files\Codejock Software\MFC\Xtreme ToolkitPro v11.2.2\Bin\vc60\Styles"

Snapshot of Test Application:







Posted By: prashant
Date Posted: 26 November 2008 at 11:48pm
Hi Oleg,

Here is the snapshot of my application and also for your convenience attaching Styles folder that I am using.


uploads/20081126_235101_Styles.zip - uploads/20081126_235101_Styles.zip





Posted By: Oleg
Date Posted: 27 November 2008 at 2:00am
Hi,
 
Maybe problem in version you have:(
You have active subscription, so upgrade to 12.1 will be free.
Please upgrade.


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


Posted By: prashant
Date Posted: 27 November 2008 at 8:39am
Thank God and Thanks to you Oleg :)
Problem resolved with 12.1 version,

cheers


Posted By: Oleg
Date Posted: 27 November 2008 at 2:22pm

Great! :)



-------------
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