Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SendMessage(WM_GETTEXT)

Status
Not open for further replies.

tcowan

Programmer
Jan 27, 2005
1
0
0
US
First off, I'm new to VBScript.

I'm would like to be able to call SendMessage(handle, WM_GETTEXT, wParam, lParam)

However, lParam is defined as a pointer to a text buffer where the resulting text is placed. Am I correct in thinking that there is no way to do this in VBScript?

Thanks.
 
Why don't you use CDOSYS? Comes with Win2k and above.

I believe the SendMessage() is a Win32 API call..

Just a thought. Search here for "CDOSYS" or same on one of the bigger net search sites... Couple that with vbscript and you should find more than enough examples.

HTH.
Dougc
 
CDO is email related. Windows messages are something else entirely. See for example.

But it is true that Windows Script engines (VBScript, JScript) and common script hosts (WSH, IE) do not offer any interface to Windows APIs.

You'd need to write an ActiveX component to perform this action, then invole it and call the appropriate method from your script. VB5CCE or better can be used for this.
 
*sigh*

Where I wrote "invole" I meant "invoke" - and should have said "instantiate" in the first place. Sorry.
 
Hello,

I haven't tried this but you might try using the GetRef function in combination with the Rundll32.exe. From what I understand GetRef will return the address of an object, which should give you the pointer. Then you might be able to use the pointer to call rundll32 with sendmessage as a parameter. I have never even tried to experiment with this stuff.

Good Luck,

Pozitron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top