Skip to content

Commit dcf8f5c

Browse files
committed
style(mfc): normalize brace/spacing; remove legacy _MSC_VER guards; no functional change
- Adopt consistent one-line brace style across dialogs and controls. - Simplify if/else formatting and whitespace. - Remove obsolete `#if _MSC_VER >= 1000` guards around `#pragma once`. - No API or behavioral changes; modern MSVCs fully supported.
1 parent fe75aa2 commit dcf8f5c

File tree

5 files changed

+80
-155
lines changed

5 files changed

+80
-155
lines changed

ColorCop.cpp

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@ END_MESSAGE_MAP()
3232
// CColorCopApp construction
3333

3434

35-
CColorCopApp::CColorCopApp()
36-
{
35+
CColorCopApp::CColorCopApp() {
3736
m_hMutex = nullptr;
3837
}
3938

40-
CColorCopApp::~CColorCopApp()
41-
{
39+
CColorCopApp::~CColorCopApp() {
4240
if (m_hMutex != nullptr)
4341
{
4442
CloseHandle(m_hMutex);
@@ -53,8 +51,7 @@ CColorCopApp theApp;
5351
/////////////////////////////////////////////////////////////////////////////
5452
// CColorCopApp initialization
5553

56-
BOOL CColorCopApp::InitInstance()
57-
{
54+
BOOL CColorCopApp::InitInstance() {
5855
// multiple instances are not allowed?
5956
if (!(dlg.m_Appflags & MultipleInstances))
6057
{
@@ -82,14 +79,11 @@ BOOL CColorCopApp::InitInstance()
8279
}
8380

8481
// uses a Mutex to figure out if there is an instance of color cop running
85-
bool CColorCopApp::InstanceRunning()
86-
{
82+
bool CColorCopApp::InstanceRunning() {
8783
m_hMutex = CreateMutex(NULL, true, _T("ColorCop_Mutex"));
8884

89-
if (m_hMutex)
90-
{
91-
if (GetLastError() == ERROR_ALREADY_EXISTS)
92-
{
85+
if (m_hMutex) {
86+
if (GetLastError() == ERROR_ALREADY_EXISTS) {
9387
CloseHandle(m_hMutex); // Close the duplicate handle
9488
return true;
9589
}
@@ -99,8 +93,7 @@ bool CColorCopApp::InstanceRunning()
9993
return false;
10094
}
10195

102-
BOOL CColorCopApp::GetShellFolderPath(char* pShellFolder, char* pShellPath)
103-
{
96+
BOOL CColorCopApp::GetShellFolderPath(char* pShellFolder, char* pShellPath) {
10497
// pShellFolder can be one of the following
10598
// AppData, Cache, Cookies, Desktop, Favorites, Fonts, History, NetHood,
10699
// Personal, Printhood, Programs, Recent, SendTo, Start Menu, Startup,
@@ -127,8 +120,7 @@ BOOL CColorCopApp::GetShellFolderPath(char* pShellFolder, char* pShellPath)
127120
}
128121
}
129122

130-
CString CColorCopApp::GetTempFolder()
131-
{
123+
CString CColorCopApp::GetTempFolder() {
132124
CString strTmpPath;
133125

134126
GetShellFolderPath("AppData", strTmpPath.GetBuffer(MAX_PATH));
@@ -137,17 +129,15 @@ CString CColorCopApp::GetTempFolder()
137129
return strTmpPath;
138130
}
139131

140-
void CColorCopApp::ClipOrCenterWindowToMonitor(HWND hwnd, UINT flags)
141-
{
132+
void CColorCopApp::ClipOrCenterWindowToMonitor(HWND hwnd, UINT flags) {
142133
RECT rc;
143134
GetWindowRect(hwnd, &rc);
144135
SetWindowPos(hwnd, NULL, rc.left, rc.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
145136
dlg.WinLocX = rc.left;
146137
dlg.WinLocY = rc.top;
147138
}
148139

149-
BOOL CColorCopApp::InitApplication()
150-
{
140+
BOOL CColorCopApp::InitApplication() {
151141
CString strInitFile = GetTempFolder();
152142

153143
strInitFile += INI_FILE_DIR;
@@ -233,8 +223,7 @@ void CColorCopApp::CloseApplication() {
233223
return;
234224
}
235225

236-
void CColorCopApp::Serialize(CArchive& ar)
237-
{
226+
void CColorCopApp::Serialize(CArchive& ar) {
238227
if (ar.IsStoring()) {
239228
// storing code
240229
try {

ColorCop.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
#if !defined(AFX_HTMLCOP_H__EC2A34E4_4FAA_11D3_81A0_A79013DBA62A__INCLUDED_)
88
#define AFX_HTMLCOP_H__EC2A34E4_4FAA_11D3_81A0_A79013DBA62A__INCLUDED_
99

10-
#if _MSC_VER >= 1000
1110
#pragma once
12-
#endif // _MSC_VER >= 1000
1311

1412
#ifndef __AFXWIN_H__
1513
#error include 'stdafx.h' before including this file for PCH

0 commit comments

Comments
 (0)