summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/steam_dialogs.cpp
blob: 95cc2df8dfebb2764786f25ad4134ae77f1f34f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "stdafx.h"

CSteamPasswordEditor::CSteamPasswordEditor(CSteamProto *proto) :
	CSteamDlgBase(proto, IDD_PASSWORD_EDITOR),
	m_password(this, IDC_PASSWORD),
	m_savePermanently(this, IDC_SAVEPERMANENTLY)
{
}

bool CSteamPasswordEditor::OnInitDialog()
{
	char iconName[100];
	mir_snprintf(iconName, "%s_%s", MODULE, "main");
	Window_SetIcon_IcoLib(m_hwnd, IcoLib_GetIconHandle(iconName));

	SendMessage(m_password.GetHwnd(), EM_LIMITTEXT, 64, 0);

	Utils_RestoreWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "PasswordWindow");
	return true;
}

bool CSteamPasswordEditor::OnApply()
{
	m_proto->m_password = m_password.GetText();
	if (m_savePermanently.Enabled())
		m_proto->setWString("Password", m_proto->m_password);

	EndModal(DIALOG_RESULT_OK);
	return true;
}

void CSteamPasswordEditor::OnDestroy()
{
	Utils_SaveWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "PasswordWindow");
}