🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #14472

Re: Disabling a dialog button results in lost characters.

#14472
From: Gary Setter
Date: Mon, 11 Aug 2003 19:13
27 lines
1890 bytes
<snip>
> So, when you Disable a window(button), No Other Window Gets the Focus!
> You Must SetFocus to another window(button) if you want to continue
> getting keyboard input.
<snip>

Thanks Bob,

That helped.
Could I ask your opinion on how to fix i? I wrote a DialogCls class as a
base for all my dialogs. It now has an EnableWindow function that checks for
disabling.

BOOL DialogCls::EnableWindow(HWND hWnd, bool enable)
{
 BOOL disabled = ::EnableWindow(hWnd, enable);
 if (!disabled && !enable && hWnd )
   SetFocus(GetParent(hWnd));
 return disabled;
}

This is what I used for enable/disabling controls.

Does it look sane to you? Is there a better way?

Thanks again,
Gary
Technical Details
Message-ID: <3f37eacf$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3f34ee12$1@newsgroups.borland.com> <3F370EB6.3DB6@uniserve.com> <3f37be6f@newsgroups.borland.com> <hahfjvojar7ujop8mujmipmqdae7n6326l@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,f7216d587ba9f99f
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-11 12:28:03 PST
From: "Gary Setter" <setterg@worldnet.att.net>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f34ee12$1@newsgroups.borland.com> <3F370EB6.3DB6@uniserve.com> <3f37be6f@newsgroups.borland.com> <hahfjvojar7ujop8mujmipmqdae7n6326l@4ax.com>
Subject: Re: Disabling a dialog button results in lost characters.
Date: Mon, 11 Aug 2003 14:13:02 -0500
Lines: 28
MIME-Version: 1.0
Content-Type: text/plain;
 charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 12.84.32.147
Message-ID: <3f37eacf$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1060629199 12.84.32.147 (11 Aug 2003 12:13:19 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail