Reading Crystal Text from code window - TechRepublic
Question
April 19, 2010 at 12:50 PM
slayer_

Reading Crystal Text from code window

by slayer_ . Updated 16 years, 2 months ago

In our older version of Crystal, there is no way to block comment out code. So me and co-worker wrote short program that would read what is on the clipboard, comment it out and SendKeys(“^v”) it back to the active window.

Everything on it works, except one thing, there seems to be no good way to automate the getting of the text. SendKeys(“^c”) and Sendkeys(“^{Insert}”) does not work. Nor does Getting the foreground window (GetForgroundWindow) and reading the first imbedded Window, which appears to be the Edit field. If I sendmessage(h1, WM_Copy,0,sTemp) I get nothing. I also get nothing from a straight up GetText or GetWindowText. I have slightly more luck using rich text box messages but what I get is gibberish.

To Sum it up, Using Send keys for the Copy command does not work, and I cannot seem to use the API Messaging system to get the text. What else can we do?

This thing is made in VB6.

This discussion is locked

All Comments