I believe this is a windows bug. I don't know if it is specific to XP. Please try the following test. Do you get the same results as I do?
1. Run the reproducer
2. Wait one second and then type some text,
3. Press Ctrl+Z
My Results:
At first you see 0x0045. This is replaced with the letter E ==> ChrW(0x0045)
If you now type the letter A, the result should be AE
Pressing Ctrl+Z does not revert to an earlier rendering.
Instead the result will be 0x0045E. This is not a successful undo operation.
1. Run the reproducer
2. Wait one second and then type some text,
3. Press Ctrl+Z
[ autoit ]
#include <GuiEdit.au3> #include <GuiConstantsEx.au3> _Reproducer() Func _Reproducer() Local $hGUI, $hEdit $hGUI = GUICreate("Edit Create", 400, 300) $hEdit = _GUICtrlEdit_Create($hGUI, "0x0045", 2, 2, 394, 268) ;$hEdit = GUICtrlCreateEdit("0x8345", 2, 2, 394, 268) ; Native function GUISetState() Sleep(1000) ; Please wait _GUICtrlEdit_ReplaceSel($hEdit,ChrW(0x0045)) _GUICtrlEdit_SetSel($hEdit, 0, 0) ; Position to start typing Do ; Type something ; Press Ctrl+Z Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Reproducer
My Results:
At first you see 0x0045. This is replaced with the letter E ==> ChrW(0x0045)
If you now type the letter A, the result should be AE
Pressing Ctrl+Z does not revert to an earlier rendering.
Instead the result will be 0x0045E. This is not a successful undo operation.