cpdlink
August 11th, 2006, 08:47 AM
hello everybody,
i am trying to write a few characters into a vb texbox using the code below:
local h_parent = win.FindWindow("ThunderFormDC", "MessageReceiver");
local h_child = win.FindWindowEx(h_parent, nil,"ThunderTextBox", nil);
local msg = 'abc123'
print(h_parent .. ' - ' .. h_child);
win.SendMessage(h_child, win.WM_SETTEXT, 0, msg);
and it doesn't work - the error is:
"parameter 4 must be a number or nil, not a string"
same thing works from an other vb application:
parent = FindWindow("ThunderFormDC", "MessageReceiver")
child = FindWindowEx(h_parent, ByVal 0&, "ThunderTextBox", vbNullString)
sMsg = "abc123"
Debug.Print h_parent & " - " & h_child
SendMessage h_child, WM_SETTEXT, 0&, ByVal sMsg
can anybody tell me how to do this using sendmessage (sendkeys is not a reliable solution - sometimes it works, sometimes it doesn't)
any help would be greatly appreciated
thanks,
chris
i am trying to write a few characters into a vb texbox using the code below:
local h_parent = win.FindWindow("ThunderFormDC", "MessageReceiver");
local h_child = win.FindWindowEx(h_parent, nil,"ThunderTextBox", nil);
local msg = 'abc123'
print(h_parent .. ' - ' .. h_child);
win.SendMessage(h_child, win.WM_SETTEXT, 0, msg);
and it doesn't work - the error is:
"parameter 4 must be a number or nil, not a string"
same thing works from an other vb application:
parent = FindWindow("ThunderFormDC", "MessageReceiver")
child = FindWindowEx(h_parent, ByVal 0&, "ThunderTextBox", vbNullString)
sMsg = "abc123"
Debug.Print h_parent & " - " & h_child
SendMessage h_child, WM_SETTEXT, 0&, ByVal sMsg
can anybody tell me how to do this using sendmessage (sendkeys is not a reliable solution - sometimes it works, sometimes it doesn't)
any help would be greatly appreciated
thanks,
chris