|
|
@ -74,10 +74,10 @@ CGeorgesEditApp::CGeorgesEditApp() : MemStream (false, false, 1024*1024)
|
|
|
|
ExeStandalone = false;
|
|
|
|
ExeStandalone = false;
|
|
|
|
StartExpanded = true;
|
|
|
|
StartExpanded = true;
|
|
|
|
|
|
|
|
|
|
|
|
FormClipBoardFormatStruct = RegisterClipboardFormat ("GeorgesFormStruct");
|
|
|
|
FormClipBoardFormatStruct = RegisterClipboardFormat (_T("GeorgesFormStruct"));
|
|
|
|
FormClipBoardFormatVirtualStruct = RegisterClipboardFormat ("GeorgesFormVirtualStruct");
|
|
|
|
FormClipBoardFormatVirtualStruct = RegisterClipboardFormat (_T("GeorgesFormVirtualStruct"));
|
|
|
|
FormClipBoardFormatArray = RegisterClipboardFormat ("GeorgesFormArray");
|
|
|
|
FormClipBoardFormatArray = RegisterClipboardFormat (_T("GeorgesFormArray"));
|
|
|
|
FormClipBoardFormatType = RegisterClipboardFormat ("GeorgesFormType");
|
|
|
|
FormClipBoardFormatType = RegisterClipboardFormat (_T("GeorgesFormType"));
|
|
|
|
nlassert (FormClipBoardFormatStruct);
|
|
|
|
nlassert (FormClipBoardFormatStruct);
|
|
|
|
nlassert (FormClipBoardFormatVirtualStruct);
|
|
|
|
nlassert (FormClipBoardFormatVirtualStruct);
|
|
|
|
nlassert (FormClipBoardFormatArray);
|
|
|
|
nlassert (FormClipBoardFormatArray);
|
|
|
@ -159,7 +159,7 @@ BOOL CGeorgesEditApp::initInstance (int nCmdShow, bool exeStandalone, int x, int
|
|
|
|
if (!isInitialized && exeStandalone)
|
|
|
|
if (!isInitialized && exeStandalone)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_nCmdShow = nCmdShow;
|
|
|
|
m_nCmdShow = nCmdShow;
|
|
|
|
ExePath = GetCommandLine ();
|
|
|
|
ExePath = tStrToUtf8(GetCommandLine ());
|
|
|
|
if (ExePath.size()>0)
|
|
|
|
if (ExePath.size()>0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (ExePath[0] == '\"')
|
|
|
|
if (ExePath[0] == '\"')
|
|
|
@ -673,11 +673,11 @@ bool CGeorgesEditApp::getColor (NLMISC::CRGBA &color)
|
|
|
|
// Get custom colors
|
|
|
|
// Get custom colors
|
|
|
|
COLORREF arrayColor[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
|
|
|
COLORREF arrayColor[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
|
|
|
HKEY hKey;
|
|
|
|
HKEY hKey;
|
|
|
|
if (RegOpenKeyEx(HKEY_CURRENT_USER, GEORGES_EDIT_BASE_REG_KEY"\\Custom Colors", 0, KEY_READ, &hKey)==ERROR_SUCCESS)
|
|
|
|
if (RegOpenKeyEx(HKEY_CURRENT_USER, _T(GEORGES_EDIT_BASE_REG_KEY "\\Custom Colors"), 0, KEY_READ, &hKey)==ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DWORD len=sizeof(arrayColor);
|
|
|
|
DWORD len=sizeof(arrayColor);
|
|
|
|
DWORD type;
|
|
|
|
DWORD type;
|
|
|
|
RegQueryValueEx (hKey, "", 0, &type, (LPBYTE)(arrayColor), &len);
|
|
|
|
RegQueryValueEx (hKey, _T(""), 0, &type, (LPBYTE)(arrayColor), &len);
|
|
|
|
RegCloseKey (hKey);
|
|
|
|
RegCloseKey (hKey);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -698,9 +698,9 @@ bool CGeorgesEditApp::getColor (NLMISC::CRGBA &color)
|
|
|
|
|
|
|
|
|
|
|
|
// Save the custom colors
|
|
|
|
// Save the custom colors
|
|
|
|
HKEY hKey;
|
|
|
|
HKEY hKey;
|
|
|
|
if (RegCreateKey(HKEY_CURRENT_USER, GEORGES_EDIT_BASE_REG_KEY"\\Custom Colors", &hKey)==ERROR_SUCCESS)
|
|
|
|
if (RegCreateKey(HKEY_CURRENT_USER, _T(GEORGES_EDIT_BASE_REG_KEY "\\Custom Colors"), &hKey)==ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
RegSetValueEx (hKey, "", 0, REG_BINARY, (LPBYTE)(arrayColor), sizeof(arrayColor));
|
|
|
|
RegSetValueEx (hKey, _T(""), 0, REG_BINARY, (LPBYTE)(arrayColor), sizeof(arrayColor));
|
|
|
|
RegCloseKey (hKey);
|
|
|
|
RegCloseKey (hKey);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
@ -711,9 +711,9 @@ bool CGeorgesEditApp::getColor (NLMISC::CRGBA &color)
|
|
|
|
bool CGeorgesEditApp::yesNo (const char* message)
|
|
|
|
bool CGeorgesEditApp::yesNo (const char* message)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (m_pMainWnd)
|
|
|
|
if (m_pMainWnd)
|
|
|
|
return m_pMainWnd->MessageBox (message, "Georges Edit", MB_YESNO|MB_ICONQUESTION) != IDNO;
|
|
|
|
return m_pMainWnd->MessageBox (message, _T("Georges Edit"), MB_YESNO|MB_ICONQUESTION) != IDNO;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return MessageBox (NULL, message, "Georges Edit", MB_YESNO|MB_ICONQUESTION) != IDNO;
|
|
|
|
return MessageBox (NULL, message, _T("Georges Edit"), MB_YESNO|MB_ICONQUESTION) != IDNO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CGeorgesEditApp::loadPlugins ()
|
|
|
|
void CGeorgesEditApp::loadPlugins ()
|
|
|
@ -722,7 +722,7 @@ void CGeorgesEditApp::loadPlugins ()
|
|
|
|
for (i=0; i<PluginsNames.size (); i++)
|
|
|
|
for (i=0; i<PluginsNames.size (); i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Load the dll
|
|
|
|
// Load the dll
|
|
|
|
HINSTANCE hModule = AfxLoadLibrary (PluginsNames[i].c_str ());
|
|
|
|
HINSTANCE hModule = AfxLoadLibrary (utf8ToTStr(PluginsNames[i]));
|
|
|
|
if (hModule)
|
|
|
|
if (hModule)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Get the proc adrdess
|
|
|
|
// Get the proc adrdess
|
|
|
@ -971,7 +971,7 @@ void CGeorgesEditApp::OnViewRefresh()
|
|
|
|
void CGeorgesEditApp::saveWindowState (const CWnd *wnd, const char *name, bool controlBar)
|
|
|
|
void CGeorgesEditApp::saveWindowState (const CWnd *wnd, const char *name, bool controlBar)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
HKEY hKey;
|
|
|
|
HKEY hKey;
|
|
|
|
nlverify (RegCreateKey (HKEY_CURRENT_USER, GEORGES_EDIT_BASE_REG_KEY"\\Windows states", &hKey) == ERROR_SUCCESS);
|
|
|
|
nlverify (RegCreateKey (HKEY_CURRENT_USER, _T(GEORGES_EDIT_BASE_REG_KEY "\\Windows states"), &hKey) == ERROR_SUCCESS);
|
|
|
|
|
|
|
|
|
|
|
|
// Get the position
|
|
|
|
// Get the position
|
|
|
|
WINDOWPLACEMENT wndpl;
|
|
|
|
WINDOWPLACEMENT wndpl;
|
|
|
@ -987,7 +987,7 @@ void CGeorgesEditApp::saveWindowState (const CWnd *wnd, const char *name, bool c
|
|
|
|
void CGeorgesEditApp::loadWindowState (CWnd *wnd, const char *name, bool mdiChildWnd, bool controlBar)
|
|
|
|
void CGeorgesEditApp::loadWindowState (CWnd *wnd, const char *name, bool mdiChildWnd, bool controlBar)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
HKEY hKey;
|
|
|
|
HKEY hKey;
|
|
|
|
if (RegOpenKey (HKEY_CURRENT_USER, GEORGES_EDIT_BASE_REG_KEY"\\Windows states", &hKey) == ERROR_SUCCESS)
|
|
|
|
if (RegOpenKey (HKEY_CURRENT_USER, _T(GEORGES_EDIT_BASE_REG_KEY "\\Windows states"), &hKey) == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Get the value
|
|
|
|
// Get the value
|
|
|
|
WINDOWPLACEMENT wndpl;
|
|
|
|
WINDOWPLACEMENT wndpl;
|
|
|
|