[REVERT] Revert to 413.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@419 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2009-02-07 00:52:12 +00:00
parent e6fd7c8357
commit 9678cec404
11 changed files with 103 additions and 101 deletions

View File

@ -19,7 +19,7 @@
#include <memory>
#include <algorithm>
#include "Common.h"
#include "Notepad_plus.h"
WcharMbcsConvertor * WcharMbcsConvertor::_pSelf = new WcharMbcsConvertor;
@ -37,22 +37,17 @@ void systemMessage(const TCHAR *title)
::LocalFree(lpMsgBuf);
}
void printInt(int int2print)
void printInt(int int2print)
{
TCHAR str[32];
wsprintf(str, TEXT("%d"), int2print);
::MessageBox(Notepad_plus::gNppHWND, str, TEXT(""), MB_OK);
}
::MessageBox(NULL, str, TEXT(""), MB_OK);
};
void printStr(const TCHAR *str2print)
void printStr(const TCHAR *str2print)
{
::MessageBox(Notepad_plus::gNppHWND, str2print, TEXT(""), MB_OK);
}
void printMsg(const TCHAR *msg2print, const TCHAR *title, DWORD flags)
{
::MessageBox(Notepad_plus::gNppHWND, msg2print, title, flags);
}
::MessageBox(NULL, str2print, TEXT(""), MB_OK);
};
void writeLog(const TCHAR *logFileName, const char *log2write)
{

View File

@ -88,7 +88,7 @@ void systemMessage(const TCHAR *title);
//DWORD ShortToLongPathName(LPCTSTR lpszShortPath, LPTSTR lpszLongPath, DWORD cchBuffer);
void printInt(int int2print);
void printStr(const TCHAR *str2print);
void printMsg(const TCHAR *msg2print, const TCHAR *title, DWORD flags = MB_OK);
void writeLog(const TCHAR *logFileName, const char *log2write);
int filter(unsigned int code, struct _EXCEPTION_POINTERS *ep);
int getCpFromStringValue(const char * encodingStr);

View File

@ -1,5 +1,5 @@
#include "MiniDumper.h"
#include "Common.h"
//#include "Common.h"
#include <shlwapi.h>
LPCTSTR msgTitle = TEXT("Notepad++ crash analysis");
@ -76,7 +76,7 @@ bool MiniDumper::writeDump(EXCEPTION_POINTERS * pExceptionInfo)
}
if (szResult)
printMsg(szResult, msgTitle);
::MessageBox(NULL, szResult, msgTitle, MB_OK);
return retval;
}

View File

@ -675,7 +675,7 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isReadOnly)
bool res = MainFileManager->createEmptyFile(longFileName);
if (!res) {
wsprintf(str2display, TEXT("Cannot create the file \"%s\""), longFileName);
printMsg(str2display, TEXT("Create new file"));
::MessageBox(_hSelf, str2display, TEXT("Create new file"), MB_OK);
return BUFFER_INVALID;
}
}
@ -734,7 +734,7 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isReadOnly)
//lstrcat(msg, fullPath);
lstrcat(msg, longFileName);
lstrcat(msg, TEXT("\"."));
printMsg(msg, TEXT("Open File"));
::MessageBox(_hSelf, msg, TEXT("ERR"), MB_OK);
return BUFFER_INVALID;
}
}
@ -805,7 +805,7 @@ bool Notepad_plus::doSave(BufferID id, const TCHAR * filename, bool isCopy)
}
if (!res)
printMsg(TEXT("Please check whether if this file is opened in another program"), TEXT("Save failed"));
::MessageBox(_hSelf, TEXT("Please check whether if this file is opened in another program"), TEXT("Save failed"), MB_OK);
return res;
}
@ -1139,7 +1139,7 @@ bool Notepad_plus::fileSaveAs(BufferID id, bool isSaveCopy)
}
else //cannot save, other view has buffer already open, activate it
{
printMsg(TEXT("The file is already opened in Notepad++."), TEXT("Save File As"), MB_OK | MB_ICONSTOP);
::MessageBox(_hSelf, TEXT("The file is already opened in the Notepad++."), TEXT("ERROR"), MB_OK | MB_ICONSTOP);
switchToFile(other);
return false;
}
@ -1208,7 +1208,7 @@ bool Notepad_plus::fileDelete(BufferID id, int curView)
{
if (!MainFileManager->deleteFile(bufferID))
{
printMsg(TEXT("Delete File failed"), TEXT("Delete File"));
::MessageBox(_hSelf, TEXT("Delete File failed"), TEXT("Delete File"), MB_OK);
return false;
}
doClose(bufferID, MAIN_VIEW);
@ -1374,7 +1374,7 @@ bool Notepad_plus::fileCloseAllButCurrent()
return true;
}
bool Notepad_plus::replaceInOpenFiles() {
bool Notepad_plus::replaceAllFiles() {
ScintillaEditView *pOldView = _pEditView;
_pEditView = &_invisibleEditView;
@ -1428,7 +1428,8 @@ bool Notepad_plus::replaceInOpenFiles() {
else
wsprintf(result, TEXT("%d occurrences replaced."), nbTotal);
printMsg(result, TEXT("Replace in all opened documents"));
::printStr(result);
return true;
}
@ -1639,10 +1640,10 @@ bool Notepad_plus::replaceInFiles()
_invisibleEditView.execute(SCI_SETDOCPOINTER, 0, oldDoc);
_invisibleEditView._currentBuffer = oldBuf;
_pEditView = pOldView;
TCHAR msg[128];
wsprintf(msg, TEXT("%d occurrences replaced."), nbTotal);
printMsg(msg, TEXT("Replace in files"));
wsprintf(msg, TEXT("%d occurences replaced"), nbTotal);
printStr(msg);
return true;
}
@ -7076,7 +7077,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
case WM_REPLACEALL_INOPENEDDOC :
{
replaceInOpenFiles();
replaceAllFiles();
return TRUE;
}
@ -7487,7 +7488,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
{
if (lstrlen(str) >= int(wParam))
{
printMsg(TEXT("Allocated buffer size is not large enough to copy the string."), TEXT("NPPM_GETNPPDIRECTORY error"));
::MessageBox(_hSelf, TEXT("Allocated buffer size is not enough to copy the string."), TEXT("NPPM_GETNPPDIRECTORY error"), MB_OK);
return FALSE;
}
}

View File

@ -722,7 +722,7 @@ private:
void showFunctionComp();
void changeStyleCtrlsLang(HWND hDlg, int *idArray, const char **translatedText);
bool replaceInOpenFiles();
bool replaceAllFiles();
bool findInOpenedFiles();
bool matchInList(const TCHAR *fileName, const vector<generic_string> & patterns);

View File

@ -465,16 +465,16 @@ EXSTYLE WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE
CAPTION "Go To..."
FONT 8, TEXT("MS Shell Dlg"), 0, 0, 0x0
BEGIN
CONTROL "&Line",IDC_RADIO_GOTOLINE,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,5,9,80,10
CONTROL "&Offset",IDC_RADIO_GOTOOFFSET,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,98,9,80,10
CONTROL "Line",IDC_RADIO_GOTOLINE,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,5,9,80,10
CONTROL "Offset",IDC_RADIO_GOTOOFFSET,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,102,9,80,10
LTEXT "You are here :",ID_URHERE_STATIC,5,34,95,8,NOT WS_GROUP
LTEXT "0123456789",ID_CURRLINE,100,34,45,8,NOT WS_GROUP
LTEXT "You want to &go :",ID_UGO_STATIC,5,51,95,8
EDITTEXT ID_GOLINE_EDIT,98,49,71,12,ES_NUMBER
LTEXT "You can't go further than :",ID_NOMORETHAN_STATIC,5,68,92,8,NOT WS_GROUP
LTEXT "0123456789",ID_LASTLINE,100,68,45,8,NOT WS_GROUP
DEFPUSHBUTTON "Go !",IDOK,181,48,70,14,BS_NOTIFY
PUSHBUTTON "I'm going nowhere",IDCANCEL,181,66,70,14,BS_NOTIFY
LTEXT "You want to go :",ID_UGO_STATIC,5,50,95,8
EDITTEXT ID_GOLINE_EDIT,100,49,71,12,ES_NUMBER
LTEXT "You can't go further than :",ID_NOMORETHAN_STATIC,5,73,92,8,NOT WS_GROUP
LTEXT "0123456789",ID_LASTLINE,99,73,45,8,NOT WS_GROUP
DEFPUSHBUTTON "&Go !",IDOK,181,47,70,14,BS_NOTIFY
PUSHBUTTON "I'm going nowhere",IDCANCEL,181,69,70,14,BS_NOTIFY
END
IDD_VALUE_DLG DIALOGEX 0, 0, 74, 17

View File

@ -385,37 +385,42 @@ SearchResultMarking Finder::EmptySearchResultMarking;
bool Finder::notify(SCNotification *notification)
{
switch (notification->nmhdr.code)
static bool isDoubleClicked = false;
switch (notification->nmhdr.code)
{
case SCN_MARGINCLICK:
if (notification->margin == ScintillaEditView::_SC_MARGE_FOLDER)
{
_scintView.marginClick(notification->position, notification->modifiers);
}
break;
case SCN_DOUBLECLICK:
case SCN_MARGINCLICK:
if (notification->margin == ScintillaEditView::_SC_MARGE_FOLDER)
{
_scintView.marginClick(notification->position, notification->modifiers);
}
break;
case SCN_DOUBLECLICK:
{
// remove selection from the finder
isDoubleClicked = true;
int pos = notification->position;
if (pos == INVALID_POSITION)
pos = _scintView.execute(SCI_GETLINEENDPOSITION, notification->line);
_scintView.execute(SCI_SETSEL, pos, pos);
GotoFoundLine();
_isDoubleClicked = true;
break;
}
case SCN_PAINTED:
if (_isDoubleClicked)
{
_isDoubleClicked = false;
(*_ppEditView)->getFocus();
}
break;
case SCN_PAINTED :
if (isDoubleClicked)
{
(*_ppEditView)->getFocus();
isDoubleClicked = false;
}
break;
}
return false;
}
void Finder::GotoFoundLine()
{
int currentPos = _scintView.execute(SCI_GETCURRENTPOS);
@ -758,7 +763,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
lstrcpy(result, TEXT("The regular expression to search is formed badly"));
else
wsprintf(result, TEXT("%d occurrences were replaced."), nbReplaced);
::MessageBox(_hSelf, result, TEXT("Replace All"), MB_OK);
::MessageBox(_hSelf, result, TEXT(""), MB_OK);
}
}
return TRUE;
@ -773,8 +778,8 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
lstrcpy(result, TEXT("The regular expression to search is formed badly.\r\nIs it resulting in nothing?"));
else
wsprintf(result, TEXT("%d match(es) to occurrence(s)"), nbCounted);
::MessageBox(_hSelf, result, TEXT("Count"), MB_OK);
}
::MessageBox(_hSelf, result, TEXT(""), MB_OK);
}
}
return TRUE;
@ -790,7 +795,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
lstrcpy(result, TEXT("The regular expression to search is formed badly.\r\nIs it resulting in nothing?"));
else
wsprintf(result, TEXT("%d match(es) to occurrence(s)"), nbMarked);
::MessageBox(_hSelf, result, TEXT("Mark"), MB_OK);
::MessageBox(_hSelf, result, TEXT(""), MB_OK);
}
}
return TRUE;

View File

@ -86,8 +86,7 @@ private:
class Finder : public DockingDlgInterface {
friend class FindReplaceDlg;
public:
Finder() : DockingDlgInterface(IDD_FINDRESULT), _pMainFoundInfos(&_foundInfos1), _pMainMarkings(&_markings1), _isDoubleClicked(false)
{
Finder() : DockingDlgInterface(IDD_FINDRESULT), _pMainFoundInfos(&_foundInfos1), _pMainMarkings(&_markings1) {
_MarkingsStruct._length = 0;
_MarkingsStruct._markings = NULL;
};
@ -239,7 +238,6 @@ private:
int _lastFileHeaderPos;
int _lastSearchHeaderPos;
bool _isDoubleClicked;
void setFinderReadOnly(bool isReadOnly) {
_scintView.execute(SCI_SETREADONLY, isReadOnly);

View File

@ -22,55 +22,58 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include <windows.h>
#include "FindReplaceDlg_rc.h"
IDD_FIND_REPLACE_DLG DIALOGEX 36, 44, 317, 182
IDD_FIND_REPLACE_DLG DIALOGEX 36, 44, 321, 182
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_TOOLWINDOW
CAPTION "Replace"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
RTEXT "&Find what :",IDFINDWHAT_STATIC,6,22,75,8
RTEXT "Find what :",IDFINDWHAT_STATIC,6,22,75,8
COMBOBOX IDFINDWHAT,83,20,125,150,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP
RTEXT "Rep&lace with :",ID_STATICTEXT_REPLACE,6,40,75,8
COMBOBOX IDREPLACEWITH,83,38,125,50,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP
CONTROL "&Mark Line",IDC_MARKLINE_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,40,88,10
CONTROL "Style found to&ken",IDC_STYLEFOUND_CHECK,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,13,52,100,15
GROUPBOX "",IDC_FINDALL_STATIC,6,31,204,54
CONTROL "Purge for each search",IDC_PURGE_CHECK,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,13,66,99,16
PUSHBUTTON "Find &All",IDCMARKALL,146,38,59,14
RTEXT "Replace with :",ID_STATICTEXT_REPLACE,6,40,75,8
COMBOBOX IDREPLACEWITH,83,39,125,50,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP
CONTROL "Mark Line",IDC_MARKLINE_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,38,88,10
CONTROL "Style found token",IDC_STYLEFOUND_CHECK,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,13,50,100,15
GROUPBOX "",IDC_FINDALL_STATIC,7,31,204,54
CONTROL "Purge for each search",IDC_PURGE_CHECK,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,13,64,99,16
PUSHBUTTON "Find All",IDCMARKALL,131,40,75,14
GROUPBOX "",IDC_REPLACEINSELECTION,141,50,170,23
CONTROL "In select&ion",IDC_IN_SELECTION_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,146,58,59,10
PUSHBUTTON "Clear",IDC_CLEAR_ALL,146,71,59,11
RTEXT "Filter&s :",IDD_FINDINFILES_FILTERS_STATIC,27,58,53,8
COMBOBOX IDD_FINDINFILES_FILTERS_COMBO,83,56,125,150,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP
RTEXT "Dir&ectory :",IDD_FINDINFILES_DIR_STATIC,7,76,40,8
COMBOBOX IDD_FINDINFILES_DIR_COMBO,49,74,141,150,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "...",IDD_FINDINFILES_BROWSE_BUTTON,193,74,15,13
CONTROL "In all su&b-folders",IDD_FINDINFILES_RECURSIVE_CHECK, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,218,73,80,15
CONTROL "In &hidden folders",IDD_FINDINFILES_INHIDDENDIR_CHECK, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,218,87,80,15
CONTROL "In selection",IDC_IN_SELECTION_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,146,59,59,10
PUSHBUTTON "Clear",IDC_CLEAR_ALL,156,71,50,11
RTEXT "Filters :",IDD_FINDINFILES_FILTERS_STATIC,27,59,53,8
COMBOBOX IDD_FINDINFILES_FILTERS_COMBO,83,57,125,150,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP
RTEXT "Directory :",IDD_FINDINFILES_DIR_STATIC,7,77,40,8
COMBOBOX IDD_FINDINFILES_DIR_COMBO,49,75,141,150,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "...",IDD_FINDINFILES_BROWSE_BUTTON,193,74,16,14
CONTROL "In all sub-folders",IDD_FINDINFILES_RECURSIVE_CHECK,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,218,73,80,15
CONTROL "In hidden folders",IDD_FINDINFILES_INHIDDENDIR_CHECK,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,218,87,80,15
CONTROL "Match &whole word only",IDWHOLEWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,88,104,15
CONTROL "Match &case",IDMATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,100,82,15
CONTROL "Wra&p around",IDWRAP,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,6,112,110,15
GROUPBOX "Search mode",IDC_MODE_STATIC,6,126,138,48
CONTROL "&Normal",IDNORMAL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,12,138,126,10
CONTROL "E&xtended (\\n, \\r, \\t, \\0, \\x...)",IDEXTENDED, "Button",BS_AUTORADIOBUTTON,12,150,126,10
CONTROL "Re&gular expression",IDREGEXP,"Button",BS_AUTORADIOBUTTON,12,162,126,10
CONTROL "&Up",IDDIRECTIONUP,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,155,138,45,12
CONTROL "&Down",IDDIRECTIONDOWN,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,155,150,45,12
GROUPBOX "Direction",IDC_DIR_STATIC,150,126,60,48,WS_GROUP
CONTROL "&Extended (\\n, \\r, \\t, \\0, \\x...)",IDEXTENDED,
"Button",BS_AUTORADIOBUTTON,12,150,126,10
CONTROL "Regular e&xpression",IDREGEXP,"Button",BS_AUTORADIOBUTTON,12,162,126,10
CONTROL "&Up",IDDIRECTIONUP,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,155,94,45,12
CONTROL "&Down",IDDIRECTIONDOWN,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,155,106,45,12
GROUPBOX "Direction",IDC_DIR_STATIC,150,86,60,34,WS_GROUP
PUSHBUTTON "Find Next",IDOK,217,20,90,14,WS_GROUP
PUSHBUTTON "Coun&t",IDCCOUNTALL,217,38,90,14
PUSHBUTTON "Find all in all &opened documents",IDC_FINDALL_OPENEDFILES,217,56,90,21,BS_MULTILINE
PUSHBUTTON "Count",IDCCOUNTALL,217,38,90,14
PUSHBUTTON "Replace in files",IDD_FINDINFILES_REPLACEINFILES,217,38,90,14
PUSHBUTTON "Find all in all opened documents",IDC_FINDALL_OPENEDFILES,217,56,90,21,BS_MULTILINE
PUSHBUTTON "&Replace",IDREPLACE,217,38,90,14
PUSHBUTTON "Replace &All",IDREPLACEALL,217,56,90,14
PUSHBUTTON "Replace all in all &opened documents",IDC_REPLACE_OPENEDFILES,217,74,90,21,BS_MULTILINE
PUSHBUTTON "Find All",IDD_FINDINFILES_FIND_BUTTON,217,20,90,14,WS_GROUP
PUSHBUTTON "&Replace in files",IDD_FINDINFILES_REPLACEINFILES,217,38,90,14
PUSHBUTTON "Close",IDCANCEL,217,98,90,14
GROUPBOX "",IDC_TRANSPARENT_GRPBOX,222,126,85,48
CONTROL "Transparenc&y",IDC_TRANSPARENT_CHECK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,218,126,57,10
CONTROL "On lose focus",IDC_TRANSPARENT_LOSSFOCUS_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,232,138,65,10
CONTROL "Always",IDC_TRANSPARENT_ALWAYS_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,232,150,63,10
CONTROL "",IDC_PERCENTAGE_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | NOT WS_VISIBLE | WS_TABSTOP,235,161,53,10
PUSHBUTTON "Replace all in all opened documents",IDC_REPLACE_OPENEDFILES,217,74,90,21,BS_MULTILINE
PUSHBUTTON "Find them all",IDD_FINDINFILES_FIND_BUTTON,217,20,90,14,WS_GROUP
PUSHBUTTON "Close",IDCANCEL,217,99,90,14
GROUPBOX "Transparency",IDC_TRANSPARENT_GRPBOX,227,123,83,49
CONTROL "",IDC_TRANSPARENT_CHECK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,223,123,9,10
CONTROL "On lose focus",IDC_TRANSPARENT_LOSSFOCUS_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,237,135,69,10
CONTROL "Always",IDC_TRANSPARENT_ALWAYS_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,237,147,63,10
CONTROL "",IDC_PERCENTAGE_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | NOT WS_VISIBLE | WS_TABSTOP,240,161,53,10
END
IDD_INCREMENT_FIND DIALOGEX 0, 0, 400, 20

View File

@ -233,7 +233,7 @@ const TCHAR* TiXmlBase::GetEntity( const TCHAR* p, TCHAR* value )
{
int val;
if (generic_sscanf(p+3, TEXT("%x"), &val) == 1)
{
{
*value = val;
return end + 1;
}

View File

@ -308,7 +308,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR cmdLineAnsi, int nCmdSh
TCHAR str[50] = TEXT("God Damned Exception : ");
TCHAR code[10];
wsprintf(code, TEXT("%d"), i);
printMsg(lstrcat(str, code), TEXT("Notepad++ Exception"));
::MessageBox(Notepad_plus::gNppHWND, lstrcat(str, code), TEXT("Notepad++ Exception"), MB_OK);
doException(notepad_plus_plus);
}
} catch (const Win32Exception & ex) {
@ -320,13 +320,13 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR cmdLineAnsi, int nCmdSh
TEXT("Code:\t0x%08X\r\nType:\t%s\r\nException address: 0x%08X"),
#endif
ex.code(), ex.what(), ex.where());
printMsg(message, TEXT("Win32Exception"), MB_OK | MB_ICONERROR);
::MessageBox(Notepad_plus::gNppHWND, message, TEXT("Win32Exception"), MB_OK | MB_ICONERROR);
mdump.writeDump(ex.info());
doException(notepad_plus_plus);
} catch(std::exception ex) {
#ifdef UNICODE
const wchar_t * text = WcharMbcsConvertor::getInstance()->char2wchar(ex.what(), CP_ACP);
printMsg(text, TEXT("C++ Exception"));
::MessageBox(Notepad_plus::gNppHWND, text, TEXT("C++ Exception"), MB_OK);
#else
printMsg(ex.what(), TEXT("C++ Exception"));
#endif
@ -340,7 +340,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR cmdLineAnsi, int nCmdSh
void doException(Notepad_plus & notepad_plus_plus) {
Win32Exception::removeHandler(); //disable exception handler after excpetion, we dont want corrupt data structurs to crash the exception handler
printMsg(TEXT("Notepad++ will attempt to save any unsaved data. However, dataloss is very likely."), TEXT("Recovery initiating"), MB_OK | MB_ICONINFORMATION);
::MessageBox(Notepad_plus::gNppHWND, TEXT("Notepad++ will attempt to save any unsaved data. However, dataloss is very likely."), TEXT("Recovery initiating"), MB_OK | MB_ICONINFORMATION);
TCHAR tmpDir[1024];
GetTempPath(1024, tmpDir);
@ -351,8 +351,8 @@ void doException(Notepad_plus & notepad_plus_plus) {
if (res) {
generic_string displayText = TEXT("Notepad++ was able to successfully recover some unsaved documents, or nothing to be saved could be found.\r\nYou can find the results at :\r\n");
displayText += emergencySavedDir;
printMsg(displayText.c_str(), TEXT("Recovery success"), MB_OK | MB_ICONINFORMATION);
::MessageBox(Notepad_plus::gNppHWND, displayText.c_str(), TEXT("Recovery success"), MB_OK | MB_ICONINFORMATION);
} else {
printMsg(TEXT("Unfortunatly, Notepad++ was not able to save your work. We are sorry for any lost data."), TEXT("Recovery failure"), MB_OK | MB_ICONERROR);
::MessageBox(Notepad_plus::gNppHWND, TEXT("Unfortunatly, Notepad++ was not able to save your work. We are sorry for any lost data."), TEXT("Recovery failure"), MB_OK | MB_ICONERROR);
}
}