A1VBCode Forums

getting text from another program


http://www.a1vbcode.com/vbforums/Topic20022.aspx

By bwarn70 - 9/2/2006

I am coding in vb2005... I am trying to create an interface between two programs (an accounting program & an imaging program).  What I want to happen... select item (text) in accounting program and then by pressing a hotkey, pass the text to the imaging program to run a search.  I started out trying to use sendmessage api and found that in VB i was having problems due to not being able to create pointers for the call.  I am now thinking that the best way to get the text from the accounting program may be through the Microsoft Active Accessibility but am having trouble finding any documentation on how to use it.  And maybe this isn't the best approach either.  Any help and input would be greatly appreciated.

Tasks:
1 - hotkey creation & responce - DONE
2 - Get selected text from syslistview in accounting software
 2a - Get hWnd for syslistview - DONE
 2b - Get index of selected item - DONE
 2c - Get text of selected item - PROBLEM
3 - Pass text into imaging software to run search - DONE

By Gopinath.Karyadath Panangad - 3/3/2007

Hai



you can sendmessage API function for this Prblm.



Sendmessage text1.hwnd,WM_SETTEXT,textstring,0&

for setting text in TextBox



Sendmessage texthwnd,WM_GETTEXT,textstring,0&



forgsetting text from TextBox





OR try to subclassing the textBox handle



for more about subclassing windows plse mail me.



regards



Gopinath ( softact@rediffmail.com )