From 048aaf0c4e77402adf584e3318e5aae6f1cdd749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Mon, 5 Nov 2012 21:11:48 +0000 Subject: XFire adoption (crashes on login, no 64bit) git-svn-id: http://svn.miranda-ng.org/main/trunk@2212 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Xfire/src/setnickname.cpp | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 protocols/Xfire/src/setnickname.cpp (limited to 'protocols/Xfire/src/setnickname.cpp') diff --git a/protocols/Xfire/src/setnickname.cpp b/protocols/Xfire/src/setnickname.cpp new file mode 100644 index 0000000000..2062c2f487 --- /dev/null +++ b/protocols/Xfire/src/setnickname.cpp @@ -0,0 +1,46 @@ +//fürs nick - dialog + +#include "stdafx.h" +#include "setnickname.h" + +BOOL CALLBACK DlgNickProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) + { + case WM_INITDIALOG: + { + TranslateDialogDefault(hwndDlg); + SendMessage(hwndDlg,WM_SETICON, (WPARAM)false, (LPARAM)LoadIcon(hinstance, MAKEINTRESOURCE(IDI_TM))); + + DBVARIANT dbv; + if(!DBGetContactSetting(NULL,protocolname,"Nick",&dbv)) { + SetDlgItemText(hwndDlg,IDC_NICKNAME,dbv.pszVal); + DBFreeVariant(&dbv); + } + return TRUE; + } + case WM_COMMAND: + { + if(LOWORD(wParam) == IDOK) + { + char nick[255]; + GetDlgItemText(hwndDlg,IDC_NICKNAME,nick,sizeof(nick)); + + CallService(XFIRE_SET_NICK,0,(LPARAM)nick); + + EndDialog(hwndDlg,TRUE); + return TRUE; + } + else if(LOWORD(wParam) == IDCANCEL) + { + EndDialog(hwndDlg,FALSE); + return FALSE; + } + } + } + return FALSE; +} + +BOOL ShowSetNick() { + return DialogBox(hinstance,MAKEINTRESOURCE(IDD_SETNICKNAME),NULL,DlgNickProc); +} \ No newline at end of file -- cgit v1.2.3