Paste Fails while the dialog is open because the dialog is the active window. But once the dialog closes , notepad is the active window again so paste works.
the variable makes no difference. It's because notepad is not the active window. Yes paste needs an active window. Need to get the handle of notepad and make sure it is the active window before using paste.
You could use other commands such as setwintext which can set text to a background window. also can use setsel
once you click the button on the dialog window even the dialog control loses focus and has no caret. Because the focus has been moved to the button.
the variable makes no difference. It's because notepad is not the active window. Yes paste needs an active window. Need to get the handle of notepad and make sure it is the active window before using paste.
You could use other commands such as setwintext which can set text to a background window. also can use setsel
once you click the button on the dialog window even the dialog control loses focus and has no caret. Because the focus has been moved to the button.