From 829fe6c6bc33d53fda9c31fd45a37e1df87befff Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期五, 30 一月 2026 11:16:24 +0800
Subject: [PATCH] Merge branch 'clh' into liuyang

---
 SourceCode/Bond/BondEq/AccordionWnd.cpp |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/SourceCode/Bond/BondEq/AccordionWnd.cpp b/SourceCode/Bond/BondEq/AccordionWnd.cpp
index 5da6615..026628e 100644
--- a/SourceCode/Bond/BondEq/AccordionWnd.cpp
+++ b/SourceCode/Bond/BondEq/AccordionWnd.cpp
@@ -47,9 +47,16 @@
 
 BOOL CAccordionWnd::RegisterWndClass()
 {
-	WNDCLASS wc;
+	WNDCLASS wcExisting = {};
+	HINSTANCE hInstance = AfxGetInstanceHandle();
+	if (::GetClassInfo(hInstance, ACCORDIONWND_CLASS, &wcExisting) ||
+		::GetClassInfo(NULL, ACCORDIONWND_CLASS, &wcExisting)) {
+		return TRUE;
+	}
+
+	WNDCLASS wc = {};
 	wc.lpszClassName = ACCORDIONWND_CLASS;
-	wc.hInstance = AfxGetInstanceHandle();
+	wc.hInstance = hInstance;
 	wc.lpfnWndProc = WindowProc;
 	wc.hCursor = ::LoadCursor(NULL, IDC_ARROW);
 	wc.hIcon = 0;
@@ -60,7 +67,10 @@
 	wc.cbWndExtra = 0;
 
 	// 注册自定义类
-	return (::RegisterClass(&wc) != 0);
+	if (::RegisterClass(&wc) != 0) {
+		return TRUE;
+	}
+	return (::GetLastError() == ERROR_CLASS_ALREADY_EXISTS);
 }
 
 CAccordionWnd * CAccordionWnd::FromHandle(HWND hWnd)

--
Gitblit v1.9.3