Credential Provider增加一个输入密码的编辑框

sdex325516 2010-09-28 11:11:26
我希望增加一个输入密码的编辑框,要与SERVER做认证用
以下是我修改微软提供的五个示例程序的SampleCredUICredentialProvider中的common.h,//ADD为我新增的

#pragma once
#include <credentialprovider.h>
#include <ntsecapi.h>
#define SECURITY_WIN32
#include <security.h>
#include <intsafe.h>

#define MAX_ULONG ((ULONG)(-1))

// The indexes of each of the fields in our credential provider's tiles.
enum SAMPLE_FIELD_ID
{
SFI_TILEIMAGE = 0,
SFI_USERNAME = 1,
SFI_PASSWORD = 2,
SFI_SBOX = 3, //ADD
SFI_SUBMIT_BUTTON = 4,
SFI_NUM_FIELDS = 5, // Note: if new fields are added, keep NUM_FIELDS last. This is used as a count of the number of fields
};

// The first value indicates when the tile is displayed (selected, not selected)
// the second indicates things like whether the field is enabled, whether it has key focus, etc.
struct FIELD_STATE_PAIR
{
CREDENTIAL_PROVIDER_FIELD_STATE cpfs;
CREDENTIAL_PROVIDER_FIELD_INTERACTIVE_STATE cpfis;
};

// These two arrays are seperate because a credential provider might
// want to set up a credential with various combinations of field state pairs
// and field descriptors.

// The field state value indicates whether the field is displayed
// in the selected tile, the deselected tile, or both.
// The Field interactive state indicates when
static const FIELD_STATE_PAIR s_rgFieldStatePairs[] =
{
{ CPFS_DISPLAY_IN_BOTH, CPFIS_NONE }, // SFI_TILEIMAGE
{ CPFS_DISPLAY_IN_BOTH, CPFIS_NONE }, // SFI_USERNAME
{ CPFS_DISPLAY_IN_SELECTED_TILE, CPFIS_FOCUSED }, // SFI_PASSWORD
{ CPFS_DISPLAY_IN_SELECTED_TILE, CPFIS_NONE }, // SFI_SUBMIT_BUTTON
};

// Field descriptors for unlock and logon.
// The first field is the index of the field.
// The second is the type of the field.
// The third is the name of the field, NOT the value which will appear in the field.
static const CREDENTIAL_PROVIDER_FIELD_DESCRIPTOR s_rgCredProvFieldDescriptors[] =
{
{ SFI_TILEIMAGE, CPFT_TILE_IMAGE, L"Image" },
{ SFI_USERNAME, CPFT_LARGE_TEXT, L"Username" },
{ SFI_PASSWORD, CPFT_PASSWORD_TEXT, L"Password" },
{ SFI_SBOX, CPFT_PASSWORD_TEXT, L"SBOX" }, //ADD
{ SFI_SUBMIT_BUTTON, CPFT_SUBMIT_BUTTON, L"Submit" },
};

因为我是初学者,希望有高手可以替我说明一下,我接下来该如何做吗?
...全文
217 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

3,245

社区成员

发帖
与我相关
我的任务
社区描述
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
社区管理员
  • ATL/ActiveX/COM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧