diff --git a/ClassicNotepad.c b/ClassicNotepad.c index c5ef881..9b8b783 100644 --- a/ClassicNotepad.c +++ b/ClassicNotepad.c @@ -7,13 +7,12 @@ #include #include #include +#include "resource.h" #ifndef swprintf_s int swprintf_s(wchar_t *buffer, size_t sizeOfBuffer, const wchar_t *format, ...); #endif -#define IDI_APP 101 - #define IDM_FILE_NEW 1001 #define IDM_FILE_OPEN 1002 #define IDM_FILE_SAVE 1003 @@ -36,6 +35,8 @@ int swprintf_s(wchar_t *buffer, size_t sizeOfBuffer, const wchar_t *format, ...) #define IDM_HELP_ABOUT 4001 +static const WCHAR APP_VERSION[] = L"1.1.0"; + static HWND g_hEdit = NULL; static HFONT g_hFont = NULL; static HMENU g_hMenu = NULL; @@ -834,7 +835,9 @@ static void ChooseFontAndApply(HWND hwnd) static void ShowAbout(HWND hwnd) { - MessageBoxW(hwnd, L"ClassicNotepad\nBuilt with Win32 API in C.\ngithub.com/acidburnmonkey/ClassicNotepad", L"About", MB_OK | MB_ICONINFORMATION); + WCHAR message[256]; + swprintf_s(message, ARRAYSIZE(message), L"ClassicNotepad v%s\nBuilt with Win32 API in C.\ngithub.com/acidburnmonkey/ClassicNotepad", APP_VERSION); + MessageBoxW(hwnd, message, L"About", MB_OK | MB_ICONINFORMATION); } static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) diff --git a/ClassicNotepad.rc b/ClassicNotepad.rc index d725649..4d2c89b 100644 --- a/ClassicNotepad.rc +++ b/ClassicNotepad.rc @@ -1,3 +1,4 @@ #include +#include "resource.h" IDI_APP ICON "app.ico" diff --git a/resource.h b/resource.h new file mode 100644 index 0000000..4137a80 --- /dev/null +++ b/resource.h @@ -0,0 +1,6 @@ +#ifndef CLASSICNOTEPAD_RESOURCE_H +#define CLASSICNOTEPAD_RESOURCE_H + +#define IDI_APP 101 + +#endif