开发者

Custom Message Box: Windows' "Move Cursor to Default Button" Feature

In Microsoft Windows, there is a (highly useful) feature that automatically moves the cursor to the default button of a modal dialog box (activated in Win+R, "control mouse").

Now I have created a custom dialog box in Delphi (basically a TForm), see below.

开发者_JS百科

Custom Message Box: Windows' "Move Cursor to Default Button" Feature

(source: rejbrand.se)

But, quite naturally, the cursor does not automatically move to the default button ("Yes" in this case), even though the feature is turned on in "control mouse".

How to implement this feature using Windows API? I guess it would be sufficient to obtain the settings as a boolean (true if feature activated, false if not), and then simply move the cursor programmatically using SetCursorPos if true. But how to obtain this setting?


Call SystemParametersInfo() with SPI_GETSNAPTODEFBUTTON

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜