Jump to content

Make a window active


Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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!

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
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...