Skip to content
Open
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@ public override void Flush()
// Get how many characters are in the Notepad editor after putting in new text
var textLengthAfter = User32.SendMessage(_currentNotepadEditorHandle, User32.WM_GETTEXTLENGTH, IntPtr.Zero, IntPtr.Zero);

// Determine if the write succeeded. This will break the loop.
succeeded = textLengthAfter != textLength;

// If no change in the text length, reset editor handle to try to find it again.
if (textLengthAfter == textLength)
if (!succeeded)
{
_currentNotepadEditorHandle = IntPtr.Zero;
attempts++;
Expand Down