5 ms·
Just looking at the messages received, it looks like they're triggering off a few different things to fall into the code path that looks for changes (the missin
by banana_giraffe 6y ago
Just looking at the messages received, it looks like they're triggering off a few different things to fall into the code path that looks for changes (the missing numbers are due to me deleting uninteresting messages):
<00133> 002A1272 P WM_KEYDOWN nVirtKey:VK_DELETE cRepeat:1 ScanCode:53 fExtended:1 fAltDown:0 fRepeat:0 fUp:0
<00150> 002A1272 S EM_POSFROMCHAR wCharIndex:0
<00152> 004E0A18 S WM_COMMAND wNotifyCode:EN_CHANGE wID:15 hwndCtl:002A1272
<00154> 002A1272 P WM_KEYUP nVirtKey:VK_DELETE cRepeat:1 ScanCode:53 fExtended:1 fAltDown:0 fRepeat:1 fUp:1
<00155> 002A1272 P WM_KEYDOWN nVirtKey:VK_RIGHT cRepeat:1 ScanCode:4D fExtended:1 fAltDown:0 fRepeat:0 fUp:0
<00174> 002A1272 S EM_POSFROMCHAR wCharIndex:1
<00182> 002A1272 S EM_GETMODIFY
<00184> 004E0A18 S WM_SETTEXT lpsz:02EDCAF8 ("*Example.txt- Notepad")
The one that seems to get triggered the most, indeed the one triggering it here, is the code path that also updates the position indicator, hence why Del isn't doing anything. Interestingly enough, they seem to be ignoring the EN_CHANGE message, and instead looking for changes explicitly after some events. Given the long history of Notepad, I'm sure there's some historical reason for that.
They do seem to be covering the bases checking for changes before anything that might lose data, like any path I can find to close the window, so it's a minor bug. They also check for changes on each and every mouse move message, so I think for most users, this state won't last long.
- tyingq 6y agoAh, yes...that's what I was getting at. Notepad is mostly a wrapper around a rich edit control, and rich edit controls already emit "EN_CHANGE" when the content changes. So I suppose this must be some historical thing where an earlier version of notepad didn't have something like that to tee into.
- Stratoscope 6y agoNotepad is a wrapper around a plain text control. WordPad is a wrapper around a rich text control.
- tyingq 6y agoAh, yes, thanks. Though it's still the same EN_CHANGE event.