diff --git a/Changelog.txt b/Changelog.txt index 50247b4..fab67be 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -145,4 +145,9 @@ and for preparation of the GUI. 1.0.6 (Nicely spoken release) - Added Dutch translation - Added user language to updater request -- Upgrade installer creator from WiX 4.0.0-rc.1 to 4.0.5 \ No newline at end of file +- Upgrade installer creator from WiX 4.0.0-rc.1 to 4.0.5 + +1.0.7 (A warm welcome release) +- Added new welcome screen +- Removed notification area balloons on first start +- Prevent setting transparency on Spooky View itself \ No newline at end of file diff --git a/SpookyView/AppMain.cpp b/SpookyView/AppMain.cpp index 099d99a..7284e98 100644 --- a/SpookyView/AppMain.cpp +++ b/SpookyView/AppMain.cpp @@ -56,7 +56,6 @@ int AppMain::Run() return FALSE; } GetIsWindows8(); - GetIsWindows10orNewer(); windowsEnum.CreateHook(); settingsManager = std::make_unique(); if (!settingsManager->Init()) @@ -164,37 +163,3 @@ void AppMain::GetIsWindows8() OutputDebugString(isWindows8 ? _T("Running on Windows 8 or 8.1\r\n") : _T("Not running on Windows 8 or 8.1\r\n")); #endif } - -void AppMain::GetIsWindows10orNewer() -{ - OSVERSIONINFOEX osvi; - DWORDLONG dwlConditionMask = 0; - - // Initialize the OSVERSIONINFOEX structure. - - ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - osvi.dwMajorVersion = 10; - osvi.dwMinorVersion = 0; - osvi.wServicePackMajor = 0; - osvi.wServicePackMinor = 0; - - // Initialize the condition mask. - - VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL); - VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, VER_GREATER_EQUAL); - VER_SET_CONDITION(dwlConditionMask, VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL); - VER_SET_CONDITION(dwlConditionMask, VER_SERVICEPACKMINOR, VER_GREATER_EQUAL); - - // Perform the test. - - isWindows10orNewer = VerifyVersionInfo( - &osvi, - VER_MAJORVERSION | VER_MINORVERSION | - VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, - dwlConditionMask - ); -#ifdef _DEBUG - OutputDebugString(isWindows10orNewer ? _T("Running on Windows 10 or newer\r\n") : _T("Not running on Windows 10 or newer\r\n")); -#endif -} diff --git a/SpookyView/AppMain.h b/SpookyView/AppMain.h index 151ec1c..ac44418 100644 --- a/SpookyView/AppMain.h +++ b/SpookyView/AppMain.h @@ -9,7 +9,6 @@ class AppMain void LoadFunctionAdresses(); void SendAlreadyRunningNotify(); void GetIsWindows8(); - void GetIsWindows10orNewer(); }; #endif \ No newline at end of file diff --git a/SpookyView/CDialog.cpp b/SpookyView/CDialog.cpp index e562fc0..c3a8f2a 100644 --- a/SpookyView/CDialog.cpp +++ b/SpookyView/CDialog.cpp @@ -5,10 +5,23 @@ CDialog::CDialog(HINSTANCE hInstance) : CWnd(hInstance) { } +BOOL CDialog::hasInitInstance() +{ + return hasInit; +} + BOOL CDialog::InitInstance() { - SetupDialog(); - return Create(); + if (!hasInit) + { + SetupDialog(); + auto created = Create(); + if (created) + { + hasInit = TRUE; + } + } + return hasInit; } void CDialog::SetForeground() diff --git a/SpookyView/CDialog.h b/SpookyView/CDialog.h index 90c2418..77a8cfe 100644 --- a/SpookyView/CDialog.h +++ b/SpookyView/CDialog.h @@ -8,10 +8,12 @@ class CDialog : protected CWnd { public: CDialog(HINSTANCE hInstance); + BOOL hasInitInstance(); BOOL InitInstance(); void SetForeground(); protected: LPCTSTR dialogResource; + BOOL hasInit; virtual BOOL SetupDialog() = 0; virtual BOOL Create() = 0; }; diff --git a/SpookyView/CIntroDialog.cpp b/SpookyView/CIntroDialog.cpp new file mode 100644 index 0000000..18d280d --- /dev/null +++ b/SpookyView/CIntroDialog.cpp @@ -0,0 +1,97 @@ +#include "stdafx.h" +#include "CIntroDialog.h" +#include +#include "ISettingsManager.h" +#include "SpookyView.h" + +CIntroDialog::CIntroDialog(HINSTANCE hInstance, HWND hParent) : CModelessDialog(hInstance, hParent) +{ +}; + +BOOL CIntroDialog::SetupDialog() +{ + key = IDD_INTRO; + this->dialogResource = MAKEINTRESOURCE(IDD_INTRO); + return TRUE; +} + +INT_PTR CALLBACK CIntroDialog::DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + SetupWindow(hDlg); + return TRUE; + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDCANCEL: + case IDCLOSE: + ApplyChoice(); + DestroyWindow(hDlg); + return TRUE; + case IDC_BUTTON_INTRO_SETTINGS: + if (!cSettingsDialog) + { + cSettingsDialog = std::make_unique(this->hInstance, mainHwnd); + } + if (!cSettingsDialog->hasInitInstance()) + { + cSettingsDialog->InitInstance(); + } + else + { + cSettingsDialog->SetForeground(); + } + break; + case IDC_BUTTON_SETUP_APPS: + if (!cSetupDialog) + { + cSetupDialog = std::make_unique(this->hInstance, mainHwnd); + } + if (!cSetupDialog->hasInitInstance()) + { + cSetupDialog->InitInstance(); + } + else + { + cSetupDialog->SetForeground(); + } + break; + } + break; + } + return FALSE; +} + +void CIntroDialog::SetupWindow(HWND hDlg) +{ + //Set font of header + ZeroMemory(&introFont, sizeof(LOGFONT)); + introFont.lfHeight = 20; + introFont.lfWeight = FW_BOLD; + HFONT hFont = CreateFontIndirect(&introFont); + if ((HFONT)0 != hFont) + { + HWND introStaticText = GetDlgItem(hDlg, ID_STATIC_INTRO_TITLE); + SetWindowFont(introStaticText, hFont, TRUE); + } + //Set state of checkbox + HWND skipIntroCheckbox = GetDlgItem(hDlg, IDC_SKIP_INTRO_CHECKBOX); + BOOL skipValue = settingsManager->GetSkipWelcome(); + if (skipValue == 1) + { + Button_SetCheck(skipIntroCheckbox, TRUE); + } +} + +void CIntroDialog::ApplyChoice() +{ + HWND skipIntroCheckbox = GetDlgItem(hWnd, IDC_SKIP_INTRO_CHECKBOX); + settingsManager->SetSkipWelcome(Button_GetCheck(skipIntroCheckbox)); +} + +void CIntroDialog::setSkipWelcomeCheckbox(BOOL state) +{ + HWND skipIntroCheckbox = GetDlgItem(hWnd, IDC_SKIP_INTRO_CHECKBOX); + Button_SetCheck(skipIntroCheckbox, state); +} diff --git a/SpookyView/CIntroDialog.h b/SpookyView/CIntroDialog.h new file mode 100644 index 0000000..1f33ab0 --- /dev/null +++ b/SpookyView/CIntroDialog.h @@ -0,0 +1,19 @@ +#ifndef CINTRODIALOG_H +#define CINTRODIALOG_H + +#include "CModelessDialog.h" + +class CIntroDialog :public CModelessDialog +{ +public: + CIntroDialog(HINSTANCE hInstance, HWND hParent); + INT_PTR CALLBACK DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); + void setSkipWelcomeCheckbox(BOOL state); +protected: + BOOL SetupDialog(); + LOGFONT introFont; + void SetupWindow(HWND hDlg); + void ApplyChoice(); +}; + +#endif \ No newline at end of file diff --git a/SpookyView/CMainWindow.cpp b/SpookyView/CMainWindow.cpp index 26f8a91..2033f54 100644 --- a/SpookyView/CMainWindow.cpp +++ b/SpookyView/CMainWindow.cpp @@ -4,6 +4,7 @@ #include "Resource.h" #include "CLimitSingleInstance.h" #include "CSettingsDialog.h" +#include "CIntroDialog.h" #include "Defines.h" #include "UpdateResponse.h" #include "ISettingsManager.h" @@ -11,7 +12,6 @@ #ifdef UNICODE #include "UnicodeConversion.h" #endif //UNICODE -#include "SpookyView.h" const int SINGLE_CLICK_TIMER = 1; @@ -25,6 +25,10 @@ BOOL CMainWindow::InitInstance() { //Try to create window BOOL canInit = CWindow::InitInstance(0); + if (canInit) + { + mainHwnd = this->hWnd; + } return canInit; } @@ -73,6 +77,9 @@ LRESULT CALLBACK CMainWindow::WndProc(HWND hWnd, UINT message, WPARAM wParam, LP case IDD_ABOUTBOX: cAboutDialog.reset(); break; + case IDD_INTRO: + cIntroDialog.reset(); + break; } return FALSE; #ifdef UNICODE @@ -156,7 +163,10 @@ LRESULT CALLBACK CMainWindow::WndProc(HWND hWnd, UINT message, WPARAM wParam, LP case IDM_SETTINGS: if (!cSettingsDialog) { - cSettingsDialog = std::make_unique(this->hInstance, this->hWnd); + cSettingsDialog = std::make_unique(this->hInstance, mainHwnd); + } + if (!cSettingsDialog->hasInitInstance()) + { cSettingsDialog->InitInstance(); } else @@ -183,6 +193,21 @@ LRESULT CALLBACK CMainWindow::WndProc(HWND hWnd, UINT message, WPARAM wParam, LP } return FALSE; + case IDM_INTRO: + if (!cIntroDialog) + { + cIntroDialog = std::make_unique(this->hInstance, mainHwnd); + } + if (!cIntroDialog->hasInitInstance()) + { + cIntroDialog->InitInstance(); + } + else + { + cIntroDialog->SetForeground(); + } + return false; + case IDM_EXIT: DestroyWindow(this->hWnd); return FALSE; @@ -226,47 +251,24 @@ void CMainWindow::OpenSetupDialog() { if (!cSetupDialog) { - cSetupDialog = std::make_unique(this->hInstance, this->hWnd); - cSetupDialog->InitInstance(); + cSetupDialog = std::make_unique(this->hInstance, mainHwnd); } - else - { - cSetupDialog->SetForeground(); - } -} - -void CMainWindow::ShowAlreadyRunningBalloon() -{ - TCHAR titleString[100]; - TCHAR messageString[100]; - LoadString(hInst, IDS_ALREADY_RUNNING, titleString, sizeof(titleString) / sizeof(TCHAR)); - if (isWindows10orNewer) + if (!cSetupDialog->hasInitInstance()) { - LoadString(hInst, DS_ALREADY_RUNNING_HINT_WIN10, messageString, sizeof(messageString) / sizeof(TCHAR)); + cSetupDialog->InitInstance(); } else { - LoadString(hInst, DS_ALREADY_RUNNING_HINT, messageString, sizeof(messageString) / sizeof(TCHAR)); + cSetupDialog->SetForeground(); } - cNotifyIcon->ShowBalloon(titleString, messageString); } void CMainWindow::CheckIsFirstRun() { - if (!settingsManager->GetSkipWelcome()) + int skipValue = settingsManager->GetSkipWelcome(); + if (skipValue == 0 || skipValue == -1) { - settingsManager->SetSkipWelcome(); - TCHAR titleString[100]; - TCHAR messageString[100]; - LoadString(hInst, IDS_WELCOME_TITLE, titleString, sizeof(titleString) / sizeof(TCHAR)); - if (isWindows10orNewer) - { - LoadString(hInst, IDS_WELCOME_MESSAGE_WIN10, messageString, sizeof(messageString) / sizeof(TCHAR)); - } - else - { - LoadString(hInst, IDS_WELCOME_MESSAGE, messageString, sizeof(messageString) / sizeof(TCHAR)); - } - cNotifyIcon->ShowBalloon(titleString, messageString); + cIntroDialog = std::make_unique(this->hInstance, this->hWnd); + cIntroDialog->InitInstance(); } } \ No newline at end of file diff --git a/SpookyView/CMainWindow.h b/SpookyView/CMainWindow.h index 88d71f2..5df622f 100644 --- a/SpookyView/CMainWindow.h +++ b/SpookyView/CMainWindow.h @@ -4,6 +4,7 @@ #include "CWindow.h" #include "CNotifyIcon.h" #include "CAbout.h" +#include "CIntroDialog.h" #include "CSetupDialog.h" #include "CSettingsDialog.h" #include @@ -21,7 +22,6 @@ class CMainWindow: public CWindow void OpenContextMenu(); void OpenSetupDialog(); void CloseWindow(); - void ShowAlreadyRunningBalloon(); HMENU GetContextMenu(); //Members TCHAR pausedString[80]; @@ -29,8 +29,6 @@ class CMainWindow: public CWindow BOOL hasDoubleClicked; std::unique_ptr cNotifyIcon; HMENU notifyIconContextMenu; - std::unique_ptr cSetupDialog; - std::unique_ptr cSettingsDialog; std::unique_ptr cAboutDialog; std::unique_ptr cUpdateAvailableDialog; }; diff --git a/SpookyView/CRegistrySettingsManager.cpp b/SpookyView/CRegistrySettingsManager.cpp index 3bf90e6..30a4883 100644 --- a/SpookyView/CRegistrySettingsManager.cpp +++ b/SpookyView/CRegistrySettingsManager.cpp @@ -309,18 +309,18 @@ void CRegistrySettingsManager::SetDisableUpdateCheck(BOOL state) SaveValue(_T("Software\\Spooky View"), _T("Disable update check"), REG_BINARY, &stateByte); } -BOOL CRegistrySettingsManager::GetSkipWelcome() +int CRegistrySettingsManager::GetSkipWelcome() { BYTE keyData[1]; if (ReadValue(_T("Software\\Spooky View"), _T("Skip welcome"), REG_BINARY, keyData, sizeof(keyData))) { return keyData[0]; } - return FALSE; + return -1; } -void CRegistrySettingsManager::SetSkipWelcome() +void CRegistrySettingsManager::SetSkipWelcome(BOOL state) { - BYTE stateByte = '\x1'; + BYTE stateByte = state ? '\x1' : '\x0'; SaveValue(_T("Software\\Spooky View"), _T("Skip welcome"), REG_BINARY, &stateByte); } diff --git a/SpookyView/CRegistrySettingsManager.h b/SpookyView/CRegistrySettingsManager.h index ef6d757..7ae1731 100644 --- a/SpookyView/CRegistrySettingsManager.h +++ b/SpookyView/CRegistrySettingsManager.h @@ -18,8 +18,8 @@ class CRegistrySettingsManager : public ISettingsManager BOOL ShouldSkipVersion(tstring versionNumber); BOOL GetDisableUpdateCheck(); void SetDisableUpdateCheck(BOOL state); - BOOL GetSkipWelcome(); - void SetSkipWelcome(); + int GetSkipWelcome(); + void SetSkipWelcome(BOOL state); protected: std::unique_ptr settings; void SaveAlphaSettingsValues(HKEY key, CAlphaSettings values); diff --git a/SpookyView/CSettingsDialog.cpp b/SpookyView/CSettingsDialog.cpp index e492814..cd0567e 100644 --- a/SpookyView/CSettingsDialog.cpp +++ b/SpookyView/CSettingsDialog.cpp @@ -52,10 +52,23 @@ void CSettingsDialog::ApplySettings() } HWND disableUpdateCheck = GetDlgItem(hWnd, IDC_CHECKBOX_DISABLE_UPDATE_CHECK); settingsManager->SetDisableUpdateCheck(Button_GetCheck(disableUpdateCheck)); + HWND skipIntroCheck = GetDlgItem(hWnd, IDC_CHECKBOX_SKIP_WELCOME); + settingsManager->SetSkipWelcome(Button_GetCheck(skipIntroCheck)); + if (cIntroDialog && cIntroDialog->hasInitInstance()) + { + cIntroDialog->setSkipWelcomeCheckbox(Button_GetCheck(skipIntroCheck)); + } } void CSettingsDialog::SetFormValues(HWND hDlg) { + HWND skipIntroCheckbox = GetDlgItem(hDlg, IDC_CHECKBOX_SKIP_WELCOME); + int skipValue = settingsManager->GetSkipWelcome(); + if (skipValue == 1) + { + Button_SetCheck(skipIntroCheckbox, TRUE); + } + HWND autoStartupCheckbox = GetDlgItem(hDlg, IDC_CHECKBOX_AUTO_STARTUP); #ifdef PACKAGING_STORE ShowWindow(autoStartupCheckbox, SW_HIDE); diff --git a/SpookyView/ISettingsManager.h b/SpookyView/ISettingsManager.h index 231698c..5298b6c 100644 --- a/SpookyView/ISettingsManager.h +++ b/SpookyView/ISettingsManager.h @@ -20,7 +20,7 @@ class ISettingsManager virtual BOOL GetDisableUpdateCheck() = 0; virtual void SetDisableUpdateCheck(BOOL state) = 0; virtual BOOL GetSkipWelcome() = 0; - virtual void SetSkipWelcome() = 0; + virtual void SetSkipWelcome(BOOL state) = 0; }; #endif \ No newline at end of file diff --git a/SpookyView/Resource.h b/SpookyView/Resource.h index b67c6b8..1316190 100644 --- a/SpookyView/Resource.h +++ b/SpookyView/Resource.h @@ -22,18 +22,14 @@ #define IDS_ERROR_CANNOT_SAVE_SETTINGS 119 #define IDD_ADD_WINDOW 120 #define IDS_ERROR_TITLE 120 -#define IDS_ALREADY_RUNNING 121 #define IDB_SPOOK 122 -#define DS_ALREADY_RUNNING_HINT_WIN10 122 -#define DS_ALREADY_RUNNING_HINT 123 #define IDI_SPOOKYVIEW 124 -#define IDS_WELCOME_TITLE 124 -#define IDS_WELCOME_MESSAGE 125 -#define IDS_WELCOME_MESSAGE_WIN10 126 #define IDS_PAUSED 127 +#define IDD_INTRO 127 #define IDS_ERROR_CANNOT_CREATE_MAIN_WINDOW 128 #define IDS_ERROR_CANNOT_CREATE_NOTIFICATION_AREA_ICON 129 #define IDS_ERROR_CANNOT_CREATE_REGISTRY_KEY 130 +#define IDB_NOTIFYICON 131 #define ID_DOWNLOAD 1000 #define IDC_SKIP_VERSION 1001 #define ID_CLOSE 1002 @@ -42,12 +38,19 @@ #define IDC_SPOOK_IMAGE 1004 #define IDC_CHECKBOX_DISABLE_UPDATE_CHECK 1005 #define IDC_STATIC_APP_EXECUTABLE 1006 +#define IDC_CHECKBOX_DISABLE_UPDATE_CHECK2 1006 +#define IDC_CHECKBOX_SKIP_WELCOME 1006 #define IDC_EDIT_EXECUTABLE_NAME 1007 #define IDC_STATIC_FOREGORUND_TRANSPARENT 1008 #define IDC_STATIC_FOREGROUND_OPAQUE 1009 #define IDC_STATIC_BACKGROUND_TRANSPARENT 1010 #define IDC_STATIC_BACKGROUND_OPAQUE 1011 #define IDC_CHECKBOX_SEPARATE_BACKGROUND_VALUE 1012 +#define IDC_INTRO_TEXT 1014 +#define IDC_SKIP_INTRO_CHECKBOX 1015 +#define IDC_BUTTON_INTRO_SETTINGS 1016 +#define ID_STATIC_INTRO_TITLE 1018 +#define IDC_BUTTON_SETUP_APPS 1020 #define IDC_LIST_ADD_APPS 40000 #define IDC_LIST_ADD_WINDOWS 40000 #define IDC_LIST_APPS 40000 @@ -76,15 +79,16 @@ #define IDC_STATIC_APPS 40014 #define IDC_STATIC_TRANSPARENCY 40015 #define IDC_SLIDER_BACKGROUND 40016 +#define IDM_INTRO 40019 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 -#define _APS_NEXT_RESOURCE_VALUE 127 -#define _APS_NEXT_COMMAND_VALUE 40017 -#define _APS_NEXT_CONTROL_VALUE 1013 +#define _APS_NEXT_RESOURCE_VALUE 131 +#define _APS_NEXT_COMMAND_VALUE 40020 +#define _APS_NEXT_CONTROL_VALUE 1021 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/SpookyView/SpookyView.cpp b/SpookyView/SpookyView.cpp index c681069..556af75 100644 --- a/SpookyView/SpookyView.cpp +++ b/SpookyView/SpookyView.cpp @@ -10,14 +10,17 @@ // Global Variables: HINSTANCE hInst; // current instance +HWND mainHwnd; // Main window hwnd HICON spookyIcon; PGNSI isImmersive; std::unique_ptr mainWindow; +std::unique_ptr cSettingsDialog; +std::unique_ptr cSetupDialog; +std::unique_ptr cIntroDialog; std::unique_ptr settingsManager; UpdateResponse updateResponse; WindowsEnum windowsEnum; bool isWindows8; -bool isWindows10orNewer; int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPTSTR lpCmdLine, _In_ int nCmdShow) { diff --git a/SpookyView/SpookyView.h b/SpookyView/SpookyView.h index 77bdfb8..fc472d1 100644 --- a/SpookyView/SpookyView.h +++ b/SpookyView/SpookyView.h @@ -8,12 +8,15 @@ extern HICON spookyIcon; extern HINSTANCE hInst; +extern HWND mainHwnd; extern std::unique_ptr settingsManager; extern std::unique_ptr mainWindow; +extern std::unique_ptr cSettingsDialog; +extern std::unique_ptr cSetupDialog; +extern std::unique_ptr cIntroDialog; extern WindowsEnum windowsEnum; extern PGNSI isImmersive; extern bool isWindows8; -extern bool isWindows10orNewer; extern UpdateResponse updateResponse; #endif \ No newline at end of file diff --git a/SpookyView/SpookyView.rc b/SpookyView/SpookyView.rc index 145a182..bb853f9 100644 --- a/SpookyView/SpookyView.rc +++ b/SpookyView/SpookyView.rc @@ -52,6 +52,8 @@ END IDB_SPOOK BITMAP ".\\spook.bmp" +IDB_NOTIFYICON BITMAP "notifyicon.bmp" + #endif // Neutral resources ///////////////////////////////////////////////////////////////////////////// @@ -94,6 +96,7 @@ BEGIN BEGIN MENUITEM "&Open...", IDM_OPEN,MFT_STRING,MFS_ENABLED | MFS_UNCHECKED | MFS_UNHILITE | MFS_DEFAULT MENUITEM "Settings...", IDM_SETTINGS,MFT_STRING,MFS_ENABLED + MENUITEM "Introduction...", IDM_INTRO,MFT_STRING,MFS_ENABLED MENUITEM "&About...", IDM_ABOUT,MFT_STRING,MFS_ENABLED MENUITEM "&Pause", IDM_PAUSE,MFT_STRING,MFS_ENABLED MENUITEM "&Exit", IDM_EXIT,MFT_STRING,MFS_ENABLED @@ -115,7 +118,7 @@ BEGIN LTEXT "https://www.tyndomyn.net",IDC_STATIC,12,78,130,8 LTEXT "Based on an idea by Mikey",IDC_STATIC,12,102,130,8 LTEXT "Spooky View",IDC_STATIC,12,6,130,8,SS_NOPREFIX - LTEXT "1.0.6.0 (Nicely spoken release)",IDC_STATIC,12,18,136,18 + LTEXT "1.0.7.0 (A warm welcome release)",IDC_STATIC,12,18,136,18 LTEXT "Copyright (c) 2022 Martijn van Antwerpen",IDC_STATIC,12,66,138,8 DEFPUSHBUTTON "Close",IDOK,180,114,50,14,WS_GROUP CONTROL IDB_SPOOK,IDC_SPOOK_IMAGE,"Static",SS_BITMAP,162,6,67,62 @@ -154,11 +157,13 @@ CAPTION "Settings" FONT 8, "Ms Shell Dlg", 0, 0, 0x0 BEGIN CONTROL "Start program when this user logs in",IDC_CHECKBOX_AUTO_STARTUP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,6,127,8 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,6,127,10 PUSHBUTTON "Cancel",IDCANCEL,232,162,50,14 DEFPUSHBUTTON "OK",IDOK,177,162,50,14 CONTROL "Do not check for updates on start",IDC_CHECKBOX_DISABLE_UPDATE_CHECK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,24,124,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,24,127,10 + CONTROL "Do not show welcome window on startup",IDC_CHECKBOX_SKIP_WELCOME, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,42,227,10 END IDD_SETUP DIALOGEX 0, 0, 474, 318 @@ -201,6 +206,22 @@ BEGIN LTEXT "Message!",IDC_UPDATE_MESSAGE,7,7,245,85,NOT WS_GROUP END +IDD_INTRO DIALOGEX 0, 0, 207, 255 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Spooky View" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "Close",IDCLOSE,150,234,50,14 + LTEXT "Welcome to\n\nSpooky View",ID_STATIC_INTRO_TITLE,85,7,115,49 + CONTROL IDB_NOTIFYICON,IDC_STATIC,"Static",SS_BITMAP,45,103,121,98 + LTEXT "Double-click this app's icon in the notification area or open the app again to set it up.",IDC_INTRO_TEXT,7,77,193,19 + CONTROL "Do not show this window again",IDC_SKIP_INTRO_CHECKBOX, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,238,115,10 + CONTROL IDB_SPOOK,IDC_STATIC,"Static",SS_BITMAP,7,7,67,62 + PUSHBUTTON "Open settings...",IDC_BUTTON_INTRO_SETTINGS,118,211,82,14 + PUSHBUTTON "Setup apps...",IDC_BUTTON_SETUP_APPS,7,211,82,14 +END + ///////////////////////////////////////////////////////////////////////////// // @@ -208,8 +229,8 @@ END // 1 VERSIONINFO - FILEVERSION 1,0,6,0 - PRODUCTVERSION 1,0,6,0 + FILEVERSION 1,0,7,0 + PRODUCTVERSION 1,0,7,0 FILEFLAGSMASK 0x2L #ifdef _DEBUG FILEFLAGS 0x1L @@ -227,12 +248,12 @@ BEGIN VALUE "Comments", "This application is licensed under the GNU GPL v3.0 or later" VALUE "CompanyName", "TynDomyn.net" VALUE "FileDescription", "Spooky View" - VALUE "FileVersion", "1.0.6.0 (Nicely spoken release)" + VALUE "FileVersion", "1.0.7.0 (A warm welcome release)" VALUE "InternalName", "Spooky View" VALUE "LegalCopyright", "(c) Martijn van Antwerpen" VALUE "OriginalFilename", "Spookyview.exe" VALUE "ProductName", "Spooky View" - VALUE "ProductVersion", "1.0.6.0 (Nicely spoken release)" + VALUE "ProductVersion", "1.0.7.0 (A warm welcome release)" END END BLOCK "VarFileInfo" @@ -277,6 +298,14 @@ BEGIN TOPMARGIN, 7 BOTTOMMARGIN, 118 END + + IDD_INTRO, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 200 + TOPMARGIN, 7 + BOTTOMMARGIN, 248 + END END #endif // APSTUDIO_INVOKED @@ -311,14 +340,6 @@ BEGIN IDS_ERROR_CANNOT_SAVE_SETTINGS "Could not save settings. Modifications are not stored." IDS_ERROR_TITLE "Error" - IDS_ALREADY_RUNNING "Spooky View is already running" - DS_ALREADY_RUNNING_HINT_WIN10 - "Right click on the icon in the notification area to configure this application." - DS_ALREADY_RUNNING_HINT "Right click on this icon to configure this application." - IDS_WELCOME_TITLE "Welcome to Spooky View" - IDS_WELCOME_MESSAGE "Right click on this icon to configure this application." - IDS_WELCOME_MESSAGE_WIN10 - "Right click on the icon in the notification area to configure this application." IDS_PAUSED "Paused" END @@ -353,6 +374,7 @@ BEGIN BEGIN MENUITEM "&Openen...", IDM_OPEN,MFT_STRING,MFS_ENABLED | MFS_UNCHECKED | MFS_UNHILITE | MFS_DEFAULT MENUITEM "Instellingen...", IDM_SETTINGS,MFT_STRING,MFS_ENABLED + MENUITEM "Introductie...", IDM_INTRO,MFT_STRING,MFS_ENABLED MENUITEM "&Over...", IDM_ABOUT,MFT_STRING,MFS_ENABLED MENUITEM "&Pauzeren", IDM_PAUSE,MFT_STRING,MFS_ENABLED MENUITEM "&Sluiten", IDM_EXIT,MFT_STRING,MFS_ENABLED @@ -374,7 +396,7 @@ BEGIN LTEXT "https://www.tyndomyn.net",IDC_STATIC,12,78,130,8 LTEXT "Gebaseerd op een idee van Mikey",IDC_STATIC,12,102,130,8 LTEXT "Spooky View",IDC_STATIC,12,6,130,8,SS_NOPREFIX - LTEXT "1.0.6.0 (Nicely spoken release)",IDC_STATIC,12,18,136,18 + LTEXT "1.0.7.0 (A warm welcome release)",IDC_STATIC,12,18,136,18 LTEXT "Copyright (c) 2022 Martijn van Antwerpen",IDC_STATIC,12,66,138,8 DEFPUSHBUTTON "Sluiten",IDOK,180,114,50,14,WS_GROUP CONTROL IDB_SPOOK,IDC_SPOOK_IMAGE,"Static",SS_BITMAP,162,6,67,62 @@ -413,11 +435,13 @@ CAPTION "Instellingen" FONT 8, "Ms Shell Dlg", 0, 0, 0x0 BEGIN CONTROL "Start programma bij aanmelden",IDC_CHECKBOX_AUTO_STARTUP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,6,230,8 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,6,230,10 PUSHBUTTON "Annuleren",IDCANCEL,232,162,50,14 DEFPUSHBUTTON "OK",IDOK,177,162,50,14 CONTROL "Geen controle op updates bij starten",IDC_CHECKBOX_DISABLE_UPDATE_CHECK, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,24,227,10 + CONTROL "Toon welkomstvenster niet bij opstarten",IDC_CHECKBOX_SKIP_WELCOME, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,42,227,10 END IDD_SETUP DIALOGEX 0, 0, 474, 318 @@ -460,6 +484,22 @@ BEGIN LTEXT "Bericht!",IDC_UPDATE_MESSAGE,7,7,245,85,NOT WS_GROUP END +IDD_INTRO DIALOGEX 0, 0, 207, 255 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Spooky View" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "Sluiten",IDCLOSE,150,234,50,14 + LTEXT "Welkom bij\n\nSpooky View",ID_STATIC_INTRO_TITLE,85,7,115,49 + CONTROL IDB_NOTIFYICON,IDC_STATIC,"Static",SS_BITMAP,45,103,121,98 + LTEXT "Dubbeklik op het icoon van deze app in het systeemvak of open de app nogmaals om deze in te stellen.",IDC_INTRO_TEXT,7,77,193,19 + CONTROL "Toon dit venster niet opnieuw",IDC_SKIP_INTRO_CHECKBOX, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,238,111,10 + CONTROL IDB_SPOOK,IDC_STATIC,"Static",SS_BITMAP,7,7,67,62 + PUSHBUTTON "Open instellingen...",IDC_BUTTON_INTRO_SETTINGS,118,211,82,14 + PUSHBUTTON "Stel apps in...",IDC_BUTTON_SETUP_APPS,7,211,82,14 +END + ///////////////////////////////////////////////////////////////////////////// // @@ -467,8 +507,8 @@ END // 1 VERSIONINFO - FILEVERSION 1,0,6,0 - PRODUCTVERSION 1,0,6,0 + FILEVERSION 1,0,7,0 + PRODUCTVERSION 1,0,7,0 FILEFLAGSMASK 0x2L #ifdef _DEBUG FILEFLAGS 0x1L @@ -486,12 +526,12 @@ BEGIN VALUE "Comments", "Deze toepassing valt onder de GNU GPL v3.0-licentie of hoger" VALUE "CompanyName", "TynDomyn.net" VALUE "FileDescription", "Spooky View" - VALUE "FileVersion", "1.0.6.0 (Nicely spoken release)" + VALUE "FileVersion", "1.0.7.0 (A warm welcome release)" VALUE "InternalName", "Spooky View" VALUE "LegalCopyright", "(c) Martijn van Antwerpen" VALUE "OriginalFilename", "Spookyview.exe" VALUE "ProductName", "Spooky View" - VALUE "ProductVersion", "1.0.6.0 (Nicely spoken release)" + VALUE "ProductVersion", "1.0.7.0 (A warm welcome release)" END END BLOCK "VarFileInfo" @@ -536,6 +576,14 @@ BEGIN TOPMARGIN, 7 BOTTOMMARGIN, 118 END + + IDD_INTRO, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 200 + TOPMARGIN, 7 + BOTTOMMARGIN, 248 + END END #endif // APSTUDIO_INVOKED @@ -570,14 +618,6 @@ BEGIN IDS_ERROR_CANNOT_SAVE_SETTINGS "Kon instellingen niet opslaan. Wijzigingen zijn niet opgeslagen." IDS_ERROR_TITLE "Fout" - IDS_ALREADY_RUNNING "Spooky View is al actief" - DS_ALREADY_RUNNING_HINT_WIN10 - "Klik met de rechtermuisknop op het icoon in het systeemvak om dit programma in te stellen." - DS_ALREADY_RUNNING_HINT "Klik met de rechtermuisknop op dit icoon om dit programma in te stellen." - IDS_WELCOME_TITLE "Welkom bij Spooky View" - IDS_WELCOME_MESSAGE "Klik met de rechtermuisknop op dit icoon om dit programma in te stellen." - IDS_WELCOME_MESSAGE_WIN10 - "Klik met de rechtermuisknop op het icoon in het systeemvak om dit programma in te stellen." IDS_PAUSED "Gepauzeerd" END diff --git a/SpookyView/SpookyView.vcxproj b/SpookyView/SpookyView.vcxproj index 9cebf91..f6b6a3b 100644 --- a/SpookyView/SpookyView.vcxproj +++ b/SpookyView/SpookyView.vcxproj @@ -475,6 +475,7 @@ + @@ -512,6 +513,7 @@ + @@ -554,6 +556,7 @@ + diff --git a/SpookyView/SpookyView.vcxproj.filters b/SpookyView/SpookyView.vcxproj.filters index 52d2b7d..e65169d 100644 --- a/SpookyView/SpookyView.vcxproj.filters +++ b/SpookyView/SpookyView.vcxproj.filters @@ -156,6 +156,9 @@ Header Files\Function + + Header Files\Classes\Windows + @@ -233,6 +236,9 @@ Source Files\Function + + Source Files\Classes\Windows + @@ -246,6 +252,9 @@ Resource Files + + Resource Files + diff --git a/SpookyView/WindowsEnum.cpp b/SpookyView/WindowsEnum.cpp index c3617fd..454452b 100644 --- a/SpookyView/WindowsEnum.cpp +++ b/SpookyView/WindowsEnum.cpp @@ -283,6 +283,10 @@ BOOL WindowsEnum::GetWindowProcessAndClass(HWND hwnd) { BOOL result = FALSE; GetWindowThreadProcessId(hwnd, &processId); + if (processId == GetCurrentProcessId()) + { + return FALSE; + } HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, processId); if (hProcess != NULL) { diff --git a/SpookyView/notifyicon.bmp b/SpookyView/notifyicon.bmp new file mode 100644 index 0000000..111c4cb Binary files /dev/null and b/SpookyView/notifyicon.bmp differ diff --git a/StorePackaging/Package.appxmanifest b/StorePackaging/Package.appxmanifest index 30d8d6f..b2b499b 100644 --- a/StorePackaging/Package.appxmanifest +++ b/StorePackaging/Package.appxmanifest @@ -1,6 +1,6 @@  - + Spooky View LittleTijn diff --git a/WiXSetup/Product.wxs b/WiXSetup/Product.wxs index 4f28dce..d75d0ae 100644 --- a/WiXSetup/Product.wxs +++ b/WiXSetup/Product.wxs @@ -1,5 +1,5 @@  - +