rendered output
markdown
-1
votes
Comment: code alignment
Clear the text value in other App's edit control by using Excel VBA with Windows API
hTarget is a handle value of other application. [Failed]
- ret = SendMessage(hTarget, WM_SETFOCUS, 0&, 0&)
- ret = SendMessage(hTarget, WM_KEYDOWN, VK_CONTROL, 0) -ret = SendMessage(hTarget, WM_KEYDOWN, 97, 0)
- ret = SendMessage(hTarget, WM_KEYDOWN, VK_DELETE, 0)
- Sleep (300)
- ret = SendMessage(hTarget, WM_KEYUP, VK_DELETE, 0)
- ret = SendMessage(hTarget, WM_KEYUP, 97, 0) -ret = SendMessage(hTarget, WM_KEYUP, VK_CONTROL, 0)
[Failed]
-Const EM_SETSEL = &HB1
-Const EM_REPLACESEL = &HC2
-Const EM_GETSEL = &HB0
-hTarget = FindWindowEx(hTarget, 0&, "TPlusMemoU", vbNullString)
-Call SendMessage(hTarget, EM_SETSEL, 0, -1)
-Call SendMessage(hTarget, EM_REPLACESEL, 1, "")
[Failed]
-Call SendMessage(hTarget, WM_KEYDOWN, VK_BACK, 0)
-Call SendMessage(hTarget, WM_CHAR, 8, 0)
hTarget is a handle value of other application.
[Failed]
ret = SendMessage(hTarget, WM_SETFOCUS, 0&, 0&)
ret = SendMessage(hTarget, WM_KEYDOWN, VK_CONTROL, 0)
ret = SendMessage(hTarget, WM_KEYDOWN, 97, 0)
ret = SendMessage(hTarget, WM_KEYDOWN, VK_DELETE, 0)
Sleep (300)
ret = SendMessage(hTarget, WM_KEYUP, VK_DELETE, 0)
ret = SendMessage(hTarget, WM_KEYUP, 97, 0)
ret = SendMessage(hTarget, WM_KEYUP, VK_CONTROL, 0)
[Failed] Const EM_SETSEL = &HB1
Const EM_REPLACESEL = &HC2 Const EM_GETSEL = &HB0
hTarget = FindWindowEx(hTarget, 0&, "TPlusMemoU", vbNullString)
Call SendMessage(hTarget, EM_SETSEL, 0, -1) Call SendMessage(hTarget, EM_REPLACESEL, 1, "")
[Failed] Call SendMessage(hTarget, WM_KEYDOWN, VK_BACK, 0) Call SendMessage(hTarget, WM_CHAR, 8, 0)