mIRC Homepage
Posted By: Soul_Eater Internet Explorer - 16/10/04 08:00 PM
I know in C++ "Internet_Explorer_Server" hwnd's can be created.

My question is, if I capture the HWND of one of these windows, how would I direct commands to it, like sending urls, etc.
Posted By: tidy_trax Re: Internet Explorer - 16/10/04 08:05 PM
I guess you could get the hwnd of the url editbox using GetDlgItem(), then use SendMessage() to send the WM_KEYDOWN message with the url.

I'm new to api programming so you probably can't do that, but that's my guess.
Posted By: Soul_Eater Re: Internet Explorer - 16/10/04 08:17 PM
it's not internet explorer. It's an hwnd with pretty much browser functionality. The class is "Internet_Explorer_Server"
Posted By: Soul_Eater Re: Internet Explorer - 18/10/04 12:01 AM
i think it's a webbrowser control. Anyone know how to send navigation commands?
Posted By: Soul_Eater Re: Internet Explorer - 20/10/04 02:21 AM
ok, I've learned that "Internet Explorer_Server" like that, is an IE instance.

It is controlable through the IE_server window, and the Shell DocObject View window with WM_COMMAND

There are several Command IDs, listed here: http://www.swissdelphicenter.ch/torry/showcode.php?id=2231
and here: http://www.codeguru.com/Cpp/I-N/internet/generalinternet/article.php/c8163/

However, none to navigate/open a website. Does anyone know how to get context menu IDs for the "File->Open" in Internet explorer, or know of a command ID to do so?
Posted By: Soul_Eater Re: Internet Explorer - 20/10/04 06:45 AM
me again *waves*

heres some code to digest and figure out why its not navigating:

Code:
   HWND web = FindWindowEx(shelldoc,NULL,"Internet Explorer_Server",NULL);


	  HINSTANCE hInst = ::LoadLibrary( _T("OLEACC.DLL") );

CComPtr<IHTMLDocument2> spDoc;
	LRESULT lRes;

		UINT nMsg = ::RegisterWindowMessage( _T("WM_HTML_GETOBJECT") );
				::SendMessageTimeout( web, nMsg, 0L, 0L, SMTO_ABORTIFHUNG, 1000, (DWORD*)&lRes );

				LPFNOBJECTFROMLRESULT pfObjectFromLresult = (LPFNOBJECTFROMLRESULT)::GetProcAddress( hInst, _T("ObjectFromLresult") );
				if ( pfObjectFromLresult != NULL )
				{
					HRESULT hr;
					hr = (*pfObjectFromLresult)( lRes, IID_IHTMLDocument, 0, (void**)&spDoc );
					if ( SUCCEEDED(hr) )
					{
						CComPtr<IDispatch> spDisp;
						CComQIPtr<IHTMLWindow2> spWin;
						spDoc->get_Script( &spDisp );
						spWin = spDisp;
						spWin->get_document( &spDoc.p );
						// Change background color to red
				//		spDoc->put_bgColor( CComVariant("red") );
						spWin->navigate((BSTR)"http://www.mirc.com");
					}
				}
::FreeLibrary( hInst );
	CoUninitialize(); 
Posted By: Soul_Eater Re: Internet Explorer - 23/10/04 08:39 PM
got all my problems fixed!
© mIRC Discussion Forums