闪烁Carets显示在多个身份验证窗口中。 [英] Blinking Carets shown in multiple authentication windows.

查看:78
本文介绍了闪烁Carets显示在多个身份验证窗口中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当系统退出睡眠状态时,我的应用程序会弹出一个验证窗口(带有用户名和密码字段)。有时,即使弹出窗口处于非活动状态(即未对焦),也会显示插入符号,当我在键盘上键入时,字符会转到
到另一个窗口(如IM)。这可能导致用户在不知情的情况下在IM中输入密码(当然,如果他不注意的话)

My application pops up an authentication window (with username and password field) when the system comes out of sleep. Sometimes, the caret is displayed even if the pop-up window is inactive (ie not in focus) and when I type on the keyboard, characters go to a different window (like IM). This may result in user typing his password in IM unknowingly (ofcourse if he is not  paying attention)

当网络共享身份验证窗口弹出时,我也观察到了这一点。例如,当我搜索"开始"时菜单,弹出网络共享验证窗口,并在搜索栏和弹出窗口中显示插入符号。
问题不是我的应用程序特有的。

I have also observed this when a network-share authentication window pops up. Example, when I am searching the "start" menu, a network-share authentication window pops up and the caret is displayed in the search-bar and also the popup window. The problem is not specific to my application.

据我所知,只应显示一个插入符号(即只有具有焦点的活动窗口)。这是Windows中的错误吗?

As far as I know, only one caret should be displayed (i.e only by the active window with focus). Is this a bug in windows?

问候,

Kunal

推荐答案

Hi Kunal,

Hi Kunal,

根据CreateCaret()的文档,windows为一个Windows消息队列提供了一个插入符号。应用程序有责任仅在其窗口处于活动状态或焦点时显示插入符号。请参阅以下链接:

As per the documentation of CreateCaret(), windows provides one caret for one windows message queue. It's the applications responsibility to show the caret only when its window is active or in focus. Please see the below link:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms648399(v = vs.85).aspx

在您的情况下,您应检查您的窗口是否具有焦点或是否处于活动状态。 GetFocus()和GetActiveWindow()的组合应该可以解决问题。

In your case, you should check if your window has focus or is active. A combination of GetFocus() and GetActiveWindow() should do the trick.

希望有所帮助。

(如果它解决了您的问题,请标记为答案。如果这篇文章有用,请提前注册。)

(Please mark as answer if it resolves your query. Please upvote if this post is helpful.)

问候,

Rajesh


这篇关于闪烁Carets显示在多个身份验证窗口中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆