bugfix + improvement titanscriptgui

This commit is contained in:
NtQuery 2014-03-14 13:11:19 +01:00
parent 55004da4e3
commit 0e95295416
1 changed files with 23 additions and 6 deletions

View File

@ -6,6 +6,12 @@
#define MAX_LOG_LINE_LENGTH 100 #define MAX_LOG_LINE_LENGTH 100
#define MAX_LOG_LINE_COUNT 100 #define MAX_LOG_LINE_COUNT 100
#ifdef _WIN64
const WCHAR WindowTitle[] = L"TitanScriptGUI x64";
#else
const WCHAR WindowTitle[] = L"TitanScriptGUI x86";
#endif
//variables //variables
static HINSTANCE hInst; static HINSTANCE hInst;
static HWND hLogBox; static HWND hLogBox;
@ -48,6 +54,8 @@ INT_PTR CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
{ {
SetWindowTextW(hWnd, WindowTitle);
//set icon //set icon
HICON hIconLarge = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON1), IMAGE_ICON, 32, 32, LR_DEFAULTSIZE); HICON hIconLarge = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON1), IMAGE_ICON, 32, 32, LR_DEFAULTSIZE);
SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)hIconLarge); SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)hIconLarge);
@ -249,6 +257,10 @@ static void AddLogMessageW(const wchar_t* szLogMessage, eLogType Type)
static void AddLogMessage(const char* szLogMessage, eLogType Type) static void AddLogMessage(const char* szLogMessage, eLogType Type)
{ {
if (strlen(szLogMessage) > 0)
{
if (isalnum(szLogMessage[0]))
{
TCHAR * buf = (TCHAR *)calloc(strlen(szLogMessage) + 1, sizeof(TCHAR)); TCHAR * buf = (TCHAR *)calloc(strlen(szLogMessage) + 1, sizeof(TCHAR));
if (buf) if (buf)
{ {
@ -256,7 +268,12 @@ static void AddLogMessage(const char* szLogMessage, eLogType Type)
AddLogMessageW(buf, Type); AddLogMessageW(buf, Type);
free(buf); free(buf);
} }
}
else
{
AddLogMessageW(L"ERROR INVALID LOG MESSAGE", Type);
}
}
} }
static void SettingSet(const TCHAR* name, const TCHAR* value) static void SettingSet(const TCHAR* name, const TCHAR* value)