Print Page | Close Window

How can capture MDI Tab LBUTTONDBCLK

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=1402
Printed Date: 21 May 2024 at 6:44pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How can capture MDI Tab LBUTTONDBCLK
Posted By: zhou_wz
Subject: How can capture MDI Tab LBUTTONDBCLK
Date Posted: 12 November 2004 at 10:47pm

I capture left button double click in TabMouseMsg() to close currenct view

as samples do on RBUTTONDOWN to create a popup menu on MDITab

but it doesnt work!

I use XTP 8.70

I check the code and find LBUTTONDBCLK is the same position as RBUTTONDOWN, but why can't i catch LBUTTONDBCLK as sample does in MainFrm.cpp




Replies:
Posted By: Oleg
Date Posted: 16 November 2004 at 3:46am

ON_MESSAGE(WM_XTP_PRETRANSLATEMOUSEMSG, OnTabbarMouseMsg)

LRESULT CMainFrame::OnTabbarMouseMsg(WPARAM wParam,LPARAM lParam)
{

if (wParam == WM_LBUTTONDBCLK)

{

...

return TRUE;
}

return FALSE

}



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


Posted By: zhou_wz
Date Posted: 16 November 2004 at 7:07pm
I had done that before I asked here!
Actually, I  wrote as

LRESULT CMainFrame::OnTabbarMouseMsg(WPARAM wParam,LPARAM lParam)
{

if (wParam == WM_LBUTTONDBCLK)

{
TRACE("captured");// Never go to this line

return TRUE;
}

Even in your mditab sample, i just add a branch do deal WM_LBUTTONDBCLK, it doesn't work too!
That means WM_LBUTTONDBCLK is lost!

I try another message WM_LBUTTONDOWN, it can be captured in ON_MESSAGE(WM_XTP_PRETRANSLATEMOUSEMSG, OnTabbarMouseMsg)

Why this happens?

Have you added  WM_LBUTTONDBCL Ksuccessfully before your replied?


Posted By: Oleg
Date Posted: 16 November 2004 at 11:55pm

ok, you catch me, I didn't test it. :)

You need to patch source code to make it work. Find

AfxRegisterWndClass(0, LoadCursor(0, IDC_ARROW) in XTPTabClientWnd.cpp

and replace it to

AfxRegisterWndClass(CS_DBLCLKS, LoadCursor(0, IDC_ARROW)

 

 



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


Posted By: zhou_wz
Date Posted: 18 November 2004 at 7:37am

It proved that you didnt't try your solution before you replied:)
You are so kind:)
THanks a lot !
I'll try it


Posted By: zhou_wz
Date Posted: 18 November 2004 at 6:01pm
Sorry Oleg, I tried as you told!
But nothing changed!

And I checked  MSDN,
AfxRegisterWndClass(0, LoadCursor(0, IDC_ARROW)
if the first input parameter  is  NULL,  that means  the  style  is  CS_DBLCLKS!

Is this the solution for my question after testing?


Posted By: Oleg
Date Posted: 18 November 2004 at 11:30pm
Yes, I tested it. Be sure you rebuild dll and _use it_ (may be you need to copy it in debug folder)

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


Posted By: zhou_wz
Date Posted: 20 November 2004 at 3:34am
oleg!
I failed!
I did what you said!
I replaced 0->CS_DBCLKS in XTPClientWnd.cpp's Addworkspace();
But i must emphasized I used XTP8.7!
We used different version or you patch more than the only file!



Posted By: Oleg
Date Posted: 22 November 2004 at 2:29am

Hmm. I think you have EnableGroups option enabled

do you have

VERIFY(m_MTIClientWnd.Attach(this));

or

VERIFY(m_MTIClientWnd.Attach(this, TRUE));



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


Posted By: zhou_wz
Date Posted: 23 November 2004 at 4:50am
Thanks oleg!

I solve  it!

Now,  I disable Groups Option on MTIClientWnd like this, as you said!

m_MTIClientWnd.Attach(this)// I had used m_MTIClientWnd.Attach(this, TRUE), so can't capture
         &nbs p;         &nbs p;         &nbs p;         &nbs p;      // the double clicks on MDITab
Now It works!
And why this happens?
Why groups enable, The WM_LBUTTONDBCLK is missed!




Posted By: Oleg
Date Posted: 24 November 2004 at 12:04am

If groups enabled, MDIClient has no CS_DBLCLICK style.

to fix it for groups add:

SetClassLong(m_MTIClientWnd.GetSafeHwnd(), GCL_STYLE, GetClassLong(m_MTIClientWnd.GetSafeHwnd(), GCL_STYLE) | CS_DBLCLKS);



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