 |
 | Superb!  Paul Roberts | 6:15 27 Nov '08 |
|
|
 |
|
|
 |
|
 |
Hi,
Sorry, I have a question related to CDHtmlDialog but not related to this project though.
I am using CDHtmlDialog for my application.
The statement below works perfectly fine under XP, but in Vista, it simply refuse to load. <IMG src="file:banner.gif">
I have tried disabling the UAC but is still fail. Any idea why?
John
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |
|
 |
open application and select Welcome Tab.
There is a link to iTreeSoft.
When click on it, URL is not opened.
Any idea why it is not opened.
I got the same problem in my application.
From HTML page click on link is not opened like:
function openwindow2() { w=open('http://www.yahoo.com','windowname2','menubar'); }
Amit
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
=== Modify the function below in this sample code,
void CHtmlSkinDlg::OnNewWindow2(LPDISPATCH FAR* ppDisp, BOOL FAR* Cancel) { *Cancel = TRUE; // cancel when needed }
=== like this,
void CHtmlSkinDlg::OnNewWindow2(LPDISPATCH FAR* ppDisp, BOOL FAR* Cancel) { *Cancel = FALSE; }
=== then URL can be opened in a new window.
Sample code will be updated sometime later.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi everyone. I noticed that hitting the return key makes the application close. I do not know why and I cannot handle this bug. However I cannot catch the key and just dismiss its use, because my CDHTMLDialog based application must be usable with keyboard only (tab + enter + space).
Do you have any solution to this ? Thanks !
nutz
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
How to make Internet Explorer GUI "draggable" so that users can click on some image, region or text INSIDE OF the displayed web page and, holding down their mouse, drag the ENTIRE browser window anywhere on the desktop. There are several ways to do this but the easiestr and most reliable I've found so far is the following:
href="http://www.codeguru.com/Cpp/frameworks/advancedui/skins/article.php/c6055/
I tried this approach, but my applivation's OnBeforeNavigate2() not called on Dragging.
What missed or what approach is used in this project.
Thanks, Amit
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Well i see the solution here:
BEGIN_DHTML_EVENT_MAP( ... ) //ban the selecting action DHTML_EVENT_TAG_ALL(DISPID_HTMLELEMENTEVENTS_ONSELECTSTART, OnHtmlSelectStart ) //handle all the dragging action DHTML_EVENT_TAG_ALL(DISPID_HTMLELEMENTEVENTS_ONDRAGSTART, OnHtmlDragStart ) //handle all the context menu DHTML_EVENT_TAG_ALL(DISPID_HTMLELEMENTEVENTS_ONCONTEXTMENU, OnHtmlContextMenu ) END_DHTML_EVENT_MAP()
Any other ideas? Why OnBeforeNavigate2() not called on Dragging when we use CHTMLDialog?
Thanks, Amit
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I use CDHTMLDialog to program a simple web browser, and I had a trobule on Http Header modify. I want add my own "User-Agent" when client use my application to browse web.
//------------------------------------------------------------------------------------------------ #define WM_NVTO (WM_USER+1000)
class NvToParam { public: CString URL; DWORD Flags; CString TargetFrameName; CByteArray PostedData; CString Headers; DWORD dwPostDataLen; }; //------------------------------------------------------------------------------------------------ LRESULT Ccdhtml_t1Dlg::OnNvTo(WPARAM wParam, LPARAM lParam) { NvToParam* pNvTo = (NvToParam*)wParam; CDHtmlDialog::Navigate((LPCTSTR)pNvTo->URL, pNvTo->Flags, (LPCTSTR)pNvTo->TargetFrameName, (LPCTSTR)pNvTo->Headers, pNvTo->PostedData.GetData()); delete pNvTo; return 1; }
//------------------------------------------------------------------------------------------------ void Ccdhtml_t1Dlg::OnBeforeNavigate2(LPDISPATCH pDisp, VARIANT FAR* URL, VARIANT FAR* Flags, VARIANT FAR* TargetFrameName, VARIANT FAR* PostData, VARIANT FAR* Headers, BOOL FAR* Cancel) { CString strHeaders(V_BSTR(Headers)); if(strHeaders.Find("User-Agent:LHPBrowser 1.0") < 0)// Check User-Agent { *Cancel = TRUE; // Cancel this request
if(!strHeaders.IsEmpty()) strHeaders += "\r\n"; strHeaders += "User-Agent:LHPBrowser 1.0";// Add Customize Http Header
NvToParam* pNvTo = new NvToParam; ASSERT(V_VT(URL) == VT_BSTR); ASSERT(V_VT(TargetFrameName) == VT_BSTR); ASSERT(V_VT(PostData) == (VT_VARIANT | VT_BYREF)); ASSERT(V_VT(Headers) == VT_BSTR); ASSERT(Cancel != NULL);
USES_CONVERSION;
VARIANT* vtPostedData = V_VARIANTREF(PostData); CByteArray array; if (V_VT(vtPostedData) & VT_ARRAY) { // must be a vector of bytes ASSERT(vtPostedData->parray->cDims == 1 && vtPostedData->parray->cbElements == 1);
vtPostedData->vt |= VT_UI1; COleSafeArray safe(vtPostedData);
DWORD dwSize = safe.GetOneDimSize();
LPVOID pVoid; safe.AccessData(&pVoid);
array.SetSize(dwSize); LPBYTE lpByte = array.GetData();
memcpy(lpByte, pVoid, dwSize);
safe.UnaccessData(); } // make real parameters out of the notification
CString strTargetFrameName(V_BSTR(TargetFrameName)); CString strURL(V_BSTR(URL)); DWORD nFlags = V_I4(Flags);
//===================================================== pNvTo->URL = strURL; pNvTo->Flags = nFlags; pNvTo->TargetFrameName = strTargetFrameName; pNvTo->PostedData.Copy(array); pNvTo->Headers = strHeaders; //===================================================== // Post msg PostMessage(WM_NVTO,(WPARAM)pNvTo);
return; } CDHtmlDialog::_OnBeforeNavigate2( pDisp, URL, Flags, TargetFrameName, PostData, Headers, Cancel ); }
---------------------------------------------------------- After the testing, I found it will work fine on "http reqest", "http form get" and "http form post". But if my http form is "multipart/form-data" (upload file form), some of the post datas will lost.
How should I fix it? Does any one can help me? Or any better method to add http header when navigate a url?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
In CRegionDHtmlDialog::PreTranslateMessage, you could also check for Ctrl+'F' for the IE search dialog and Ctrl+'5' for select all.
For disabling the select all, you would also need to check for Ctrl+0x65. 0x65 is the numpad '5' when the numlock is on.
-- modified at 18:42 Tuesday 9th May, 2006
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
 | COOL!  iTreeSoft | 4:35 26 Mar '08 |
|
|
 |
|
 |
Hi. This is a really nice and useful example, thanks a lot for taking time to post it. Now my question: can this class (or the base CDHtmlDialog) be used in a Document/View architecture? I'm trying to write an app. which will have the tree view on a left pane, splitter in the middle and browser object in a right pane. I know, that CHtmlView is designed for use in views, but it lacks a lot of useful stuff available in CDHtmlDialog, particularly comfortable DHTML events handling. I want this app. to have bi-directional communication with the browser and not only passive display of HTML content. Any suggestions?
Thank you in advance.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi, I am not familiar with Document/View architecture.
CHtmlView can notify you some of the HTML events, such as OnDocumentComplete and so on.
If CHtmlView is not suitable for your app, maybe you should use ATL to utilize the component inside CHtmlView or the system's IE component directly.
Maybe there are solutions for CHtmlView in some articles, good luck!

|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
In OnHtmlDragStart I notice you move the window using
::SendMessage(m_hWnd,WM_NCLBUTTONDOWN,HTCAPTION,0);
However it does not work for img elements, it cannot be moved.
Any solution/work around to this?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Well, I guess sendmessage is not the point.
Try to make the image as div background image, like this
<div style="width:30px;height:30px;BACKGROUND-IMAGE: url(tab.active.png);background-repeat:no-repeat;"></div> .
I have no better solution now. Tell me if you find one.
Good luck!

|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Thanks.
This is quite a good workaround for this issue.
I was wondering if you tried with different parameters for:
::SendMessage(m_hWnd,WM_NCLBUTTONDOWN,HTCAPTION,0);
Did you try other parameters such as HTCLIENT and also did you try to pass in a POINTS struct which has the current position of the window? I cannot understand why sending the WM_NCLBUTTONDOWN message does not work for <img> elements?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Does anybody knows if CDHtmlDialog class of VC++ 7 depend on IE version. If it does, what is the minimum supported version? Thanks Gil
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
It should depends on the version of IE. But does it really matter?
IE 5.5+ is OK. If you need some advanced HTML effects, IE 6.0+ maybe better.

|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi, My application need to support IE 5 users as well. I tried to search for microsoft documentation on this subject but didn't find anything. Do you have an answer?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
What I can think of is to make a simple demo using CDHtmlDialog and test it in a system with IE 5.0.
Good luck.

|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |