如何在vc中隐藏Windows 7切换用户按钮++凭证提供者示例
我提供了我的屏幕截图
CredentialProvider
窗口。在这个 窗口现在一切都很好但是我 不想显示切换用户
按钮给用户。我该怎么办 这。我正在编辑Win-7 SDKCredentialProvider
的示例 (C++)。任何人都可以帮助我,或者任何人 代码帮助链接。我还想问的一件事是,默认情况下,用户名文本框以灰色显示
EditText
。我如何将其更改为用户名
文本。我可以在SHStrDupW(L"", &_rgFieldStrings[SFI_EDIT_TEXT]);
代码中设置文本,但它不在背景文本中设置。有什么办法可以解决这个问题吗?
感谢SO成员
I have provided a screenshot of my
CredentialProvider
window. In this
window everything is fine now but i
don't want to showSwitch User
button to the user. How i can do
this. I am just editing Win-7 SDK
sample forCredentialProvider
(C++). Anyone can help me, or any
link for code help.One more thing I want to ask is by default, the username text box displaying
EditText
in grey color. How i could change it toUsername
text. I can set text inSHStrDupW(L"", &_rgFieldStrings[SFI_EDIT_TEXT]);
code but its not setting in background text. is there any hack for this.
Thanks SO members
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您无法直接阻止“切换用户”按钮的出现;如果存在导致它出现的条件,那么它就会出现。但是,您可以做什么:防止导致其出现的条件。
当图块处于选定状态且 1.) 您的凭据提供程序正在枚举选定图块之外的图块,或 2.) 其他凭据提供程序正在枚举图块时,会出现该按钮。
第一个条件很容易预防:在 GetCredentialCount() 中,始终报告您将仅枚举一个凭证。 (这当然意味着您必须构建磁贴来处理所有用户。)
为了防止第二种情况,您必须实现凭据提供程序过滤器。 (如果您不知道“ICredentialProviderFilter”接口是什么,请搜索该接口。)
祝您好运。
You cannot directly prevent the Switch User button from appearing; if the conditions are present that cause it to appear, then it's going to appear. What you can do however: prevent the conditions that cause it to appear.
That button appears either when a tile is in the selected state and 1.) your credential provider is enumerating tiles other than the one that is selected, or 2.) other credential providers are enumerating tiles.
The first condition is easy to prevent: In GetCredentialCount(), always report that you will enumerate only one credential. (This means of course that you must structure the tile to handle all users.)
To prevent the second condition, you will have to implement a credential provider filter. (Search for the "ICredentialProviderFilter" interface if you don't know what that is.)
Good luck.
回答问题 2:
用户名文本框以灰色显示 EditText。您可以将其更改为用户名文本。 来设置文本
您可以使用查看common.h
,在那里您会发现如果您将此编辑文本更改为用户名,那么它将显示在您的文本框中。
To answer question 2:
The username text box is displaying EditText in grey color. You can change it to Username text. You set text using
Have a look at common.h, there you'll find
If you change this Edit Text to UserName then it will show in your Text Box.