Jump to content

What ctrl to ControlSend() to for app in System Tray?


Recommended Posts

I've got a third-party video recording app idling away in the system tray (as it should be), just waiting for a command sequence (e.g., "CTRL+ALT+R") to begin recording.  When I'm recording manually, I simply press the command sequence on the keyboard to get it going, without having to manually activate/raise the idling process/window.

I'm writing a script to send that sequence programmatically, but I can't figure out where and how to send it!  I know I should use ControlSend(), and I can specify the third-party app's title as the first parameter, but I'm utterly baffled about what ControlID I need to use.  For a normal app, I would use Au3Info.exe to identify the control, but since the app is idling in the system tray, I can't figure out any way to use Au3Info on it.

So, how do I determine what ControlID to use in the ControlSend() call?

Thanks!

[ETA: Or perhaps I should do it some other way, one that doesn't need a controlID?]

(By the way, I found some code generously provided by poster war59312 (here), that will return the index number of the sys tray app I'm interested in, but I can't see how that would help me. I suppose that since pressing the sequence is all I need to do when doing this manually, maybe I could send it to Explorer, but I still don't know what ControlID to use.)

Edited by Mbee
Link to comment
Share on other sites

Thanks for your response, kylomas!

Maybe the app is monitoring the keyboard, but somehow that doesn't seem likely, since it's just sitting idly in the system tray and is hardly foremost.   If I open a text editor or notepad, what I type is entered there normally (and is not redirected).

And yes, I've tried Send(), but no matter which window I try to activate and send the control sequence to, it never works.

But please see my next post for a different approach (that I still need help with)...

Mbee,

This app is probably monitoring the keyboard for your key sequence and has nothing to do with a particular control.  Have you tried using Send()?

kylomas

Link to comment
Share on other sites

Thanks, somdcomputerguy.  But because of the way the third-party app was designed, it only accepts the command sequence if it's idling in the system tray.  If I raise/activate it, it switches into a different operational mode which ignores the sequence no matter how it's entered.  I'm obviously just have to give up on trying to send the sequence to a control at all.

Maybe you could just maximize the the app and find out with au3info what the window class is, or the controlid of the menu bar or something..

Link to comment
Share on other sites

[EDITED: Since the topic has changed, I'm going to create a new thread to ask the modified question.]

See:

 

It's now clear that it's pointless trying to use either ControlSend() (because I can't specify a control) or Send() (because I can't activate the app's window and still keep it running in the only mode that works).

Instead, it's almost certainly a hotkey situation with universal (system-wide) scope.  The third-party app must do something like register a hotkey and waits in the system tray until some part of the operating system recognizes that the hotkey has been pressed and triggers the app to start recording.

So now the question becomes, how do I submit the control sequence such that it activates the hotkey?  My googling has only found posts relating to setting up and working with internal hotkeys within a given AutoIt script, and nothing about how to trigger an external, system-wide hotkey.

Or perhaps there's some way of making it look to the OS as a whole that the sequence was actually typed on the keyboard?

I'm stumped!

Edited by Mbee
Link to comment
Share on other sites

Thanks, somdcomputerguy.  But because of the way the third-party app was designed, it only accepts the command sequence if it's idling in the system tray.  If I raise/activate it, it switches into a different operational mode which ignores the sequence no matter how it's entered.  I'm obviously just have to give up on trying to send the sequence to a control at all.

I guess I wasn't specific enough, but what I meant was to maximize/restore it so you could view it with the au3info tool, get whatever info may help you resolve this, and then send it back into the tray. Is there a forum for this application, where maybe somebody has or had a similar situation?

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
Share on other sites

Yes, somdcomputerguy, I knew exactly what you meant, thanks.  But it simply does not work!  There absolutely IS no relevant control while the window is raised that I can send anything to in that mode.

I guess I wasn't specific enough, but what I meant was to maximize/restore it so you could view it with the au3info tool, get whatever info may help you resolve this, and then send it back into the tray. Is there a forum for this application, where maybe somebody has or had a similar situation?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...