Page MenuHomedesp's stash

No OneTemporary

diff --git a/Scylla/DonateGui.cpp b/Scylla/DonateGui.cpp
new file mode 100644
index 0000000..c472200
--- /dev/null
+++ b/Scylla/DonateGui.cpp
@@ -0,0 +1,50 @@
+#include "DonateGui.h"
+
+#include "Scylla.h"
+#include "Architecture.h"
+
+const WCHAR DonateGui::TEXT_DONATE[] = L"If you like this tool, please feel free to donate some Bitcoins to support this project.\n\n\nBTC Address:\n\n" TEXT(DONATE_BTC_ADDRESS);
+
+
+BOOL DonateGui::OnInitDialog(CWindow wndFocus, LPARAM lInitParam)
+{
+ DoDataExchange(); // attach controls
+
+ DonateInfo.SetWindowText(TEXT_DONATE);
+
+ CenterWindow();
+
+ // Set focus to button
+ GotoDlgCtrl(GetDlgItem(IDC_BUTTON_COPYBTC));
+ return FALSE;
+}
+
+void DonateGui::OnClose()
+{
+ EndDialog(0);
+}
+
+void DonateGui::OnExit(UINT uNotifyCode, int nID, CWindow wndCtl)
+{
+ SendMessage(WM_CLOSE);
+}
+
+void DonateGui::CopyBtcAddress(UINT uNotifyCode, int nID, CWindow wndCtl)
+{
+ if(OpenClipboard())
+ {
+ EmptyClipboard();
+ size_t len = strlen(DONATE_BTC_ADDRESS);
+ HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(CHAR));
+ if(hMem)
+ {
+ strcpy_s(static_cast<CHAR *>(GlobalLock(hMem)), len + 1, DONATE_BTC_ADDRESS);
+ GlobalUnlock(hMem);
+ if(!SetClipboardData(CF_TEXT, hMem))
+ {
+ GlobalFree(hMem);
+ }
+ }
+ CloseClipboard();
+ }
+}
\ No newline at end of file
diff --git a/Scylla/DonateGui.h b/Scylla/DonateGui.h
new file mode 100644
index 0000000..26534ed
--- /dev/null
+++ b/Scylla/DonateGui.h
@@ -0,0 +1,49 @@
+#pragma once
+
+#include <windows.h>
+#include "resource.h"
+
+// WTL
+#include <atlbase.h> // base ATL classes
+#include <atlapp.h> // base WTL classes
+#include <atlwin.h> // ATL GUI classes
+#include <atlcrack.h> // WTL enhanced msg map macros
+#include <atlctrls.h> // WTL controls
+#include <atlddx.h> // WTL dialog data exchange
+
+class DonateGui : public CDialogImpl<DonateGui>, public CWinDataExchange<DonateGui>
+{
+public:
+ enum { IDD = IDD_DLG_DONATE };
+
+ BEGIN_DDX_MAP(DonateGui)
+ DDX_CONTROL_HANDLE(IDC_STATIC_DONATEINFO, DonateInfo)
+ END_DDX_MAP()
+
+ BEGIN_MSG_MAP(DonateGui)
+ MSG_WM_INITDIALOG(OnInitDialog)
+ MSG_WM_CLOSE(OnClose)
+ COMMAND_ID_HANDLER_EX(IDC_BUTTON_COPYBTC, CopyBtcAddress)
+
+ COMMAND_ID_HANDLER_EX(IDOK, OnExit)
+ COMMAND_ID_HANDLER_EX(IDCANCEL, OnExit)
+ END_MSG_MAP()
+
+protected:
+
+ // Controls
+
+ CStatic DonateInfo;
+
+ // Texts
+ static const WCHAR TEXT_DONATE[];
+
+protected:
+
+ // Message handlers
+ void CopyBtcAddress(UINT uNotifyCode, int nID, CWindow wndCtl);
+ BOOL OnInitDialog(CWindow wndFocus, LPARAM lInitParam);
+ void OnClose();
+ void OnExit(UINT uNotifyCode, int nID, CWindow wndCtl);
+
+};
\ No newline at end of file

File Metadata

Mime Type
text/x-diff
Expires
Sat, Jul 5, 5:12 PM (1 d, 1 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
08/64/f64eb4684d04d8a8566a2c4b5b2e

Event Timeline