diff --git a/Main/src/ViewCriticalSector.cpp b/Main/src/ViewCriticalSector.cpp index c61f3087..2573a741 100644 --- a/Main/src/ViewCriticalSector.cpp +++ b/Main/src/ViewCriticalSector.cpp @@ -96,7 +96,7 @@ content->CreateStatic(this,1,2,WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS);//WS_CLIPCHILDREN| //content->CreateView(0,0,RUNTIME_CLASS(CPropertyGridView),CSize(splitX,0),&cc); //const HWND hPropGrid=content->GetDlgItemHwnd( content->IdFromRowCol(0,0) ); - propGrid.CreateEx( 0, (LPCTSTR)PropGrid::GetWindowClass(app.m_hInstance), nullptr, AFX_WS_DEFAULT_VIEW&~WS_BORDER, 0,0,PROPGRID_WIDTH_DEFAULT,300, content->m_hWnd, (HMENU)content->IdFromRowCol(0,0) ); + propGrid.CreateEx( 0, app.GetPropGridWndClass(), nullptr, AFX_WS_DEFAULT_VIEW&~WS_BORDER, 0,0,PROPGRID_WIDTH_DEFAULT,300, content->m_hWnd, (HMENU)content->IdFromRowCol(0,0) ); content->SetColumnInfo(0,Utils::LogicalUnitScaleFactor*PROPGRID_WIDTH_DEFAULT,0); //content->CreateView(0,1,RUNTIME_CLASS(CHexaEditor),CSize(),&cc); // commented out as created manually below hexaEditor.Update( fSectorData, fSectorData ); diff --git a/Main/src/editor.cpp b/Main/src/editor.cpp index 293b3934..a3d5eb43 100644 --- a/Main/src/editor.cpp +++ b/Main/src/editor.cpp @@ -187,6 +187,7 @@ cfPreferredDropEffect=::RegisterClipboardFormat(CFSTR_PREFERREDDROPEFFECT); cfPerformedDropEffect=::RegisterClipboardFormat(CFSTR_PERFORMEDDROPEFFECT); cfPasteSucceeded=::RegisterClipboardFormat(CFSTR_PASTESUCCEEDED); + propGridWndClass=PropGrid::RegisterWindowClass( m_hInstance ); // - registering recognizable Image types and known DOSes (in alphabetical order) CImage::Known.AddTail( &CCtRaw::Properties ); CImage::Known.AddTail( &D80::Properties ); diff --git a/Main/src/editor.h b/Main/src/editor.h index b926575e..30ab7f81 100644 --- a/Main/src/editor.h +++ b/Main/src/editor.h @@ -10,6 +10,7 @@ DECLARE_MESSAGE_MAP() private: bool godMode; + ATOM propGridWndClass; public: class CRecentFileListEx sealed:public CRecentFileList{ CDos::PCProperties openWith[ID_FILE_MRU_LAST+1-ID_FILE_MRU_FIRST]; @@ -38,6 +39,7 @@ CRecentFileListEx *GetRecentFileList() const; HWND GetEnabledActiveWindow() const; bool IsInGodMode() const; + inline LPCTSTR GetPropGridWndClass() const{ return (LPCTSTR)propGridWndClass; } inline CMainWindow *GetMainWindow() const{ return (CMainWindow *)m_pMainWnd; } #if _MFC_VER>=0x0A00 afx_msg void OnOpenRecentFile(UINT nID); diff --git a/PropGrid/src/api.cpp b/PropGrid/src/api.cpp index 4eb58ff5..c96f4f6a 100644 --- a/PropGrid/src/api.cpp +++ b/PropGrid/src/api.cpp @@ -2,7 +2,7 @@ #define PG_CLASS_NAME _T("WCPropGridClass32") - ATOM WINAPI PropGrid::GetWindowClass(HINSTANCE hInstance){ + ATOM WINAPI PropGrid::RegisterWindowClass(HINSTANCE hInstance){ // creates and returns PropertyGrid window class WNDCLASS wc; ::ZeroMemory(&wc,sizeof(wc)); @@ -15,7 +15,8 @@ HWND WINAPI PropGrid::Create(HINSTANCE hInstance,LPCTSTR windowName,UINT style,int x,int y,int width,int height,HWND hParent){ // creates and returns a new instance of the PropertyGrid //if (width<=2*CATEGORY_HEIGHT) width=2*CATEGORY_HEIGHT; - return ::CreateWindow( (LPCTSTR)GetWindowClass(hInstance), // making sure the window class is always defined + RegisterWindowClass(hInstance); // making sure the window class is always defined + return ::CreateWindow( PG_CLASS_NAME, windowName, WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | style, x,y, width,height, diff --git a/PropGrid/src/api.h b/PropGrid/src/api.h index 9059e97e..69ef721b 100644 --- a/PropGrid/src/api.h +++ b/PropGrid/src/api.h @@ -205,7 +205,7 @@ ); } - PROPGRID_DECLSPEC ATOM WINAPI GetWindowClass(HINSTANCE hInstance); + PROPGRID_DECLSPEC ATOM WINAPI RegisterWindowClass(HINSTANCE hInstance); PROPGRID_DECLSPEC HWND WINAPI Create(HINSTANCE hInstance,LPCTSTR windowName,UINT style,int x,int y,int width,int height,HWND hParent); PROPGRID_DECLSPEC HANDLE WINAPI AddPropertyW(HWND hPropGrid,HANDLE category,LPCWSTR name,PValue value,PCEditor editor,PCustomParam param=nullptr); PROPGRID_DECLSPEC HANDLE WINAPI AddPropertyA(HWND hPropGrid,HANDLE category,LPCSTR name,PValue value,PCEditor editor,PCustomParam param=nullptr);