Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How can capture MDI Tab LBUTTONDBCLK
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How can capture MDI Tab LBUTTONDBCLK

 Post Reply Post Reply
Author
Message Reverse Sort Order
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 Topic: How can capture MDI Tab LBUTTONDBCLK
    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
Back to Top
zhou_wz View Drop Down
Groupie
Groupie


Joined: 11 December 2003
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote zhou_wz Quote  Post ReplyReply Direct Link To This Post 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!


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: 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
Back to Top
zhou_wz View Drop Down
Groupie
Groupie


Joined: 11 December 2003
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote zhou_wz Quote  Post ReplyReply Direct Link To This Post 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!

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: 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
Back to Top
zhou_wz View Drop Down
Groupie
Groupie


Joined: 11 December 2003
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote zhou_wz Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
zhou_wz View Drop Down
Groupie
Groupie


Joined: 11 December 2003
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote zhou_wz Quote  Post ReplyReply Direct Link To This Post 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
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: 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
Back to Top
zhou_wz View Drop Down
Groupie
Groupie


Joined: 11 December 2003
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote zhou_wz Quote  Post ReplyReply Direct Link To This Post 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?
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: 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
Back to Top
zhou_wz View Drop Down
Groupie
Groupie


Joined: 11 December 2003
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote zhou_wz Quote  Post ReplyReply Direct Link To This Post 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

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.109 seconds.