|
Hi Matt,
Active Accessibilty (MSAA) has originally been developed to help people with disabilities to use software.
Beside this great idea, Active Accessibility allows you also to get info on windowless UI controls, or perform actions on them (e.g. buttons or textfields in Flash animations)
In C# I found the AccessibleObject class, which seems pretty much to be what I'm looking for (I'm writing automated software- and webtests).
My problem is, that I don't know how to use it on controls or windows in external software. C++ usually uses the AccessibleObjectFromWindow API to get an IAccessible Interface pointer to a window. Unfortunately, I don't know how to use this function in c#.
If you have any hint where I could look.....
thx,
Ulf
|
|
|
|
|
I think I understand a little better. What you mean by external software is basically programs that you don't have the code for. Is that correct?
Do you already have a way to get a handle to the window in question? If so, then you should be able to just use it. However, if you don't have a handle to the window in question, you need to read up on API Hooking and window subclassing. This is not a simple topic and you should consult the various articles on CP that address it.
Now, if I've still not hit on what you are looking for, then I think you need to clarify further. If it's knowing how to use your Active Accessibility API, I can't help you there, you'll have to just read the docs.
Here is an article on CP that talks about hooking in a browser using C#: http://www.codeproject.com/jscript/htmlgetshooked.asp?target=api%7Chooking%7CC%23. Take a look at it and maybe you'll be able to get a little farther.
Good Luck,
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Hi all:
I have a picturebox, and I want to dynamically show the selecting rectangle when I press mouse down and moving on the it.
How to do it?
|
|
|
|
|
One way to do it is to render the rectangle on a backbuffer each time the mouse is moved. This way you don't have to worry about erasing the rectangle properly.
Another way is to use the ControlPaint.DrawReversibleFrame() method, and erase the old rectangle by redrawing it before you draw then new rectangle.
|
|
|
|
|
Hi,
I am doing a multi threaded app using C#,i have 4 thread spanned for a particular task(searching a Central Reservation System),one of these 4 may take a long time and which affects over all performance of the search.
So wht should be done in this case,should the thread which is waiting for along time be killed and spanned again?? is it a good thing do be done.
Pls advice
TIA,
Sudheer.
|
|
|
|
|
You're not really providing much for us to go on here, but I'll give it a shot. I'm assuming that your 4 threads are reading data from the same data source so the first question is are you properly synchronizing access to that data source? Second, it seeems strange to me that one of your threads is taking longer than the others to complete its task. It sounds like you might have a Race Condition. Make sure that you are properly synchronizing access to your data source and that you're not letting two threads have the same exact data object to process (or use the same database resource simultaneously if your threads are accessing a database).
Good luck.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
I am process text files, opening parsing copying, deleting all base don what is inside.
I am running into to file contention at different points. I am using FileInfo objects to move, copy and delete the files. I believe it is the file Info object that is not releasing the file. I have even place the different file info object in different classes, methods hoping that when the fileinfo went out of scope it would release the file. Is there a release method that can be called to ensure the file info object lets go of the file?
Thanks
David23g
david23g
|
|
|
|
|
I don't see how. FileInfo doesn't acquire a file handle which means the file isn't opened. It uses Win32's FindFirstFile API which gets information based on the file without opening - basically information that is stored in the filesystem for that file's record.
I would make sure you're closing all your streams. The best way to make sure of this is:
Stream s = null;
try
{
s = new FileStream(...);
}
catch
{
}
finally
{
if (s != null) s.Close();
}
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
This is an excellent idea, thanks Heath I will give it a try.
|
|
|
|
|
A cornerstone of .NET is its compilation to an Intermediate Language and then further Just-In-Time compilation to binary code via the CLR. Can the compiler be forced to compile straight to machine code (as in pre .NET days) to produce an image that will run under a legacy OS which does not support a Common Language Runtime module ?
JB
|
|
|
|
|
jbrydon wrote:
an the compiler be forced to compile straight to machine code (as in pre .NET days) to produce an image that will run under a legacy OS which does not support a Common Language Runtime module ?
The answer is Yes and No, you can create a native image from your managed assembly, which will allow your application to run without the need of JIT compiling; however there are many issues that need to be considered before doing so. First off, the .NET Framework is still required even thought JIT does not occur. The image becomes dependant upon the version of .NET you are running, the CPU you are using, the operating system version and many others. If you are still curious, check out the Native Image Generator (Ngen.exe)[^] documentation.
-Nick Parker
DeveloperNotes.com
|
|
|
|
|
Does anyone know how to obtain the mac address of a remote computer without using WMI. The reason that I do not want to use WMI is because whenever I try to connect to the remote computer's WMI, if the computer is running NT 4.0, I get a Class Not Registered exception. I know that it can be done because the utility nbtstat -A[Remote IP] pulls the mac of a remote computer. I just don't know how to code it. I would really appreciate some help. Thanks.
Shaun
|
|
|
|
|
You could also use SNMP rather than the networking APIs. I've seen several examples of this. Either way, you're going to be redefining a lot of structures and P/Invoking a lot of functions. In any case, there's a little thing called google that comes in really handy. There's no pure way to do this in C#, but there's a ton of examples for C/C++ using various APIs like the Win32 networking API. I've seen many when searching for "MAC address". (hint hint)
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
You are right,Sorry.
I want to write a math program which displays on the screen a very large number of full quadrilateral shapes creating a mesh.
I find the cordinates of the four peaks for each shape and display it creating a mesh.
Next I calculate new cordinates for each shape and display a new mesh.
It happens continuously as faster as possible.
What is the fastest way to display i) a pixel ii) a full quadrilateral shape in C#?
|
|
|
|
|
Wait, is this some kind of trick question? I think some more details would be nice
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
I think that the fastest way would actually be to use C++ and write to the screen directly (I'm not even sure if Windows lets you do this, though). However, you can find several helpful tips on working with bitmaps/images using GDI+ here: http://www.syncfusion.com/FAQ/WinForms/FAQ_c3c.asp.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
I am logging events just fine for my Navigator application, however no matter what Event ID I pass to it I get the following message:
The description for Event ID ( 0 ) in Source ( Navigator ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer.
My question is what is necessary to create a message DLL. Is it just a DLL with enumerators for each Event ID I am going to use???
HELP!
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
You can add a log event source by using the static method EventLog.CreateEventSource (calling WriteEntry the first time will do this automatically, too). Then instantiate a new instance of the EventLog class, specifying the same source name in the constructor.
In order for event IDs to be resolved, you have to use the registry to add a key (see http://msdn.microsoft.com/library/en-us/debug/base/adding_a_source_to_the_registry.asp[^] for more details) that points to a native Win32 dll. The IDs match up with String resource IDs for the invariant or current language that the OS is using.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Does anyone know how to change the permissions or add a user to a particular registry key programmatically? I know you can do this manually with regedit so it follows that you should be able to do it programmatically. I just haven't seen any clear docs on how this might be accomplished with C#. I've looked at using the Registry functions in the framework, however, nothing stands out as a way to accomplish this. Any suggestions?
Thanks.
-Matt
p.s. I am trying to do this from an installer/deployment app.
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
perlmunger wrote:
I've looked at using the Registry functions in the framework, however, nothing stands out as a way to accomplish this. Any suggestions?
I suggest you read it again! Its all rather clear...
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Jerk!
Seriously though, all I see is information on reading the permissions, not changing them. Do you have particular links you can point me to?
-Matt
p.s. I'm surprised at you leppie. You've not been a smart ass when answering my questions before.
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Regards,
Hello every buddy, wishing all are coding greate(!) I have the following question:
Suppose following runtime invokation:
myInstance.getType().InvokeMember(aMember, BindingFlags.Public|BindingFlags.Instance|BindingFlags.GetField|BindingFlags.GetProperty, null, new object[] {});
If I execute this line while aMember is an inherited member property name of myInstance (not it's own) it works and returns the value.
Now if I call the same member and try to set the same member(inherited member property) it will throw an exception that 'Member not found'.
myInstance.getType().InvokeMember(aMember, BindingFlags.Public|BindingFlags.Instance|BindingFlags.SetField|BindingFlags.SetProperty, null, new object[] {newValueArray});
How can I fix this and set inherited properties of myInstance using Reflections?
Thank you
---
"Art happens when you least expect it"
|
|
|
|
|
BindingFlags.SetField|BindingFlags.SetProperty
Get rid of that!
and this:
BindingFlags.GetField|BindingFlags.GetProperty
its not needed!
But better, use the GetProperty() method rather. Also ALWAYS check the return member info 1st, more than off its null , and then bang BIG BADA BOOM!
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Thanks but:
If I get rid of 'BindingFlags.SetField|BindingFlags.SetProperty' then how can I set a property or field runtime using Reflection????
---
"Art happens when you least expect it"
|
|
|
|
|
Ok, thread is over!
About my last question I got it now, using PropertyInfo.SetValue()... Thanks but:
I made a mistake posting this thread start. Type.InvokeMember(... BindingFlags.SetField|BindingFlags.SetProperty...) DOES return and set inherited types, the mistake was that I was tryong to set aMember into other type value than it's own, so Such 'aMember' with that target type could not be found and null would be returned.
Thank you and sorry for the mistake,
-nSun
---
"Art happens when you least expect it"
|
|
|
|