added some PC-files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@862 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
54
lib/des/passwd_dlg.c
Normal file
54
lib/des/passwd_dlg.c
Normal file
@@ -0,0 +1,54 @@
|
||||
/* passwd_dlg.c - Dialog boxes for Windows95/NT
|
||||
* Author: J<>rgen Karlsson - d93-jka@nada.kth.se
|
||||
* Date: June 1996
|
||||
*/
|
||||
|
||||
#ifdef WIN32 /* Visual C++ 4.0 (Windows95/NT) */
|
||||
#include <Windows.h>
|
||||
#include "passwd_dlg.h"
|
||||
#include "Resource.h"
|
||||
#define passwdBufSZ 64
|
||||
|
||||
char passwd[passwdBufSZ];
|
||||
|
||||
BOOL CALLBACK pwd_dialog_proc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_COMMAND:
|
||||
switch(wParam)
|
||||
{
|
||||
case IDOK:
|
||||
if(!GetDlgItemText(hwndDlg,IDC_PASSWD_EDIT, passwd ,passwdBufSZ))
|
||||
EndDialog(hwndDlg, IDCANCEL);
|
||||
case IDCANCEL:
|
||||
EndDialog(hwndDlg, wParam);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* return 0 if ok, 1 otherwise */
|
||||
int pwd_dialog(char *buf, int size)
|
||||
{
|
||||
int i;
|
||||
HWND wnd = GetActiveWindow();
|
||||
HANDLE hInst = GetModuleHandle("des");
|
||||
switch(DialogBox(hInst,MAKEINTRESOURCE(IDD_PASSWD_DIALOG),wnd,pwd_dialog_proc))
|
||||
{
|
||||
case IDOK:
|
||||
strcpy(buf,passwd);
|
||||
for(i=0; passwd[i] != '\0'; i++) passwd[i] = '\0';
|
||||
return 0;
|
||||
case IDCANCEL:
|
||||
default:
|
||||
for(i=0; passwd[i] != '\0'; i++) passwd[i] = '\0';
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* WIN32 */
|
Reference in New Issue
Block a user