initial commit

This commit is contained in:
2025-09-01 20:47:58 +08:00
commit 12c51b5ddb
843 changed files with 475321 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
set(UPDATER_SOURCE_RC SGMUpdatere.rc)
source_group("Resource Files" FILES ${UPDATER_SOURCE_RC})
set(WTL_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../WTL/include)
set(ACE_SDK_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../ace-sdk")
add_executable(SGMUpdatere WIN32
Updater_Main.cpp
Updater_MainDialog.h
Updater_MainDialog.cpp
${UPDATER_SOURCE_RC}
)
target_include_directories(SGMUpdatere PRIVATE
${WTL_INCLUDE_PATH}
${ACE_SDK_ROOT}/include
)
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
+51
View File
@@ -0,0 +1,51 @@
#include <atlbase.h>
#include <atlapp.h>
#include <assert.h>
#include "Updater_MainDialog.h"
CAppModule _Module;
int Run(LPTSTR /*lpCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
CMessageLoop theLoop;
_Module.AddMessageLoop(&theLoop);
CMainDialog dlgMain;
if (dlgMain.Create(NULL) == NULL)
{
ATLTRACE(_T("Main dialog creation failed!\n"));
return 0;
}
dlgMain.ShowWindow(nCmdShow);
int nRet = theLoop.Run();
_Module.RemoveMessageLoop();
return nRet;
}
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
{
HRESULT hRes = ::CoInitialize(NULL);
ATLASSERT(SUCCEEDED(hRes));
// this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
::DefWindowProc(NULL, 0, 0, 0L);
AtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES); // add flags to support other controls
hRes = _Module.Init(NULL, hInstance);
ATLASSERT(SUCCEEDED(hRes));
int nRet = Run(lpstrCmdLine, nCmdShow);
_Module.Term();
::CoUninitialize();
return nRet;
}
+25
View File
@@ -0,0 +1,25 @@
#include "Updater_MainDialog.h"
LRESULT CMainDialog::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
CenterWindow(GetParent());
return TRUE;
}
LRESULT CMainDialog::OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
CloseDialog(wID);
return 0;
}
LRESULT CMainDialog::OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
CloseDialog(wID);
return 0;
}
void CMainDialog::CloseDialog(int nVal)
{
DestroyWindow();
::PostQuitMessage(nVal);
}
+28
View File
@@ -0,0 +1,28 @@
#pragma once
#include <atlbase.h>
#include <atlapp.h>
#include <atldlgs.h>
#include "resource.h"
class CMainDialog : public CDialogImpl<CMainDialog>
{
public:
enum { IDD = IDD_DIALOG_MAIN };
BEGIN_MSG_MAP(CMainDialog)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_ID_HANDLER(IDOK, OnOK)
COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
END_MSG_MAP()
virtual BOOL PreTranslateMessage(MSG* pMsg)
{
return ::IsDialogMessage(m_hWnd, pMsg);
}
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
void CloseDialog(int nVal);
};
+17
View File
@@ -0,0 +1,17 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by SGMUpdatere.rc
//
#define IDD_DIALOG1 101
#define IDD_DIALOG_MAIN 101
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 103
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif