diff options
Diffstat (limited to 'plugins/!NotAdopted/Xfire/xfiretest/setnickname.cpp')
-rw-r--r-- | plugins/!NotAdopted/Xfire/xfiretest/setnickname.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/plugins/!NotAdopted/Xfire/xfiretest/setnickname.cpp b/plugins/!NotAdopted/Xfire/xfiretest/setnickname.cpp new file mode 100644 index 0000000000..2062c2f487 --- /dev/null +++ b/plugins/!NotAdopted/Xfire/xfiretest/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 |