|
Is an edit control in an HTML page displayed in a browser the same as a CEdit ? If so, is it possible to get the HWND of the one with focus, if I know the HWND of the IE instance (i.e. the Internet Explorer_Server window hosted in IE)?
(I'm trying to figure out how to programatically paste content into the currently selected edit field in an HTML page.)
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
u can use EnumWindows() to get HWND of any windows, but i think you can not replace text on html page, SetWindowTest() is not available except you just need plain text (no colors, fonts etc). to do that, your program must have rights to access IE - only IE itself has rights (same thread) to do that.
includeh10
|
|
|
|
|
Actually you can modify the text of a window belonging to a separate thread by using a hook - this[^] article showed me how to do it. So my problem has boiled down to finding the target window handle.
[edit]
Btw, I don't want to change the HTML - I want to paste text into (the currently selected) edit control on an HTML page.
[/edit]
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
it will cause big trouble, if u don't beleive, u can try
includeh10
|
|
|
|
|
I pasted the text into the clipboard and fired a Ctrl/V to IE. Works great! (I'm not sending a WM_SETTEXT ).
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
Ravi Bhavnani wrote:
Is an edit control in an HTML page displayed in a browser the same as a CEdit?
Hi Ravi,
I don't think so. I doubt it is a window. You can enumerate the DOM to find the html element then use something like PutinnerHTML(). Have a look at IEHelper here on CP. If you need more help just let me know.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Thanks, Neville! What I really wanted to do was to paste text into the currently highlighted edit control of the active app. Temporarily copying text to the clipboard a firing a Ctrl/V at the active app seems to do it!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Aha, I was wondering how SendKeys was the answer. Now I know. You should still be able to all of this working directly with the MSHTML control. As I said if you need any more help let me know.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
|
I think you need a DHTMLView to view your HTML and through the DHTMLView expose functions which could access the object of your HTML.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Anthony_Yio wrote:
I think you need a DHTMLView to view your HTML
No - what I wanted to do was to paste text into the currently selected edit control in an IE page. As you can see from my previous notes, I was able to do this thanks to an article on CP.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
How do I do that? I do this:
szText += m_xTextBuffer.GetLineChars(nLine);
szText += "\r\n";
which produces the funny stuff. When I add in a null character at the end, i.e.
szText += m_xTextBuffer.GetLineChars(nLine);
szText += "\0";
szText += "\r\n";
szText += "\0";
the funny stuff remains. What am I doing wrong. Heeeeeeeeeeeeeeeeeeeeeelp...
|
|
|
|
|
As another reply states please post you 'full' code, this looks totally wrong! But I could be wrong
"Laughing at our mistakes can lengthen our own life. Laughing at someone else's can shorten it."
- Cullen Hightower
|
|
|
|
|
What datatype is m_xTextBuffer ?
From experience, there is nothing wrong with the method of concatenating strings that you are using. I suspect, however, that m_xTextBuffer.GetLineChars(nLine) is not returning a NULL terminated string.
I Dream of Absolute Zero
|
|
|
|
|
m_xTextBuffer is an instance of CCrystalTextBuffer. GetLineChars() returns LPTSTR or a pointer to TCHAR.
|
|
|
|
|
what is szText declared as? If it is CString then OK if it is char* then it won't work
If all else fails use the debugger and step through each line until szText becomes corrupted.
"Laughing at our mistakes can lengthen our own life. Laughing at someone else's can shorten it."
- Cullen Hightower
|
|
|
|
|
|
Well, its nice you figured it out. But dont you think you ought to share it?
I mean, all these people helping you, and all you say is "Thanks - figured it out." ???
Bikram Singh
|
|
|
|
|
I am having major problems adding strings to the end of a CString with +=. Instead of just copying in the text I get a load of ganumph at the end of the string I don't want - e.g. here is one line of text that was produced - ÍÍÍÍÍÍÍÍÍÍýýýý««««««««îþîþ. Why do I get all this rubbish at the end? How do I get rid of it?
|
|
|
|
|
Is the string you are adding NULL terminated? as a test set the last location of the string you are adding to NULL
"Laughing at our mistakes can lengthen our own life. Laughing at someone else's can shorten it."
- Cullen Hightower
|
|
|
|
|
Post an example including the declaration, instantiation, and concatenation of the CString object.
Kuphryn
|
|
|
|
|
problem is in your code somewhere, CString is OK.
only thing which may cause trouble is operator = of CString
cheers
includeh10
|
|
|
|
|
hain i didn't think soo.
i know csting is most persistent calss in vc++.
pls give me your exact problem i will see to it and post reply thanks
I Think It will Work
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
the problem is usually called mapping macromolecular topography
I got a file of a set of coordinate in 3 dimensions that form
any shape possible. The coordinate are the coordinate of amino acids that constitute a protein.
I need to extract the coordinate that constitute the surface of the shape
I ve got no idea how to start
If someone could help me it would be great
thanks for every idea
xc
|
|
|
|