summaryrefslogtreecommitdiff
path: root/protocols/Xfire/src/passworddialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Xfire/src/passworddialog.cpp')
-rw-r--r--protocols/Xfire/src/passworddialog.cpp29
1 files changed, 9 insertions, 20 deletions
diff --git a/protocols/Xfire/src/passworddialog.cpp b/protocols/Xfire/src/passworddialog.cpp
index fac061f214..bef0abd9c7 100644
--- a/protocols/Xfire/src/passworddialog.cpp
+++ b/protocols/Xfire/src/passworddialog.cpp
@@ -6,21 +6,18 @@
static char nick[255];
BOOL usenick = FALSE;
-INT_PTR CALLBACK DlgPWProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgPWProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM)
{
static char* pw[255];
- switch (msg)
- {
+ switch (msg) {
case WM_CLOSE:
- {
GetDlgItemTextA(hwndDlg, IDC_PWSTRING, (LPSTR)pw, 254);
if (usenick)
GetDlgItemTextA(hwndDlg, IDC_PWNICK, (LPSTR)nick, _countof(nick));
EndDialog(hwndDlg, (INT_PTR)pw);
break;
- }
+
case WM_INITDIALOG:
- {
TranslateDialogDefault(hwndDlg);
//passwort und nick leeren
pw[0] = 0;
@@ -30,30 +27,22 @@ INT_PTR CALLBACK DlgPWProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
EnableWindow(GetDlgItem(hwndDlg, IDC_PWNICK), FALSE);
return TRUE;
- }
+
case WM_COMMAND:
- {
if (LOWORD(wParam) == IDC_BTN4) {
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
}
break;
}
- }
return FALSE;
}
-void ShowPasswordDialog(char*pw, char*mynick) {
- if (mynick != NULL)
- {
- usenick = TRUE;
- }
- else
- usenick = FALSE;
+void ShowPasswordDialog(char*pw, char*mynick)
+{
+ usenick = (mynick != NULL);
- char* npw = (char*)DialogBox(hinstance, MAKEINTRESOURCE(IDD_PWDLG), NULL, DlgPWProc);
+ char *npw = (char*)DialogBox(hinstance, MAKEINTRESOURCE(IDD_PWDLG), NULL, DlgPWProc);
mir_strcpy(pw, npw);
if (mynick)
- {
mir_strcpy(mynick, (char*)nick);
- }
-} \ No newline at end of file
+}