473,386 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Active Accessability

I was wondering if anyone had any suggestions on how to get accessability
information form a window handle. I know this is possible and even found
some sample code but it doesn't seem to work.
Here is the code i am using:
-----------------------------------------------------------------------------------------------
using Accessibility;
private UUID uuidAccessible;
private Guid iAccessibleGuid = new
Guid("618736e0-3c3d-11cf-810c-00aa00389b71");

private IAccessible GetAccessibleInterfaceFromWindow(int handleWindow)
{
uuidAccessible = new UUID();
uuidAccessible.data1 = 0x618736e0;
uuidAccessible.data2 = 0x3c3d;
uuidAccessible.data3 = 0x11cf;
uuidAccessible.data4 = new byte[8];
uuidAccessible.data4[0] = 0x81;
uuidAccessible.data4[1] = 0xc;
uuidAccessible.data4[2] = 0x0;
uuidAccessible.data4[3] = 0xaa;
uuidAccessible.data4[4] = 0x0;
uuidAccessible.data4[5] = 0x38;
uuidAccessible.data4[6] = 0x9b;
uuidAccessible.data4[7] = 0x71;
IAccessible iDialogWindow = null;

//Allocate memory the size of IAccessible interface
IntPtr dialogWindow = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(UUID) ));

//Add 1 level of indirection
IntPtr dialogWindowp =
Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(IntPt r)));
Marshal.StructureToPtr(dialogWindow, dialogWindowp, false);

//Call function in Oleacc.dll
AccessibleObjectFromWindow(handleWindow, 0, uuidAccessible, dialogWindowp);

//Remove 1 level of indirection
dialogWindow = Marshal.ReadIntPtr(dialogWindowp);

//Allocate memory for the real IAccessible interface
IntPtr iAccessiblePtr =
Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(UUID) ));
Marshal.QueryInterface(dialogWindow, ref iAccessibleGuid, out
iAccessiblePtr);
iDialogWindow =
(IAccessible)Marshal.GetTypedObjectForIUnknown(iAc cessiblePtr,
typeof(IAccessible));
return iDialogWindow;
}

[StructLayout(LayoutKind.Sequential)]

public class UUID
{
public int data1;
public short data2;
public short data3;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] data4;
}
-----------------------------------------------------------------------------------------------
This runs but more or less every propery has a value of "<cannot view
indexed property>". Is there something i need to do to get the information
out of it?

Thanks in advance,
Logan


Nov 17 '05 #1
0 1333

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Amit | last post by:
Hi when I try to run LIST ACTIVE DATABASES AT DBPARTITIONNUM <partnum> or LIST ACTIVE DATABASES GLOBAL, I always get an error message. Does anyone know why? I'm on v8 fp 5 output : db2 => list...
3
by: Kevin | last post by:
Is it possible to develop an Active Document Full Server or a Container application using C#? Thanks, Kevin.
0
by: Carlao | last post by:
I am using Windows Forms with vb.net. My app is a MDI and I have some child forms. My problem is when I try to use Control+Tab. If I have a TabControl control with some tabpages in the main form...
0
by: gregory_may | last post by:
I want to stuff information into a text box with via the accessibility API .... Anyone know how do I do it in .Net? So has anyone tried to talk to the Accessibility api with .Net? I cant seem to...
8
by: salad | last post by:
I was wondering how you handle active/inactive elements in a combo box. Let's say you have a combo box to select an employee. Joe Blow has been selected for many record however Joe has left the...
0
by: fblake | last post by:
FOR IMMEDIATE RELEASE Active Up expands ever popular product line Active Web.Controls 2007 V1, Active Cells V2 and Active AutoSuggest V1.0 Belgium (February 2007): Active Up today released...
0
by: fblake | last post by:
Belgium (June 2007): Active Up today released the latest version of their RTF and HTML converter control for .NET, Active RTF, ActiveUp.RTF V3 ActiveUp.RTF enables any developer to convert...
0
by: fblake | last post by:
Brussels, Belgium and Sunnyvale, Calif., – July 2007 – Active Up today announced today that it has entered into an agreement with Commtouch® (NASDAQ:CTCH) to license Anti-Spam and...
2
by: =?Utf-8?B?TWFyYyBXaWNrZW5z?= | last post by:
Hi I have noticed that the LinkButton creates a hyperklink to a javascript location .e.g. <a href="javascript:__dopostback" This is bad for accessability because browsers without Javascript...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.