1. Computing & Technology

Discuss in my forum

Zarko Gajic

Snap Mouse To The Default Button in a Dialog Box in Delphi Applications

By , About.com GuideDecember 19, 2011

Follow me on:

in Mouse Programming :: Unfortunately for your Delphi application users, the "move pointer to the default button in dialog boxes" feature is not handled by your Delphi application. The mouse pointer will not jump for Delphi dialog boxes like InputBox, MessageBox, ShowMessage or any custom made modal form / window. Here's a quick fix.

Read the full article to learn how to Correct the Snap-To Feature: Move Mouse Over the Default Dialog/Modal Window Button.

Related:

Comments
December 19, 2011 at 2:54 pm
(1) Leonardo Herrera says:

Please, PLEASE, don’t.

December 20, 2011 at 7:11 pm
(2) Phil says:

I tried this out in my Delphi XE Starter edition project and learned it make the cursor jump to the default button. Seems the conditions in the last “if” statement (if (fsModal in…) are never met so the 4 following lines are never executed. Outside of Delphi, my Windows Vista does enable the behavior so I don’t know what the problem is. Too bad, but I would have liked to implement this.

December 27, 2011 at 4:51 pm
(3) SeaCay says:

Too many users are trigger happy. They click on anything that accepts a mouse click without a second thought. Should the program design call for a conscious decision by a user, consider the merits, or absence of merits, before programmatically placing the mouse cursor over the default button.

December 28, 2011 at 4:27 am
(4) Zarko Gajic says:

@Leonardo, SeaCay: the code is here to only obey the Windows rule that the user might set if they prefer this way of working with dialog boxes – it will not force the behavior if the option is not set in Windows.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2012 About.com. All rights reserved.

A part of The New York Times Company.