Thread: Internet Explorer Monitor

  1. #1
    I am me, who else?
    Join Date
    Oct 2002
    Posts
    250

    Internet Explorer Monitor

    I was wondering if anyone knows of a way to monitor whats going on in Internet Explorer. For example if I did something in JavaScript and clicked on a link and it spat out some text, would it be possible to have a program monitor IE and when something javascript related happened, it would do someting like write to a file, or something like that? Would it need to be an activeX plug-in or could it be another program using IPC?

    I guess to be precise I want to know how (either if there are links available, or whatnot) to create a program in Windows(of course) to find out whats going on in a browser (IE or mozilla) and react based on that. Any info would be very much appreciated. I did see the post on the board about apps controlling other apps.

    Thanks for any help you can provide!

  2. #2
    Registered User
    Join Date
    Jan 2004
    Posts
    4
    u could do it with a hook.
    First find the handle of the explorer window. then set a hook to it and u should get all the infos that get to that window.
    Im not quite sure if this is right, but i thought he didnt get a reply so help him out .
    Link1: http://msdn.microsoft.com/library/de...abouthooks.asp
    Link2: http://msdn.microsoft.com/library/de...dn_hooks32.asp
    or if ur realy hardcore just watch the stuff that is send over to ur NIC(NetworkInterfaceCard).

    Hope i helped in some ways
    --Zhjim--

    P.S. another ways is to use the shdocvw.dll(dll for IE) only now it from VB6.0 so cant help with this any further
    Last edited by Zhjim; 01-15-2004 at 06:38 AM.

  3. #3
    I am me, who else?
    Join Date
    Oct 2002
    Posts
    250
    Hey thanks for the reply! Even if you don't know the exact answer, hints really do help! I'll give that a try, but if anyone knows how or wants to give me a walkthrough, or their view of "whats most efficient or effective here" that would be cool too. Rather interested in this, as I have not done too much windows programming.

  4. #4
    I am me, who else?
    Join Date
    Oct 2002
    Posts
    250

    Any more ideas?

    Well I am trying to create a hook here, and when I write something to catch a hook it won't even compile, it complains that it cannot convert param 2 or SetWindowsHookEx cannot be converted from
    Code:
    long(int, unsigned int, long)
    to
    Code:
     int (__stdcall *)(void)

    Here is a portion of the code below which I borrowed from someone who has freely distributed a msnhook program they made.

    Code:
    int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
    {
    	tdll = hInstance;
        return TRUE;
    }
    
    
    void APIENTRY ShellDll_Hook()
    {
    	g_hShellHook = SetWindowsHookEx(WH_CBT, ShellDll_MainHook, tdll, 0);
    }
    
    void APIENTRY ShellDll_Unhook()
    {
    	if(g_hShellHook != NULL)
    		UnhookWindowsHookEx(g_hShellHook);
    }
    
    
    void phello(char *mystr)
    {
    	
    	strcpy(mystr, "Hello 2 you!\n");
    
    }
    
    
    LRESULT CALLBACK ShellDll_MainHook(int nCode, WPARAM wParam, LPARAM lParam)
    {
    	TCHAR szClass[MAX_PATH] = {0};
    
    	BOOL doneonce = false;
    
    	if(nCode < 0)
    		return CallNextHookEx(g_hShellHook, nCode, wParam, lParam);
    	
    	// Call filter everytime a new window is created
    	if(nCode == HCBT_CREATEWND)
    	{
    		// Get the HWND of the window
    		HWND hwndToNewWindow = reinterpret_cast<HWND>(wParam);
    
    		GetClassName(hwndToNewWindow, szClass, MAX_PATH);
    	}
    
    	return CallNextHookEx(NULL, nCode, wParam, lParam);
    }
    the def for ShellDll_main is

    Code:
    LRESULT CALLBACK ShellDll_MainHook(int nCode, WPARAM wParam, LPARAM lParam);
    his code, which looks different than mine compiles fine on visual c++ 5.

    Any ideas or suggestions? Need more code posted? Thanks!

  5. #5
    Registered User
    Join Date
    Jan 2004
    Posts
    37
    Hooking the window will allow you to know where the mouse is, what button they pressed, what menu item they clicked on, but I don't see how that information will help you. You should look into writing a plug-in for IE. I'm not familiar with the IE plug-in kit, but it might have the ability to give you more relevent data

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Internet Explorer
    By Joanna in forum Tech Board
    Replies: 7
    Last Post: 04-25-2004, 02:28 AM
  2. Replies: 1
    Last Post: 12-17-2002, 01:06 AM
  3. will not erase this history for internet explorer
    By HelpPLease123 in forum Tech Board
    Replies: 8
    Last Post: 11-02-2002, 01:18 AM
  4. Drag and drop from Internet Explorer
    By Echidna in forum Windows Programming
    Replies: 5
    Last Post: 10-02-2002, 02:14 AM
  5. closing microsoft internet explorer
    By canine in forum Windows Programming
    Replies: 11
    Last Post: 03-19-2002, 09:12 AM