Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Send the space bar to window but keep it inactive
#1
My windows is identified like this.

int w=win("Hurricane Sandy Blows Wild Wind.f4v - VLC media player" "QWidget")

I want to send the space (space bar) key to the window (I guess to the variable "w") but I don't want to activate(bring it to the front) the window.

any body have some ideas on how?

Thanks
#2
Try function SendKeysToWindow.
It is here: pasting to notepad (when notepad is in background)
#3
Is SendKeysToWindow a function you or someone wrote with the program commands or is it a Quick Macro function? When I try to use it I get this message – mesg2.png. Are you saying that it has to be written as a function in your code first, than you can use it? Are there any more examples you can show? I am taking it that you have to have pre-written SendKeysToWindow but I want to be clear. If the functions are being written first what is the relation to hwnd or is that just what you are naming them?


Attached Files Image(s)
       
#4
Need to create function with this name and copy/paste code from forum. Read here: Tips: QM code in the forum (colors, functions, dialogs, etc)

Your macro is possibly correct, but make sure that the child window is correct. It must be the same child window that is focused when the window is active. Can use this macro to capture focused child window.
Macro CaptureFocusedControl
Trigger CSAj     Help - how to add the trigger to the macro
Code:
Copy      Help
;Make the target window active and the child window focused. Then run this macro (Ctrl+Alt+Shift+J).
;It creates code to find the focused child window. Copy it from QM output and paste in macro where need.


RecGetWindowName child &_s
out F"int hwnd={_s}"

SendKeysToWindow works with most windows, but not with all. May not work with many games because often they use some nonstandard method to get pressed keys.

At first try this: Make the target window active and the child window focused. Run this macro. If it does not work, SendKeysToWindow cannot be used.
Code:
Copy      Help
int hwnd=child ;;the focused child window
SendKeysToWindow hwnd key(V)


Forum Jump:


Users browsing this thread: 1 Guest(s)