summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/steam_events.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-03-30 11:03:57 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-03-30 11:03:57 +0000
commitf1b2e090d9a10b4fc6dc7326856cb5be81a1d4d8 (patch)
tree7bcea5fac7674bfbe0e9c3cfac31d073ee01dbb0 /protocols/Steam/src/steam_events.cpp
parentd3fc664a564c8864eca2b2cd19396940e45f4dca (diff)
Steam: init commit
git-svn-id: http://svn.miranda-ng.org/main/trunk@8790 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_events.cpp')
-rw-r--r--protocols/Steam/src/steam_events.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/protocols/Steam/src/steam_events.cpp b/protocols/Steam/src/steam_events.cpp
new file mode 100644
index 0000000000..dd78bd2acd
--- /dev/null
+++ b/protocols/Steam/src/steam_events.cpp
@@ -0,0 +1,56 @@
+#include "steam.h"
+
+int CSteamProto::OnModulesLoaded(WPARAM, LPARAM)
+{
+ TCHAR name[128];
+ mir_sntprintf(name, SIZEOF(name), TranslateT("%s connection"), m_tszUserName);
+
+ NETLIBUSER nlu = { sizeof(nlu) };
+ nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
+ nlu.ptszDescriptiveName = name;
+ nlu.szSettingsModule = m_szModuleName;
+ m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+
+ return 0;
+}
+
+int CSteamProto::OnPreShutdown(WPARAM, LPARAM)
+{
+ //SetStatus(ID_STATUS_OFFLINE);
+
+ Netlib_CloseHandle(this->m_hNetlibUser);
+ this->m_hNetlibUser = NULL;
+
+ return 0;
+}
+
+INT_PTR __cdecl CSteamProto::OnAccountManagerInit(WPARAM wParam, LPARAM lParam)
+{
+ return (int)CreateDialogParam(
+ g_hInstance,
+ MAKEINTRESOURCE(IDD_ACCMGR),
+ (HWND)lParam,
+ CSteamProto::MainOptionsProc,
+ (LPARAM)this);
+}
+
+int __cdecl CSteamProto::OnOptionsInit(WPARAM wParam, LPARAM lParam)
+{
+ char *title = mir_t2a(this->m_tszUserName);
+
+ OPTIONSDIALOGPAGE odp = { sizeof(odp) };
+ odp.hInstance = g_hInstance;
+ odp.pszTitle = title;
+ odp.dwInitParam = LPARAM(this);
+ odp.flags = ODPF_BOLDGROUPS;
+ odp.pszGroup = LPGEN("Network");
+
+ odp.pszTab = LPGEN("Account");
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MAIN);
+ odp.pfnDlgProc = MainOptionsProc;
+ Options_AddPage(wParam, &odp);
+
+ mir_free(title);
+
+ return 0;
+} \ No newline at end of file