Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Make a window active


  • Please log in to reply
2 replies to this topic

#1 Newbie1

Newbie1

    Seeker

  • New Members
  • 7 posts

Posted 25 July 2007 - 12:50 PM

Hi,

I bought one of these controller for my carPC, and it works very good except I'd like it to have the ability to control 2 windows. What I'd like AutoIT to do is, based on keyboard shortcut, it brings either window active. This is what I have:

http://www.logitech.com/index.cfm/mice_poi...mp;languageid=1

For my carPC application, I have Centrafuse for the frontend, and I use iGuidance for navigation. I use Skinbedder to overlay iGuidance on the Centrafuse window.

I'd much appreciate your assistance.







#2 PsaltyDS

PsaltyDS

    Most Venerable Penguin

  • MVPs
  • 13,279 posts

Posted 25 July 2007 - 02:06 PM

Hi,

I bought one of these controller for my carPC, and it works very good except I'd like it to have the ability to control 2 windows. What I'd like AutoIT to do is, based on keyboard shortcut, it brings either window active. This is what I have:

http://www.logitech.com/index.cfm/mice_poi...mp;languageid=1

For my carPC application, I have Centrafuse for the frontend, and I use iGuidance for navigation. I use Skinbedder to overlay iGuidance on the Centrafuse window.

I'd much appreciate your assistance.


Look in the help file for HotKeySet(), WinSetState(), and WinActivate(). Run the demo scripts from the help file for those commands to get an idea of how to use them.

:)
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

#3 ssubirias3

ssubirias3

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 355 posts

Posted 27 July 2007 - 04:59 PM

Look in the help file for HotKeySet(), WinSetState(), and WinActivate(). Run the demo scripts from the help file for those commands to get an idea of how to use them.

:)

PsaltyDS - I provided Newbie1 with the following code that included the HotKetSet() commands but I'm guessing its not doing what he needs. I can't imagine this not working for him if he simple modified the code from notepad to his specific application. Maybe some of the guys here can review my code and provide some feedback. thanks!

I'm probably the least qualified to suggest an idea muchless provide the code to accomplish the idea, but I know your pain in trying to figure things out you know should be pretty easy. Based on what I read your problem was:
I'm thinking if you get the handles for each of the 2 windows and set up hotkeys in your script that would call functions and activate the correct window before sending the key combination ... that could work. That way no matter what window is active, pressing CTRL+F or the UP key will ensure those commands are sent to the right window. Here's what I think it might look like if you were trying to send to two notepad windows. This should work for you and you could even use the ControlSend ( "title", "text", controlID, "string" [, flag] ) if you'd rather. Good luck hope it helps!

AutoIt         
Opt("WinTitleMatchMode",4) HotKeySet("^F", "SkipSong") HotKeySet("{UP}", "ZoomIn") $handle_Skip = WinGetHandle("classname=Notepad", "SkipSong Window") $handle_Zoom = WinGetHandle("classname=Notepad", "ZoomIn Window") MsgBox(0,"status","Skip handle = " & $handle_Skip & @CR & "Zoom handle = " & $handle_Zoom)  ;; <==== Remove - used for seeing handle values While 1     Sleep(100)  WEnd Func SkipSong()     WinActivate($handle_Skip)     Send("Pressing CRTL+F Skips Song" & @CR)  ;; <==== Remove - used for testing     ; Send("^F")  ;; <==== note that au3 is case sensitive so this will be sending CTRL+<capital f> EndFunc Func ZoomIn()     WinActivate($handle_Zoom)     Send("Pressing the UP key Zooms In" & @CR)  ;; <==== Remove - used for testing     ; Send("{UP}") EndFunc

Btw, this of course require one to have the following set up before running the script. a. open two notepad windows, b. in one notepad window type "SkipSong Window" and the second type "ZoomIn Window", c. run the script.

Thanks for the feedback! --ss3
...

Edited by ssubirias3, 27 July 2007 - 05:02 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users