Win32 , C++

윈도 표준 로그인 다이얼로그 표시

김모작자 2007. 5. 16. 18:47
실제 표시되는 다이얼로그


CredUIPromptForCredentials - creates and displays a configurable dialog box that accepts credentials information from a user.

예)

#include <WinCred.h>
#pragma comment(lib, "Credui.lib")

...
       TCHAR name[100] = _T("화면에 미리 표시될 이름");
       TCHAR passwd[100] = _T("화면에 미리 표시될 비밀번호");
       BOOL save = FALSE;

       CREDUI_INFO info;
       info.cbSize = sizeof(CREDUI_INFO);
       info.hwndParent = NULL;
       info.pszCaptionText = _T("제목!");
       info.pszMessageText = _T("물어볼 메세지");
       info.hbmBanner = NULL;

       DWORD v = CredUIPromptForCredentials(&info, _T("."), NULL, 0, name, 99, passwd, 99, &save, 0);

리턴된 v 가 NO_ERROR 인 경우 name, passwd 에 해당 ID, 비밀번호가 들어가 있다