I am trying to create an accessibility app that will type in multiple windows at once, neither of which are owned by my app. For instance, let's say you have two Microsoft word documents open. When you hit a keystroke I want the command to go to both windows.
I have tried using Quartz events services, but it looks like it will only allow you to post to events either on a global or process level. But if two windows are running for the same process, how do I post to a specific window?
There's also the issue of the person typing in one window, while the content is being copied to the next.
Is it possible to post to a single window?
PS I know it's possible to do this in Windows
MacOS X includes a few tools which may be helpful. You should look into the Accessibility framework, Automator actions, and AppleScript. You should also be aware of application-specific solutions; in the case of Word, for example, you might look at VBA (Visual Basic for Applications). All of these tools provide ways that you can modify the content of other applications. Unfortunately, the level of support for each one varies from one application to another, and the way they're used also varies. So, it's unlikely that you'll find a single solution that works for all applications.
It's unlikely that you'll find a way to insert events directly into another process's event queue. That'd be a huge security hole, for one thing. Even if you could do that, you really wouldn't be able to target specific windows with your events. Mac applications use a responder chain that sends keystrokes to the "first responder", usually a component of the active window.
Related
I want to send keys to other application with focusing on it with VB.NET. I want to be able to send a Keydown message and a KeyUp message. But without focusing on the application I want to send keys to.
The following example focuses on the application when it is sending the keys. I don't want that.
http://www.codeproject.com/Articles/18366/Sending-Keystrokes-to-another-Application-in-C
The reason for this is I want to be able to Login with 2 games/windows onto 1 server and play with both of them. I have macros keys so I can set them to run this code. which will for example move the character on the 2nd game window while I control the character on my 1st game window. Like send "W" to move the 2nd character forward.
Any help?
In a quick research (I bet you dit it as well), I haven't found it possible.
SendKey is a way to simulate inputs at OS level, and not application level.
A possible workaround
That said, one way you could accomplish that would be creating a Virtual Machine and then run your automation script on it, keeping the host OS free. I'm just affraid that depending of the resources required by the game your are running (3D renderization), the VM specs maybe won't fit.
(Since I hate answers as "you can't do that", I just found interesting to share this palliative)
How can I check from my cocoa Mac application whether an application (for example: Preview or iPhoto) exists on Mac?
I basically want to give the user an option to open an image using Preview, iPhoto but before doing that I would like to check whether these applications are present on the user's Mac.
Instead of checking for specific hard-coded applications, it'd be better to get a list of all applications that can handle the type of document you'll be passing to them. That way, if the user has installed, say, Acorn, it'll automatically show up without your having to add it to your hard-coded list.
There is also a way to do what you specifically asked for, but that is an inferior way to do what you really want to do, which is show the user all of their applications that can open the document.
Hi I've used the shockwave flash com object to embed my flash file. I have buttons you can click on within the flash movie. Is it possible to get flash to notify my winform app which button has been pressed. It's developed using actionscript3. I'm using the latest vb.Net.
You can either use FSCommand, or use ExternalInterface. The later is better, although it may be harder to understand at first because of the format it uses, although if you've already solved the CallFunction (or SendFunction?) method argument, it's the same.
There are documentation and a sample C# project in Adobe's site, but I don't know the exact URL.
EDIT: To catch FSCommand and ExternalInterface calls there are two events you can subscribe to.
Also, you could also use sockets (either binary or XML).
That's a very open question as there would be many ways to do this depending on how your website and winforms applications are setup.
My initial suggestion would be to have your flash movie call some client side javascript on the button clicks. The javascript could post to a .Net SOAP webservice for instance which logs the button interaction to an associated database. Then your winforms application could finally check the database for the presence of new button click records.
This is just one high level suggestion based on the very high level question asked. If there's more specific information available then this can be refined.
Brian.
Haven't found this in my search on Stackoverflow - I know I've seen a tool like it before, for obtaining control names or IDs in Windows apps which can then be used for reference in automated testing, in tools like AutoIt. Can anyone suggest one?
I've tried the OLE/COM Object Viewer and while it has control lists, there's no interactive method with it. Like the web developer toolkit in Firefox where you can click a control and get all the information about it, I'm after a similar app for Windows testing.
It's called Spy++.
Found the tool I wanted, either NUnitForms - which means you can use the NUnit Framework to access windows forms, and includes a Recorder tool for identifying the controls, as well as Managed Spy for giving the individual component names as well as every bit of other info - font, color, size. Very nice.
NUnitForms : http://nunitforms.sourceforge.net/
ManagedSpy: http://msdn.microsoft.com/en-us/magazine/cc163617.aspx
How would one go about capturing users keystrokes in the SMS composer on the Symbian OS, specifically for a Nokia N73 (or any of the symbian supported devices http://en.wikipedia.org/wiki/Symbian_OS#Devices_that_have_used_the_Symbian_OS)? I'm new to symbian development and I'm trying to write an application to analyse writing styles of those who send SMSs. Any information (or push in the right direction) would be great.
Many Thanks,
A
Actually, you can capture keystrokes destined for any application in Symbian OS.
RWindowGroup::CaptureKey() and RWindowGroup::CaptureLongKey() allow your executable to capture keys from any applicaton, whether yours is in the foreground or not.
However, in this case this may prove to be tedious - these two functions work by capturing specific key codes and modifier combinations, so you would have to set up a lot of captures to deal with all the key combinations in the SMS composer.
You would also have to pass the event on to the SMS composer once your exectuable had captured it. Whilst nominally possible using RWsSession::SendEventToWindowGroup() or TApaTask::SendKey(), there are complexities involved the events arrive in right order (i.e. key down, key event, key up) and behaviour of different FEPs (Front End Processors) for user input.
So whilst it is nominally feasible to do what you require as above, it would prove to be tedious to implement and test, bordering on the risky. If all you want to do is analyse writing style to collect data (rather than in a product app), you might be better off writing your own SMS composer - there are plenty of examples on the Forum Nokia web site of editors and SMS sending.
On a related note - is there an API that can detect all the keys being pressed at once as I stamp on my Symbian phone in frustration at its APIs? ;-)
Well, there are several levels to answering to your question.
The keystrokes are actually captured by the message editor application. So, either it provides an API to feed you all its keystrokes (you can look for one on http://forum.nokia.com. You'll find the message editor API but it will be mostly about re-using GUI controls and not what you're looking for) or you would need a transparent application of your own that stays in the foreground and captures keystrokes before feeding them back to whatever application happens to be right behind. Fortunately (for obvious security reasons), Symbian OS will not allow you to do the later.
You can, however, have your own application read messages when they are saved in the phone memory: when they are saved in the Draft folder or in the SMS Outbox.
The obligatory shameless plug: I would advise reading the messaging chapter of http://www.quickrecipesonsymbianos.com in order to understand how to use the Symbian Message Store
The classes of interest in your case are : CmsvEntry, CMsvSession, MMsvSessionObserver, CMsvOperation and CSmsClientMtm.