summaryrefslogtreecommitdiff
path: root/protocols/Xfire/src/setnickname.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-11-05 21:11:48 +0000
committerRobert Pösel <robyer@seznam.cz>2012-11-05 21:11:48 +0000
commit048aaf0c4e77402adf584e3318e5aae6f1cdd749 (patch)
treedef343da80e282ae43164e45e672a1386db66546 /protocols/Xfire/src/setnickname.cpp
parent35a9af527f9b7ec35e81455784cd0a795be910c5 (diff)
XFire adoption (crashes on login, no 64bit)
git-svn-id: http://svn.miranda-ng.org/main/trunk@2212 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Xfire/src/setnickname.cpp')
-rw-r--r--protocols/Xfire/src/setnickname.cpp46
1 files changed, 46 insertions, 0 deletions
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