Sign in to follow this  
Followers 0
Grantson

Unable to interact with active window

3 posts in this topic

Hi Guys

Im running an application on my laptop to interface with an SLR camera

i need to trigger the camera remotely, so as a temporary solution i wanted to use my laptops remote

pressing enter on the remote sends a left mouse-click to the active control but as the controls in the app grey out while the camera is taking the picture the capture button wont stay active.

I wrote a small script to create a form with a single button, when the button is pressed it makes the camera software the active window, presses the capture button then sets itself back to the active window

the problem i have is no matter how I try and press the capture button nothing happens

in my last attempt i even tried sending a mouseclick to the co-ordinates of the button but...

the window activates, the mouse doesnt move, nothing happens then after the 5 second delay the form from my script pops back up

also sending the shortcut key does nothing,

My laptop is running windows 7 if that makes any difference,

does anyone have any ideas what could be going on?

Share this post


Link to post
Share on other sites



#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Capture", 260, 158, 192, 124)
$btnCapture = GUICtrlCreateButton("&Capture", 8, 8, 249, 137)
Opt("SendKeyDownDelay", 100)
GUISetState(@SW_SHOW)
ControlFocus("Capture","",3)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $btnCapture
            WinActivate("GBTimelapse")
            ;WinWaitActive("GBTimelapse")
            MouseClick("left",179,78,1)
            ;ControlClick("GBTimelapse","",67268)
            ;send("{F5}")
            sleep(3000)

WinActivate("Capture")
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

if i uncomment the winwaitactive line gbtimelapse becomes the active window then the scrips pauses to wait and waits indefinitely

either using mouseclick or send to send f5 which is the shortcut key for the capture button does nothing

then after the 3 second delay my form reappears

Share this post


Link to post
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
Sign in to follow this  
Followers 0