1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2008-2013 - TortoiseGit
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 // ProgressDlg.cpp : implementation file
23 #include "TortoiseProc.h"
24 #include "ProgressDlg.h"
27 #include "UnicodeUtils.h"
29 #include "LoglistCommonResource.h"
32 #include "SmartHandle.h"
33 #include "../TGitCache/CacheInterface.h"
34 #include "LoglistUtils.h"
36 // CProgressDlg dialog
38 IMPLEMENT_DYNAMIC(CProgressDlg
, CResizableStandAloneDialog
)
40 CProgressDlg::CProgressDlg(CWnd
* pParent
/*=NULL*/)
41 : CResizableStandAloneDialog(CProgressDlg::IDD
, pParent
), m_bShowCommand(true), m_bAutoCloseOnSuccess(false), m_bAbort(false), m_bDone(false), m_startTick(GetTickCount())
44 m_PostCmdCallback
= NULL
;
46 m_bAltAbortPress
=false;
51 CProgressDlg::~CProgressDlg()
59 void CProgressDlg::DoDataExchange(CDataExchange
* pDX
)
61 CDialog::DoDataExchange(pDX
);
62 DDX_Control(pDX
, IDC_CURRENT
, this->m_CurrentWork
);
63 DDX_Control(pDX
, IDC_TITLE_ANIMATE
, this->m_Animate
);
64 DDX_Control(pDX
, IDC_RUN_PROGRESS
, this->m_Progress
);
65 DDX_Control(pDX
, IDC_LOG
, this->m_Log
);
66 DDX_Control(pDX
, IDC_PROGRESS_BUTTON1
, this->m_ctrlPostCmd
);
69 BEGIN_MESSAGE_MAP(CProgressDlg
, CResizableStandAloneDialog
)
71 ON_MESSAGE(MSG_PROGRESSDLG_UPDATE_UI
, OnProgressUpdateUI
)
72 ON_BN_CLICKED(IDOK
, &CProgressDlg::OnBnClickedOk
)
73 ON_BN_CLICKED(IDC_PROGRESS_BUTTON1
,&CProgressDlg::OnBnClickedButton1
)
74 ON_REGISTERED_MESSAGE(WM_TASKBARBTNCREATED
, OnTaskbarBtnCreated
)
77 BOOL
CProgressDlg::OnInitDialog()
79 CResizableStandAloneDialog::OnInitDialog();
81 // Let the TaskbarButtonCreated message through the UIPI filter. If we don't
82 // do this, Explorer would be unable to send that message to our window if we
83 // were running elevated. It's OK to make the call all the time, since if we're
84 // not elevated, this is a no-op.
85 CHANGEFILTERSTRUCT cfs
= { sizeof(CHANGEFILTERSTRUCT
) };
86 typedef BOOL STDAPICALLTYPE
ChangeWindowMessageFilterExDFN(HWND hWnd
, UINT message
, DWORD action
, PCHANGEFILTERSTRUCT pChangeFilterStruct
);
87 CAutoLibrary hUser
= AtlLoadSystemLibraryUsingFullPath(_T("user32.dll"));
90 ChangeWindowMessageFilterExDFN
*pfnChangeWindowMessageFilterEx
= (ChangeWindowMessageFilterExDFN
*)GetProcAddress(hUser
, "ChangeWindowMessageFilterEx");
91 if (pfnChangeWindowMessageFilterEx
)
93 pfnChangeWindowMessageFilterEx(m_hWnd
, WM_TASKBARBTNCREATED
, MSGFLT_ALLOW
, &cfs
);
96 m_pTaskbarList
.Release();
97 m_pTaskbarList
.CoCreateInstance(CLSID_TaskbarList
);
99 AddAnchor(IDC_TITLE_ANIMATE
, TOP_LEFT
, TOP_RIGHT
);
100 AddAnchor(IDC_RUN_PROGRESS
, TOP_LEFT
,TOP_RIGHT
);
101 AddAnchor(IDC_LOG
, TOP_LEFT
,BOTTOM_RIGHT
);
103 AddAnchor(IDOK
,BOTTOM_RIGHT
);
104 AddAnchor(IDCANCEL
,BOTTOM_RIGHT
);
105 AddAnchor(IDC_PROGRESS_BUTTON1
,BOTTOM_LEFT
);
106 AddAnchor(IDC_CURRENT
,TOP_LEFT
);
108 this->GetDlgItem(IDC_PROGRESS_BUTTON1
)->ShowWindow(SW_HIDE
);
109 m_Animate
.Open(IDR_DOWNLOAD
);
112 CAppUtils::CreateFontForLogs(m_logFont
);
113 //GetDlgItem(IDC_CMD_LOG)->SetFont(&m_logFont);
114 m_Log
.SetFont(&m_logFont
);
117 if ( !m_PreText
.IsEmpty() )
119 InitialText
= m_PreText
+ _T("\r\n");
122 if (m_bShowCommand
&& (!m_GitCmd
.IsEmpty() ))
124 InitialText
+= m_GitCmd
+_T("\r\n\r\n");
127 m_Log
.SetWindowTextW(InitialText
);
128 m_CurrentWork
.SetWindowTextW(_T(""));
130 EnableSaveRestore(_T("ProgressDlg"));
132 m_pThread
= AfxBeginThread(ProgressThreadEntry
, this, THREAD_PRIORITY_NORMAL
,0,CREATE_SUSPENDED
);
135 // ReportError(CString(MAKEINTRESOURCE(IDS_ERR_THREADSTARTFAILED)));
139 m_pThread
->m_bAutoDelete
= FALSE
;
140 m_pThread
->ResumeThread();
143 if(!m_Title
.IsEmpty())
144 this->SetWindowText(m_Title
);
146 CString sWindowTitle
;
147 GetWindowText(sWindowTitle
);
148 CAppUtils::SetWindowTitle(m_hWnd
, g_Git
.m_CurrentDir
, sWindowTitle
);
150 // Make sure this dialog is shown in foreground (see issue #1536)
151 SetForegroundWindow();
156 UINT
CProgressDlg::ProgressThreadEntry(LPVOID pVoid
)
158 return ((CProgressDlg
*)pVoid
)->ProgressThread();
161 //static function, Share with SyncDialog
162 UINT
CProgressDlg::RunCmdList(CWnd
*pWnd
,std::vector
<CString
> &cmdlist
,bool bShowCommand
,CString
*pfilename
,bool *bAbort
,CGitByteArray
*pdata
)
166 PROCESS_INFORMATION pi
;
169 memset(&pi
,0,sizeof(PROCESS_INFORMATION
));
171 CBlockCacheForPath
cacheBlock(g_Git
.m_CurrentDir
);
173 pWnd
->PostMessage(MSG_PROGRESSDLG_UPDATE_UI
,MSG_PROGRESSDLG_START
,0);
178 for(int i
=0;i
<cmdlist
.size();i
++)
180 if(cmdlist
[i
].IsEmpty())
185 CStringA str
= CUnicodeUtils::GetMulti(cmdlist
[i
].Trim() + _T("\n\n"), CP_UTF8
);
186 for(int j
=0;j
<str
.GetLength();j
++)
190 pdata
->m_critSec
.Lock();
191 pdata
->push_back(str
[j
]);
192 pdata
->m_critSec
.Unlock();
195 pWnd
->PostMessage(MSG_PROGRESSDLG_UPDATE_UI
,MSG_PROGRESSDLG_RUN
,str
[j
]);
198 pWnd
->PostMessage(MSG_PROGRESSDLG_UPDATE_UI
,MSG_PROGRESSDLG_RUN
,0);
201 g_Git
.RunAsync(cmdlist
[i
].Trim(),&pi
, &hRead
, NULL
, pfilename
);
206 while(ReadFile(hRead
,&byte
,1,&readnumber
,NULL
))
213 pdata
->m_critSec
.Lock();
214 pdata
->push_back( byte
);
215 pdata
->m_critSec
.Unlock();
217 if(byte
== '\r' || byte
== '\n')
218 pWnd
->PostMessage(MSG_PROGRESSDLG_UPDATE_UI
,MSG_PROGRESSDLG_RUN
,0);
221 pWnd
->PostMessage(MSG_PROGRESSDLG_UPDATE_UI
,MSG_PROGRESSDLG_RUN
,byte
);
224 CloseHandle(pi
.hThread
);
226 WaitForSingleObject(pi
.hProcess
, INFINITE
);
229 if(!GetExitCodeProcess(pi
.hProcess
,&status
) || *bAbort
)
231 CloseHandle(pi
.hProcess
);
235 pWnd
->PostMessage(MSG_PROGRESSDLG_UPDATE_UI
, MSG_PROGRESSDLG_FAILED
, status
);
236 return TGIT_GIT_ERROR_GET_EXIT_CODE
;
241 CloseHandle(pi
.hProcess
);
245 pWnd
->PostMessage(MSG_PROGRESSDLG_UPDATE_UI
, MSG_PROGRESSDLG_END
, ret
);
251 UINT
CProgressDlg::ProgressThread()
254 m_GitCmdList
.push_back(m_GitCmd
);
258 if(m_LogFile
.IsEmpty())
261 pfilename
=&m_LogFile
;
263 m_startTick
= GetTickCount();
264 m_GitStatus
= RunCmdList(this,m_GitCmdList
,m_bShowCommand
,pfilename
,&m_bAbort
,&this->m_Databuf
);;
268 LRESULT
CProgressDlg::OnProgressUpdateUI(WPARAM wParam
,LPARAM lParam
)
270 if(wParam
== MSG_PROGRESSDLG_START
)
273 m_Animate
.Play(0, INT_MAX
, INT_MAX
);
274 this->DialogEnableWindow(IDOK
,FALSE
);
277 m_pTaskbarList
->SetProgressState(m_hWnd
, TBPF_NORMAL
);
278 m_pTaskbarList
->SetProgressValue(m_hWnd
, 0, 100);
281 if(wParam
== MSG_PROGRESSDLG_END
|| wParam
== MSG_PROGRESSDLG_FAILED
)
283 DWORD tickSpent
= GetTickCount() - m_startTick
;
284 CString strEndTime
= CLoglistUtils::FormatDateAndTime(CTime::GetCurrentTime(), DATE_SHORTDATE
, true, false);
288 m_Databuf
.m_critSec
.Lock();
289 m_Databuf
.push_back(0);
290 m_Databuf
.m_critSec
.Unlock();
292 m_Databuf
.m_critSec
.Lock();
293 m_Log
.SetWindowText(Convert2UnionCode((char*)&m_Databuf
[0]));
294 m_Databuf
.m_critSec
.Unlock();
295 m_Log
.LineScroll(m_Log
.GetLineCount() - m_Log
.GetFirstVisibleLine() - 4);
298 m_Databuf
.m_critSec
.Lock();
299 this->m_Databuf
.clear();
300 m_Databuf
.m_critSec
.Unlock();
304 m_Progress
.SetPos(100);
305 this->DialogEnableWindow(IDOK
,TRUE
);
307 m_GitStatus
= (DWORD
)lParam
;
309 // detect crashes of perl when performing git svn actions
310 if (m_GitStatus
== 0 && m_GitCmd
.Find(_T(" svn ")) > 1)
313 m_Log
.GetWindowText(log
);
314 if (log
.GetLength() > 18 && log
.Mid(log
.GetLength() - 18) == _T("perl.exe.stackdump"))
315 m_GitStatus
= (DWORD
)-1;
318 if(this->m_GitStatus
)
322 m_pTaskbarList
->SetProgressState(m_hWnd
, TBPF_ERROR
);
323 m_pTaskbarList
->SetProgressValue(m_hWnd
, 100, 100);
326 log
.Format(IDS_PROC_PROGRESS_GITUNCLEANEXIT
, m_GitStatus
);
328 err
.Format(_T("\r\n\r\n%s (%d ms @ %s)\r\n"), log
, tickSpent
, strEndTime
);
329 InsertColorText(this->m_Log
, err
, RGB(255,0,0));
333 m_pTaskbarList
->SetProgressState(m_hWnd
, TBPF_NOPROGRESS
);
335 temp
.LoadString(IDS_SUCCESS
);
337 log
.Format(_T("\r\n%s (%d ms @ %s)\r\n"), temp
, tickSpent
, strEndTime
);
338 InsertColorText(this->m_Log
, log
, RGB(0,0,255));
339 this->DialogEnableWindow(IDCANCEL
,FALSE
);
342 if (wParam
== MSG_PROGRESSDLG_END
)
344 if (m_PostCmdCallback
) // new handling method using callback
346 m_PostCmdCallback(this, m_caller
, m_GitStatus
);
348 if (m_PostCmdList
.GetCount() > 0)
350 m_ctrlPostCmd
.AddEntries(m_PostCmdList
);
351 GetDlgItem(IDC_PROGRESS_BUTTON1
)->ShowWindow(SW_SHOW
);
354 else if (m_GitStatus
== 0) // default old behaviour on success
356 if (m_PostCmdList
.GetCount() > 0)
358 m_ctrlPostCmd
.AddEntries(m_PostCmdList
);
359 GetDlgItem(IDC_PROGRESS_BUTTON1
)->ShowWindow(SW_SHOW
);
362 else // simple method to show buttons on failed
364 if (m_PostFailCmdList
.GetCount() > 0)
366 m_ctrlPostCmd
.AddEntries(m_PostFailCmdList
);
367 GetDlgItem(IDC_PROGRESS_BUTTON1
)->ShowWindow(SW_SHOW
);
372 if(wParam
== MSG_PROGRESSDLG_END
&& m_GitStatus
== 0)
374 if(m_bAutoCloseOnSuccess
)
376 m_Log
.GetWindowText(this->m_LogText
);
386 m_Databuf
.m_critSec
.Lock();
387 for(int i
=this->m_BufStart
;i
<this->m_Databuf
.size();i
++)
389 char c
= this->m_Databuf
[m_BufStart
];
391 m_Databuf
.m_critSec
.Unlock();
394 m_Databuf
.m_critSec
.Lock();
399 m_Databuf
.erase(m_Databuf
.begin(), m_Databuf
.begin()+m_BufStart
);
402 m_Databuf
.m_critSec
.Unlock();
406 ParserCmdOutput((char)lParam
);
411 //static function, Share with SyncDialog
412 int CProgressDlg::FindPercentage(CString
&log
)
414 int s1
=log
.Find(_T('%'));
419 for(int i
=s1
-1;i
>=0;i
--)
421 if(log
[i
]>=_T('0') && log
[i
]<=_T('9'))
426 return _ttol(log
.Mid(s2
,s1
-s2
));
429 void CProgressDlg::ParserCmdOutput(char ch
)
431 ParserCmdOutput(this->m_Log
,this->m_Progress
,this->m_hWnd
,this->m_pTaskbarList
,this->m_LogTextA
,ch
,&this->m_CurrentWork
);
433 void CProgressDlg::ClearESC(CString
&str
)
435 // see http://ascii-table.com/ansi-escape-sequences.php and http://tldp.org/HOWTO/Bash-Prompt-HOWTO/c327.html
436 str
.Replace(_T("\033[K"), _T("")); // erase until end of line; no need to care for this, because we always clear the whole line
441 int escapePosition
= str
.Find(_T('\033'));
442 if (escapePosition
>= 0 && str
.GetLength() >= escapePosition
+ 3)
444 if (str
.Mid(escapePosition
, 2) == _T("\033["))
446 int colorEnd
= str
.Find(_T('m'), escapePosition
+ 2);
450 for (int i
= escapePosition
+ 2; i
< colorEnd
; i
++)
452 if (str
[i
] != _T(';') && (str
[i
] < _T('0') && str
[i
] > _T('9')))
460 if (escapePosition
> 0)
461 str
= str
.Left(escapePosition
) + str
.Mid(colorEnd
+ 1);
463 str
= str
.Mid(colorEnd
);
472 void CProgressDlg::ParserCmdOutput(CRichEditCtrl
&log
,CProgressCtrl
&progressctrl
,HWND m_hWnd
,CComPtr
<ITaskbarList3
> m_pTaskbarList
,CStringA
&oneline
, char ch
, CWnd
*CurrentWork
)
474 //TRACE(_T("%c"),ch);
475 if( ch
== ('\r') || ch
== ('\n'))
479 // TRACE(_T("End Char %s \r\n"),ch==_T('\r')?_T("lf"):_T(""));
480 // TRACE(_T("End Char %s \r\n"),ch==_T('\n')?_T("cr"):_T(""));
482 int lines
= log
.GetLineCount();
483 g_Git
.StringAppend(&str
, (BYTE
*)oneline
.GetBuffer(), CP_UTF8
);
485 // TRACE(_T("%s"), str);
491 int start
=log
.LineIndex(lines
-1);
492 log
.SetSel(start
, log
.GetTextLength());
497 int length
= log
.GetWindowTextLength();
498 log
.SetSel(length
, length
);
500 log
.ReplaceSel(_T("\r\n") + str
);
505 if (lines
> 500) //limited log length
507 int end
=log
.LineIndex(1);
509 log
.ReplaceSel(_T(""));
511 log
.LineScroll(log
.GetLineCount() - log
.GetFirstVisibleLine() - 4);
513 int s1
=oneline
.ReverseFind(_T(':'));
514 int s2
=oneline
.Find(_T('%'));
515 if (s1
> 0 && s2
> 0)
518 CurrentWork
->SetWindowTextW(str
.Left(s1
));
520 int pos
=FindPercentage(str
);
521 TRACE(_T("Pos %d\r\n"),pos
);
524 progressctrl
.SetPos(pos
);
527 m_pTaskbarList
->SetProgressState(m_hWnd
, TBPF_NORMAL
);
528 m_pTaskbarList
->SetProgressValue(m_hWnd
, pos
, 100);
541 void CProgressDlg::RemoveLastLine(CString
&str
)
544 start
=str
.ReverseFind(_T('\n'));
549 // CProgressDlg message handlers
551 void CProgressDlg::OnBnClickedOk()
553 m_Log
.GetWindowText(this->m_LogText
);
557 void CProgressDlg::OnBnClickedButton1()
559 this->EndDialog((int)(IDC_PROGRESS_BUTTON1
+ this->m_ctrlPostCmd
.GetCurrentEntry()));
562 void CProgressDlg::OnClose()
564 DialogEnableWindow(IDCANCEL
, TRUE
);
568 void CProgressDlg::OnCancel()
573 CResizableStandAloneDialog::OnCancel();
577 if( g_Git
.m_CurrentGitPi
.hProcess
)
579 if(::GenerateConsoleCtrlEvent(CTRL_C_EVENT
,0))
581 ::WaitForSingleObject(g_Git
.m_CurrentGitPi
.hProcess
,10000);
588 KillProcessTree(g_Git
.m_CurrentGitPi
.dwProcessId
);
591 ::WaitForSingleObject(g_Git
.m_CurrentGitPi
.hProcess
,10000);
592 CResizableStandAloneDialog::OnCancel();
595 void CProgressDlg::KillProcessTree(DWORD dwProcessId
, unsigned int depth
)
597 // recursively kills a process tree
598 // This is not optimized, but works and isn't called very often ;)
600 if (!dwProcessId
|| depth
> 20)
604 memset(&pe
, 0, sizeof(PROCESSENTRY32
));
605 pe
.dwSize
= sizeof(PROCESSENTRY32
);
607 CAutoGeneralHandle hSnap
= ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS
, 0);
609 if (::Process32First(hSnap
, &pe
))
613 if (pe
.th32ParentProcessID
== dwProcessId
)
614 KillProcessTree(pe
.th32ProcessID
, depth
+ 1);
615 } while (::Process32Next(hSnap
, &pe
));
617 HANDLE hProc
= ::OpenProcess(PROCESS_TERMINATE
, FALSE
, dwProcessId
);
619 ::TerminateProcess(hProc
, 1);
623 void CProgressDlg::InsertCRLF()
625 m_Databuf
.m_critSec
.Lock();
626 for(int i
=0;i
<m_Databuf
.size();i
++)
628 if(m_Databuf
[i
]==('\n'))
630 if(i
==0 || m_Databuf
[i
-1]!= ('\r'))
632 m_Databuf
.insert(m_Databuf
.begin()+i
,('\r'));
637 m_Databuf
.m_critSec
.Unlock();
640 void CProgressDlg::InsertColorText(CRichEditCtrl
&edit
,CString text
,COLORREF rgb
)
643 edit
.GetDefaultCharFormat(cf
);
645 cf
.dwMask
|=CFM_COLOR
;
647 cf
.dwEffects
|=CFE_BOLD
;
648 cf
.dwEffects
&= ~CFE_AUTOCOLOR
;
649 edit
.SetSel(edit
.GetTextLength()-1,edit
.GetTextLength());
650 edit
.ReplaceSel(text
);
651 edit
.SetSel(edit
.LineIndex(edit
.GetLineCount()-2),edit
.GetTextLength());
652 edit
.SetSelectionCharFormat(cf
);
653 edit
.SetSel(edit
.GetTextLength(),edit
.GetTextLength());
654 edit
.SetDefaultCharFormat(old
);
655 edit
.LineScroll(edit
.GetLineCount() - edit
.GetFirstVisibleLine() - 4);
658 CString
CCommitProgressDlg::Convert2UnionCode(char *buff
, int size
)
665 cmd
=_T("git.exe config i18n.logOutputEncoding");
666 if (g_Git
.Run(cmd
, &output
, NULL
, CP_UTF8
))
670 output
=output
.Tokenize(_T("\n"),start
);
671 cp
=CUnicodeUtils::GetCPCode(output
);
675 size
= (int)strlen(buff
);
677 for(int i
=0;i
<size
;i
++)
681 if( start
>0 && buff
[i
] =='\n' )
689 g_Git
.StringAppend(&str
, (BYTE
*)buff
, cp
, start
);
690 g_Git
.StringAppend(&str
, (BYTE
*)buff
+ start
, CP_UTF8
, size
- start
);
697 LRESULT
CProgressDlg::OnTaskbarBtnCreated(WPARAM
/*wParam*/, LPARAM
/*lParam*/)
699 m_pTaskbarList
.Release();
700 m_pTaskbarList
.CoCreateInstance(CLSID_TaskbarList
);
704 BOOL
CProgressDlg::PreTranslateMessage(MSG
* pMsg
)
706 if (pMsg
->message
== WM_KEYDOWN
)
708 if (pMsg
->wParam
== VK_ESCAPE
)
710 // pressing the ESC key should close the dialog. But since we disabled the escape
711 // key (so the user doesn't get the idea that he could simply undo an e.g. update)
713 // So if the user presses the ESC key, change it to VK_RETURN so the dialog gets
714 // the impression that the OK button was pressed.
715 if ((!GetDlgItem(IDCANCEL
)->IsWindowEnabled())
716 &&(GetDlgItem(IDOK
)->IsWindowEnabled())&&(GetDlgItem(IDOK
)->IsWindowVisible()))
718 // since we convert ESC to RETURN, make sure the OK button has the focus.
719 GetDlgItem(IDOK
)->SetFocus();
720 pMsg
->wParam
= VK_RETURN
;
724 else if (pMsg
->message
== WM_CONTEXTMENU
|| pMsg
->message
== WM_RBUTTONDOWN
)
726 CWnd
* pWnd
= (CWnd
*) GetDlgItem(IDC_LOG
);
727 if (pWnd
== GetFocus())
730 if (popup
.CreatePopupMenu())
732 popup
.AppendMenuIcon(WM_COPY
, IDS_SCIEDIT_COPY
, IDI_COPYCLIP
);
733 if (m_Log
.GetSelText().IsEmpty())
734 popup
.EnableMenuItem(WM_COPY
, MF_BYCOMMAND
| MF_DISABLED
| MF_GRAYED
);
735 popup
.AppendMenu(MF_SEPARATOR
);
736 popup
.AppendMenuIcon(EM_SETSEL
, IDS_SCIEDIT_SELECTALL
);
737 int cmd
= popup
.TrackPopupMenu(TPM_RETURNCMD
| TPM_LEFTALIGN
| TPM_NONOTIFY
, pMsg
->pt
.x
, pMsg
->pt
.y
, this);
740 case 0: // no command selected
744 ::SendMessage(GetDlgItem(IDC_LOG
)->GetSafeHwnd(), cmd
, 0, -1);
751 return __super::PreTranslateMessage(pMsg
);