|
its very strange, but i had the experience that reading images from files gets VERY slow the first time, when the path is longer than 30 characters. Just keep the path and the filename short. It took me more than a week to find that out....
thx, Daniel
|
|
|
|
|
I wanna scroll page that is made by HTML control
for example..down 1 line or down 1 page...
How do I can be?..
|
|
|
|
|
::SendMessage(hwnd,WM_VSCROLL,SB_PAGEUP, 0); //for page up
::SendMessage(hwnd,WM_VSCROLL, SB_PAGEDOWN, 0); // for page down
|
|
|
|
|
sorry !
where can add this code ?
WindowProc(......) or some where ?
i use WM_KEYDOWN but no message to receive !
|
|
|
|
|
I cant get that to work either... by hwnd you mean the variable "m_hwndHtml"??
I tried to test it at the bottom of the SetHtml() function, and it didnt work
thanks
--Ben
|
|
|
|
|
HTML control has its own scrollbar and it won't handle any WM_VSCROLL/WM_HSCROLL messages. (If you set the control style to display scrollbar and its content is too long to display - it will display another scrollbar inside the client area and it won't response the outer scrollbar)
You can simulate scolling by using anchor
1.add anchor to the begining of the line
<code>
<A NAME='line1'>line1</A><BR>
<A NAME='line2'>line2</A><BR>
<A NAME='line3'>line3</A><BR>
</code>
2.when you want to scroll just call
<code>
::SendMessage(m_hwndHtml, DTM_ANCHOR, 0, L"line3");
</code>
|
|
|
|
|
I thought of that, but that of necessity contaminates the source document. It's reminiscent of the way Notepad inserts conditional CR's for its linewrap, (or used to in the old days). That seems to be a pretty poor substitute for the real thing.
You're saying that there is a scrollbar control included in the htmlview control, but it is not accessible to the applications programmer?
I've tried the same thing, and I know I have the right handle, because it works for ShowWindow. However, the handle that works for ShowWindow has no child windows according to ::GetWindow(hHTMLCtrl, GW_CHILD);
Using that very handle that the control is Created with, I can Hide the window, by a MessageBox option, then likewise Show it again. But I can't Scroll it, Cut text, Paste text, or even GETTEXTLENGTH, even though the control was originally populated with SETTEXT.
Very puzzling.
|
|
|
|
|
Can the HTMLCtrl handle forms?
How can I do that?
|
|
|
|
|
Yes, when you receive the NM_HOTSPOT message, you get the form post data from (NM_HTMLVIEW*)lParam->szData (a character array).
|
|
|
|
|
Hi,
Thanks for the hint. But is there something special to have szData filled ?
When i clicked a link and debug the message NM_HOSTSPOT, szData is empty, in spite my page contains a form and a selectbox. Il would love to get the content of the select box.
Many thanks for any answers
Bipdan
-- modified at 4:51 Wednesday 28th February, 2007
Ok it works, now. there must have a submit button to get it work.
|
|
|
|
|
I downloaded the sample app and tried to compile it but i got the following error msgs:
D:\SW\PocketPC2002 SDK\htmldialogwrapper\STHtmlDialog_SampleApplication\HtmlTest\STHtmlDialog.cpp(101) : error C2065: 'LPINLINEIMAGEINFO' : undeclared identifier
D:\SW\PocketPC2002 SDK\htmldialogwrapper\STHtmlDialog_SampleApplication\HtmlTest\STHtmlDialog.cpp(101) : error C2146: syntax error : missing ')' before identifier 'dwCookieValue'
D:\SW\PocketPC2002 SDK\htmldialogwrapper\STHtmlDialog_SampleApplication\HtmlTest\STHtmlDialog.cpp(101) : error C2059: syntax error : ')'
D:\SW\PocketPC2002 SDK\htmldialogwrapper\STHtmlDialog_SampleApplication\HtmlTest\STHtmlDialog.cpp(111) : error C2677: binary '&' : no global operator defined which takes type 'struct tagINLINEIMAGEINFO' (or there is no acceptable conversion)
Error executing clarm.exe.
have anyone seen these errors before?
Thanks
Mustafa
|
|
|
|
|
Same problem here.... i cant figure out why lpinlineimageinfo isnt recognized...
Included htmlview.dll, but to no avail
If you find answer, let me know!
|
|
|
|
|
I have the same problem.
Did someone could please give a solution?
fred
|
|
|
|
|
simple.
just delete it......it works!!!
|
|
|
|
|
Change '(LPINLINEIMAGEINFO)' to '(INLINEIMAGEINFO*)'.
then it works well in Pocket PC 2002.
|
|
|
|
|
right.
if you look into htmlview.h (external dependencies) you can look at the INLINEIMAGE struct. They used to have a TypeDef LPINLINEIMAGE for a pointer to a INLINEIMAGE struct, but now, they don't have that typedef. So you can just use INLINEIMAGE* instead of LPINLINEIMAGE or write a typedef yourself....
but is't still strange that LPINLINEIMAGE is gone in the header...
|
|
|
|
|
I can't figure out how to get the word selected(by stylus) on HTML window.
For Example - if the stylus is dragged on a word/ words, on a toolbar event, i want to capture the word/words selected.
HELP! HELP! HELP!.
Thanks,
biswa.
|
|
|
|
|
Well i got the answer
|
|
|
|
|
Would be cool if you could post it here...
since I have a similar Problem...
|
|
|
|
|
HWND hwnd = ::GetWindow(m_hwndHtml, GW_CHILD);
//to copy selected word/s to clipboard
::SendMessage(hwnd, WM_COMMAND, 0x139E, 0); //for pc2002
::SendMessage(hwnd, WM_COMMAND, 0x156BA, 0);//for pc2000
|
|
|
|
|
If only that were true!
My code has an HTML control embedded in a dialog, and that is the property of a TreeView of files. When I select a file from the treeview, and choose "HTML" on my menu, it executes the following code:
case ID_LAUNCH_HTML:
________if(hHTMLDlg)________// this is the HTML display window
________________DestroyWindow(hHTMLDlg);
________hHTMLDlg = CreateDialog(hInst,(LPCTSTR)IDD_HTMLVIEW, hwnd, (DLGPROC)HTMLDlgProc);
________SendMessage(hHTMLCtrl, WM_SETTEXT, 0, (LPARAM)(LPCTSTR)_T(""));
________SendMessage(hHTMLCtrl, DTM_ENABLESHRINK, 0, g_bMakeFit);
________if (!SHCreateMenuBar(&mbiHTML))
________________MessageBox(hwnd, L"SHCreateMenuBar Failed", L"Error", MB_OK);
________hwndCB = mbiHTML.hwndMB;
________if(!bHTMLLoaded){
________________hFile = CreateFile(tPath, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
________________________FILE_ATTRIBUTE_NORMAL,NULL);
________________if(hFile==(void*)-1)
________________________ShowLastError();
________________dwHTMLFileSize = 2 + GetFileSize((HANDLE)hFile,NULL); // 2 bytes must be 0 to get 1 wide-char terminus
________________if(pHTMLSource)
________________________delete pHTMLSource;
________________pHTMLSource = new char[dwHTMLFileSize];
________________memset(pHTMLSource,0,dwHTMLFileSize);
________________ReadFile(hFile,pHTMLSource,dwHTMLFileSize,&BytesRead,NULL);
________________// this is the sourcefile needed to fill the HTML dialog
________________CloseHandle(hFile); // pHTMLSource + (dwHTMLFileSize - 40)
________________}
________lRes = SendMessage(hHTMLCtrl,WM_SETTEXT,0,(LPARAM)(LPCTSTR)TEXT(""));
________SendMessage(hHTMLCtrl,DTM_CLEAR,0,0);
________SendMessage(hHTMLCtrl,DTM_ADDTEXT,false,(LPARAM)/*(LPCTSTR)*/pHTMLSource);
________SendMessage(hHTMLCtrl,DTM_ENDOFSOURCE,(WPARAM)0,(LPARAM)0);
________SendMessage(hHTMLCtrl,DTM_FITTOWINDOW, 0, (LPARAM)VARIANT_TRUE);
________bHTMLLoaded = true;
________ShowWindow(hHTMLDlg,SW_SHOWNORMAL);
________MoveWindow(hHTMLCtrl,0,0,240,268, true);
________ShowWindow(hHTMLCtrl,SW_SHOWNORMAL);
________MoveWindow(hHTMLDlg, 0, 0, 240, 294, true);
________ShowWindow(g_hwndTreeView,SW_HIDE);________________
________ShowWindow(g_hwndEdit,SW_HIDE);________________
________BringWindowToTop(hHTMLCtrl);
________hFocus = GetFocus();
________SetFocus(hHTMLCtrl);
________hFocus = GetFocus();
________break;</small>
As you can see, the handle for the htmlctrl is "hHTMLCtrl". I assure you that this code successfully puts the selected file into HTML display on this control.
But when I send it to a section of code that contains your suggestion
HWND hwnd = ::GetWindow(hHTMLCtrl, GW_CHILD);
::SendMessage(hwnd, WM_COMMAND, 0x139E, 0); //for pc2002
::SendMessage(hwnd, WM_COMMAND, 0x156BA, 0);//for pc2000
I find that (1), this handle has no child windows, and
(2) if I use the handle instead of the child you suggest, the clipboard is empty. I am using Pocket PC2002, but I have tried both the two different WParam values and neither does anything.
But you have done this much: you have provided a good basis for discussion.
(I have read this same solution in the past and tried and failed the same way, so this is well publicized code.
There must be something one can do, but it is also true that the version of IE (Pocket IE) also lacks the functions to copy selected text or any equivalent of the CTRL-F find of the desktop version.
Yet the text is there — somewhere. There's got to be a way to get my hands on it!
|
|
|
|
|
I wonder if this was carried over into CE?
BUG: CHtmlView Leaks Memory by Not Releasing BSTRs in Several Methods
The information in this article applies to:
The Microsoft Foundation Classes (MFC), when used with:
Microsoft Visual C++, 32-bit Enterprise Edition 6.0
Microsoft Visual C++, 32-bit Professional Edition 6.0
Microsoft Visual C++, 32-bit Learning Edition 6.0
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q241750&
The following methods in CHtmlView cause a memory leak if called:
Navigate
GetFullName
GetType
GetLocationName
GetLocationURL
LoadFromResource(LPCTSTR lpszResource)
LoadFromResource(UINT nRes)
|
|
|
|
|
I noticed the example code never calls CSTHtmlDialog::DeleteHtmlImages() nor does it ever call destroy window (since it called ::CreateWindow in CSTHtmlDialog::CreateHtmlWindow) - i forget does this window get automatically destroyed when it's parent is destroyed?
Anyone?
|
|
|
|
|
Hi.
Your sample interest me but use HtmlView.dll. Do you know if this dll is still support under Windows CE .net 4.0?
I use embedded Visual C++ 4.0 under WinCE .net 4.0. Every sample I found didn't work. There is compilation problem.
I'm trying to see if I can integrate htmlview.dll in my SDK but if you have an idea to help me, please let me know.
Thanks a lot.
Christian Dubois
|
|
|
|
|
Should be supported in WinCE .net 4.2.
Don't know yet but that's what Microsoft web sites claim.
|
|
|
|
|