summaryrefslogtreecommitdiff
path: root/plugins/WinterSpeak/src/MirandaDialog.cpp
blob: 646b8a198edc0c4bd2100f25a505511809d042b4 (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
36
37
38
#include "stdafx.h"
#include "MirandaDialog.h"


MirandaDialog::MirandaDialog(void)
{
}


MirandaDialog::~MirandaDialog(void)
{
}

void MirandaDialog::changed(HWND window)
{
	SendMessage(GetParent(window), PSM_CHANGED, 0, 0);
}

WCHAR *MirandaDialog::Hlp_GetDlgItemText(HWND hwndDlg, int nIDDlgItem) {

	int len = SendDlgItemMessage(hwndDlg, nIDDlgItem, WM_GETTEXTLENGTH, 0, 0);
	if (len < 0)
		return nullptr;

	WCHAR *res = (WCHAR*)mir_alloc((len+1)*sizeof(WCHAR));
	memset(res, 0, ((len + 1) * sizeof(WCHAR)));
	GetDlgItemText(hwndDlg, nIDDlgItem, res, len+1);

	return res;
}

int MirandaDialog::ImageList_AddIcon_IconLibLoaded(HIMAGELIST hIml, int iconId)
{
	HICON hIcon = Skin_LoadIcon(iconId);
	int res = ImageList_AddIcon(hIml, hIcon);
	IcoLib_ReleaseIcon(hIcon);
	return res;
}