Re: edit box population in a dialog box

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.
.



Relevant Pages

  • Job.
    ... This information talks about the goals of certain cult. ... It is possible to break free of cult abuse if a person is involved. ... people dealing with issues related to cult programming and becoming ...
    (sci.skeptic)
  • Re: edit box population in a dialog box
    ... A desire to learn assembly code is one thing, but trying to justify assembly code as being ... Windows doesn't have the equivalent of ksh. ... There are few programming languages ... more horrific, badly-designed, and destructively idiosyncratic than the various Unix shell ...
    (microsoft.public.win32.programmer.gdi)
  • Re: The Advantage of Macros
    ... and racial (programming language) attributes. ... Some people are pretty good at writing portable code. ... assembly code to see some prime examples. ...
    (alt.lang.asm)
  • Re: [RFC] Splitting kernel headers and deprecating __KERNEL__
    ... I just don't think your "contract" part has ... "contract programming", the same way there are the "extreme programming" ... I find this "Design by Contract" cult for object- ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)