Re: edit box population in a dialog box
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Thu, 21 Aug 2008 15:15:44 -0400
See below...
On Wed, 20 Aug 2008 22:30:48 -0700 (PDT), "bwaichu@xxxxxxxxx" <bwaichu@xxxxxxxxx> wrote:
On Aug 20, 8:08 pm, Joseph M. Newcomer <newco...@xxxxxxxxxxxx> wrote:****
Are you talking about assembly code? Is there a meaningful purpose to this, or do you
just enjoy being miserable?
There is a cult about programming Windows in assembly code; it is precisely that, a cult.
Brainwashing is the only reason I've figured out that anyone would think that programming
in assembly code in 2008 could possibly make sense.
WM_COMMAND/EN_CHANGE tells you if the contents of an edit control have changed. Whether
or not this change means it is "populated" is up to you. WM_GETTEXT, strip leading and
trailing spaces, would be a good start.
joe
Thanks. I got it to work. I still need to tweak the code some, but
it works. Here's my approach:
* wait for WM_COMMAND
* check for EN_CHANGE notification
* if EN_CHANGE notification, I check what caused it
* send a message to get the length (WM_GETTEXTLENGTH)
* if the length is greater or equal to one, I enable the button,
otherwise I disable it
So if I type a space, you enable the button, even though the contents may be nonsensical
because there is actually nothing there?
****
*****
I have one problem though. Every time a change occurs to the edit
box, I check to
see the length of the item in the edit box. I wonder if there is a
more elegant way to
this.
No. It is the only correct and possible way to do it. There is no need to look at the
control unless it tells you it changed.
I would use WM_GETTEXT and strip leading and trailing spaces off to make sure I had
content.
*****
*****
Tweaking the bits was a challenge as well. I need to experiment with
some
better ways to test for EN_CHANGE.
Have you considered writing in a modern language like C++/MFC? What, exactly, favors the
1950s model of programming?
joe
*****
.
Thanks again.
- Follow-Ups:
- Re: edit box population in a dialog box
- From: bwaichu@xxxxxxxxx
- Re: edit box population in a dialog box
- References:
- Re: edit box population in a dialog box
- From: bwaichu@xxxxxxxxx
- Re: edit box population in a dialog box
- Prev by Date: Why does my transparent bitmap get overwritten?
- Next by Date: Re: Why does my transparent bitmap get overwritten?
- Previous by thread: Re: edit box population in a dialog box
- Next by thread: Re: edit box population in a dialog box
- Index(es):
Relevant Pages
|