-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore dialog from tray when blocking multiple app instances
Also, clean up unnecessary code added by MFC App Wizard
- Loading branch information
Showing
8 changed files
with
101 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include "pch.h" | ||
#include "framework.h" | ||
#include "StayAwake.h" | ||
#include "afxdialogex.h" | ||
#include "Utils.h" | ||
#include "StayAwakeAboutDlg.h" | ||
|
||
#ifdef _DEBUG | ||
#define new DEBUG_NEW | ||
#endif | ||
|
||
|
||
BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx) | ||
ON_NOTIFY(NM_CLICK, IDC_ABOUT_PROD_URL, OnProdUrlClick) | ||
ON_NOTIFY(NM_RETURN, IDC_ABOUT_PROD_URL, OnProdUrlReturn) | ||
END_MESSAGE_MAP() | ||
|
||
CAboutDlg::CAboutDlg() : CDialogEx(IDD_ABOUTBOX) | ||
{ | ||
} | ||
|
||
void CAboutDlg::DoDataExchange(CDataExchange* pDX) | ||
{ | ||
CDialogEx::DoDataExchange(pDX); | ||
} | ||
|
||
|
||
BOOL CAboutDlg::OnInitDialog() | ||
{ | ||
CDialogEx::OnInitDialog(); | ||
|
||
#ifdef _WIN64 | ||
wstring buildBit{ L" (64-bit)" }; | ||
#else | ||
wstring buildBit{ L" (32-bit)" }; | ||
#endif // _WIN64 | ||
|
||
SetDlgItemText(IDC_ABOUT_NAME, Utils::getVersionInfo(theApp.m_hInstance, L"FileDescription").c_str()); | ||
SetDlgItemText(IDC_ABOUT_VERSION, (L"Version: " + Utils::getVersionInfo(theApp.m_hInstance, L"FileVersion") + buildBit).c_str()); | ||
SetDlgItemTextA(m_hWnd, IDC_ABOUT_BUILD_TIME, ("Build time: " + string(__DATE__) + " - " + string(__TIME__)).c_str()); | ||
SetDlgItemText(IDC_ABOUT_ATTRIBUTION, Utils::getVersionInfo(theApp.m_hInstance, L"LegalCopyright").c_str()); | ||
|
||
return TRUE; | ||
} | ||
|
||
|
||
afx_msg void CAboutDlg::OnProdUrlClick(NMHDR* pNotifyStruct, LRESULT* result) | ||
{ | ||
ShellExecute(NULL, L"open", Utils::getVersionInfo(theApp.m_hInstance, L"CompanyName").c_str(), NULL, NULL, SW_SHOW); | ||
} | ||
|
||
|
||
afx_msg void CAboutDlg::OnProdUrlReturn(NMHDR* pNotifyStruct, LRESULT* result) | ||
{ | ||
ShellExecute(NULL, L"open", Utils::getVersionInfo(theApp.m_hInstance, L"CompanyName").c_str(), NULL, NULL, SW_SHOW); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
class CAboutDlg : public CDialogEx | ||
{ | ||
public: | ||
CAboutDlg(); | ||
|
||
#ifdef AFX_DESIGN_TIME | ||
enum { IDD = IDD_ABOUTBOX }; | ||
#endif | ||
|
||
protected: | ||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support | ||
virtual BOOL OnInitDialog(); | ||
afx_msg void OnProdUrlClick(NMHDR* pNotifyStruct, LRESULT* result); | ||
afx_msg void OnProdUrlReturn(NMHDR* pNotifyStruct, LRESULT* result); | ||
DECLARE_MESSAGE_MAP() | ||
}; |
Oops, something went wrong.