winapi - Clear the text value in other App's edit control by using Excel VBA with Windows API -
rendered output
markdown
-1
votes
comment: code alignment
clear text value in other app's edit control using excel vba windows api
htarget 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 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)
you can't. specs areprevented fropm getting text process's edit control.
getwindowtext function
the getwindowtext function copies text of specified window's title bar (if has one) buffer. if specified window control, text of control copied. however, getwindowtext cannot retrieve text of control in application.
Comments
Post a Comment