🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.tools
Article #248

Re: How do you replace <Tab> with <Enter> in a Dialog box?

#248
From: Blake Coverett
Date: Thu, 13 Aug 1992 04:14
23 lines
1553 bytes
In article <190ad098@p11.f36.n245.z2.fidonet.org> Harald_Muehlhoff@softstream.fido.de (Harald Muehlhoff) writes:
>when the user is pressing <Enter> in a dialog box your dialog procedure 
>receives a WM_COMMAND message with IDOK in wParam.
>Just add a check at the beginning of your code handling IDOK that verifies 
>whether one of your edit controls still has the input focus. Then send your 
>dialog procedure an appropriate message to set the input focus to another edit 
>control.

This is not entirely correct.  The above will happen if you have no 
currently "default" button in the dialog box.  If you do have a default
button, it's ID will be sent in the WM_COMMAND message.

Probably the best way to enable <enter> to move to the next field is to
install a WH_MSGFILTER hook (see SetWindowsHook[Ex]) and use the 
WM_NEXTDLGCTL message.

As someone else already mentioned, this is however a poor thing to do
from a consistancy point of view.  

-Blake
-- 
#include <std/disclaimer.h>                       blakeco@microsoft.com
Mail Flames, Post Apologies.                      ...!uunet!microsoft!blakeco
Technical Details
Message-ID: <1992Aug13.041410.22554@microsoft.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!microsoft!hexnut!blakeco
References: <59158ee7@cis.uab.edu> <190ad098@p11.f36.n245.z2.fidonet.org>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.tools
Path: arc1-ca.pugleaf.net!sparky!uunet!microsoft!hexnut!blakeco
From: blakeco@microsoft.com (Blake Coverett)
Subject: Re: How do you replace <Tab> with <Enter> in a Dialog box?
Message-ID: <1992Aug13.041410.22554@microsoft.com>
Date: 13 Aug 92 04:14:10 GMT
Organization: Microsoft Canada Inc.
References: <59158ee7@cis.uab.edu> <190ad098@p11.f36.n245.z2.fidonet.org>
Lines: 23