Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Hmm, in IE, i would enumchild windows after getting the main hWnd for IE, then use the sendmessage API to set the text of the address bar. In mozilla though, i can't seem to get an hWnd for the address bar. Not even SPY++ or WinSpy can lock on it. Anyone know how i could accomplish setting the address in mozilla? I will also need to be able to get the current address as well. thanks
Posted
eh, you'll need to use "Microsoft Active Accessibility".

linky

 

I'm sorry I can't be of any further help.

 

That was actually a lot of help. I got the MSAA Explorer from microsoft.com, and it found the address bar, along with MANY other things that SPY++ did not. I am not at home right now to play with it further, but does anyone know of any tutorials for using the MSAA SDK? Thanks again HJB417.

Posted
eh' date=' this may be of some use to you.

 

I am 100% lost. My compiler does not recognize "IAccessible" at all, and i seem to be having a hard time finding any further information on it.

Posted
I am 100% lost. My compiler does not recognize "IAccessible" at all' date=' and i seem to be having a hard time finding any further information on it.[/quote']

ok, i figured that out finally, i had to add the accessibility.dll file to my project, but now I can't access accessibility.iaccessible.get_accValue, or anything after iaccessible. any thoughts? there are no popups when i put a "." after iaccessible.

Posted

The gecko dock recommneded the use of ienumvariant, unfortunately, I'm not having much success w/ it. You might be better of emailing netscape address listed at the bottom of the page and posting on the microsoft.dotnet newsgroups.

using System;
using System.Runtime.InteropServices;
using Accessibility;

namespace FOoBar
{
[Guid("00020404-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IEnumVARIANT
{
	[PreserveSig]
	int Next(uint celt, [in, Out, MarshalAs(UnmanagedType.LPArray)] object []rgVar, out uint pceltFetched);

	[PreserveSig]
	int Skip(uint celt);
 
	[PreserveSig]
	int Reset();

	IEnumVARIANT Clone();
}

public class Class1
{
	[DllImport("oleacc.dll", PreserveSig=false)]
	[return: MarshalAs(UnmanagedType.Interface)]
	public static extern object AccessibleObjectFromWindow(IntPtr hwnd, uint dwId, ref Guid riid);


	[sTAThread]
	public static void Main(string[] args)
	{
		Guid uid = new Guid("618736e0-3c3d-11cf-810c-00aa00389b71");
		IAccessible mozilla = (IAccessible) AccessibleObjectFromWindow(new IntPtr(0x000b0594), 0, ref uid);
		IEnumVARIANT ienum = (IEnumVARIANT) mozilla;
	}

	const int S_OK = 0x00000000;
	const int S_FALSE = 0x00000001;
}
}

Posted
Hmm' date=' in IE, i would enumchild windows after getting the main hWnd for IE, then use the sendmessage API to set the text of the address bar. In mozilla though, i can't seem to get an hWnd for the address bar. Not even SPY++ or WinSpy can lock on it. Anyone know how i could accomplish setting the address in mozilla? I will also need to be able to get the current address as well. thanks[/quote']

 

 

Ok, I implemented a managed wrapper for the IAccessible object in c++.net. Unfortunately, that site I gave u states that there is no support for the 'put_accValue'. The url object thing is an editable text, and the text in the url thing can be retrieved using get_accValue. A call to put_accValue will succeed but the text is never changed.

 

THis is what I did though. Using the IAccessible object that represents the url text thingy, I called accSelect to give that object 'focus', and then call win32 SetForegroundWindow to bring the mozilla window to the top, and the use SendKeys::SendWait to replace the current text with whatever text I sent to the SendKeys::SendWait method. The current url can be retrieved by using get_accValue.

 

You enter the URL in IE using the same way I'm doing it for mozilla, so I guess this will do for now.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...