diff options
author | René Schümann <white06tiger@gmail.com> | 2014-12-25 00:43:39 +0000 |
---|---|---|
committer | René Schümann <white06tiger@gmail.com> | 2014-12-25 00:43:39 +0000 |
commit | bccb121518429a0ef062b346d36551bd2ace5da2 (patch) | |
tree | 344c01a6e6216a427f1596086936d839cdfb219a /plugins/SendScreenshotPlus/src | |
parent | bb0836d9f53344ee8f20a5c4efd3e8d5199fe844 (diff) |
SendSS: fixed (and finalized) basic editor support.
! Miranda no longer hangs while waiting for editor exit. (could have done that without message loop, but lets try it until we get problems :P)
! local files are no longer deleted while previewing file through editor and deciding afterward not to send the image
! fixed non-translatable "Send screenshot?" question
git-svn-id: http://svn.miranda-ng.org/main/trunk@11619 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SendScreenshotPlus/src')
-rw-r--r-- | plugins/SendScreenshotPlus/src/UMainForm.cpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp index 61a14a291b..184890fa96 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.cpp +++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp @@ -1109,6 +1109,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) { //--------------------------------------------------------------------------- void TfrmMain::FormClose() { + bool bCanDelete=m_opt_btnDeleteAfterSend; if(m_opt_tabCapture==2){ /// existing file TCHAR description[1024]; GetDlgItemText(m_hwndTabPage, ID_edtCaption, description, SIZEOF(description)); @@ -1119,6 +1120,7 @@ void TfrmMain::FormClose() { m_cSend->SetFile(m_pszFile); m_cSend->SetDescription(description); } + bCanDelete=false; }else if(SaveScreenshot(m_Screenshot)){ /// Saving the screenshot Show(); // Error from SaveScreenshot return; @@ -1133,17 +1135,38 @@ void TfrmMain::FormClose() { shex.nShow=SW_SHOWNORMAL; ShellExecuteEx(&shex); if(shex.hProcess){ - WaitForSingleObject(shex.hProcess,INFINITE); + DWORD res; + MSG msg; + do{ + // wait for editor exit or messages/input + res=MsgWaitForMultipleObjects(1,&shex.hProcess,0,INFINITE,QS_ALLINPUT); + while(PeekMessage(&msg,NULL,0,0,PM_REMOVE)){ + if(msg.message==WM_QUIT){ + res=WAIT_OBJECT_0; + PostMessage(NULL,WM_QUIT,0,0); // forward for outer message loops + break; + } + // process dialog messages (of unknown dialogs) +// HWND hwndDlgModeless=msg.hwnd; +// for(HWND hTMP; (hTMP=GetAncestor(hwndDlgModeless,GA_PARENT)) && IsChild(hTMP,hwndDlgModeless); hwndDlgModeless=hTMP); +// if(IsDialogMessage(hwndDlgModeless,&msg)) + if(IsDialogMessage(GetActiveWindow(),&msg)) + continue; + // process messages + TranslateMessage(&msg); + DispatchMessage(&msg); + } + }while(res==WAIT_OBJECT_0+1); CloseHandle(shex.hProcess); } - if(MessageBoxA(m_hWnd,"Send screenshot?","SendSS",MB_YESNO|MB_ICONQUESTION|MB_SYSTEMMODAL)!=IDYES) + if(MessageBox(m_hWnd,TranslateT("Send screenshot?"),_T("SendSS"),MB_YESNO|MB_ICONQUESTION|MB_SYSTEMMODAL)!=IDYES) send=false; } if(send && m_cSend && m_pszFile){ if(!m_cSend->Send()) m_cSend=NULL; // not sent now, class deletes itself later cboxSendByChange(); - }else if(!send && m_opt_btnDeleteAfterSend){ + }else if(!send && bCanDelete){ DeleteFile(m_pszFile); } SendMessage(m_hWnd,UM_EVENT, 0, (LPARAM)EVT_CheckOpenAgain); |