calcmaster.NET:   calcmaster.NET  -   ShadowBrowser Anonymous Web Surfing Proxy  -   Visual GWin++ - Visual C++ IDE  -   XWinLogon - Windows X Server  -   XWin32 Alternative

calcmaster.NET
Home
ShadowBrowsing?
Contact Us


Projects
Cinelerra Guide
Blender Sunsky Texture Plugin
Scanner Copier
XWinLogon
Win32 Coding
pdf2svg Conversion
Gimp Layer Groups


Videos & Processing
YouTube 4:3 HQ
YouTube 16:9 HQ
Video & Colorspaces
Content Search


Bookmark and Share

Win32 WebBrowser ActiveX Control

Add the WebBrowser ActiveX control to any window using standard Win32 function calls. The WebBrowser ActiveX control is the heart of Microsoft Internet Explorer and is used by many applications to provide HTML support. There exists a Mozilla ActiveX control which can be used instead as a direct replacement for the WebBrowser ActiveX control, even using the same API. (Note: A tool is provided at the Mozilla ActiveX control project website which will allow you to modify a binary which uses the WebBrowser ActiveX control to use the Mozilla ActiveX control instead.)

My first step was to figure out how to link to the atl.dll library. This was quite a task considering my limited knowledge of DLL's. Follow the DLL instructions, then edit the .def file that you have created. I knew that I needed to call AtlAxWinInit(void);, so I had to add "@0" (the 0 tells us that there are zero arguments sent to this function) to make that work. Finish building the import library and add it to your project. You must repeat this process for every call that you will make to the DLL.

Next, you must borrow the code from atldef.h (under #if define(_ATL_DLL)) to define ATLAPI and ATLAPI_(x). One or more of those may not be needed, but they were grouped so I added them all. At the beginning of your program, you need to call AtlAxWinInit(); Since I did not have the header file, I used the code declaration given by MSDN and that worked fine.

Ok, this got to the point where I couldn't figure out what to do next and I didn't have much time left. Create a window as a child window of another window as in the following:
hwnd = CreateWindowEx( WS_EX_CLIENTEDGE,
  "AtlAxWin",
  "http://www.calcmaster.net/",
  WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL,
  rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top,
  hwndParent,   GetModuleHandle(NULL),   // retrieves the current hInstance
  NULL);

With this you may browse the Internet, but I have not yet figured out how to use standard Win32 calls (or even AtlAx* calls) to manage the component. (This is because I am not using MSVC but instead gcc.) This means that you can't monitor anything, or change the web page within your code (though clicking on links works), or do anything really useful. This component would only work well as a help file viewer or something like that. If anyone else can figure out how to get more functionality out of this, please contact me.

Hint: I have found a website that refers to assembly programming, COM, and ActiveX. It may be helpful to check this website out: Win32 Assembly Code.

References
http://support.microsoft.com/kb/q192560/
http://www.codeproject.com/java/javacom.asp
http://www.arstdesign.com/articles/Win32_dialoghelpers.html
http://www.iol.ie/~locka/mozilla/control.htm
http://www12.canvas.ne.jp/peters/colin/win32/dll/use.html
http://www.winehq.org/hypermail/wine-devel/2004/03/0180.html

 

Contact Us
Website Developed by: e-Marketing NC