Jump to content

Program appears to use Windows API but doesn't...?


Recommended Posts

Maybe I am not understanding something, but I'll ask.. how exactly is that supposed to help me? As you can see, I can get the info for this program (WM Capture) just fine. It's the fact that when I try to write some script for WM Capture, the code isn't working at all. Even something easy like I mentioned such as a simple WinActivate.

Link to comment
Share on other sites

tp9191,

I can't seem to do anything with it.

Led me to believe that you were talking about the info tool. I see that you have the info for the "window". Maybe if you post your script someone can spot something.

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

There should be some error checking.

F12 is often already used by other tasks.

Change F12 to F9 and it will do the job. Hopefully.

$FX = "{F12}"
;$FX = "{F9}" ; uncomment this line to set Hotkey to F9
If HotKeySet("{ESC}", "_Hotkey") = 0 Then Exit MsgBox(16 + 262144, "Hotkeyset Error", "Hotkey {ESC} already set.")
If HotKeySet($FX, "_Hotkey") = 0 Then Exit MsgBox(16 + 262144, "Hotkeyset Error", "Hotkey " & $FX & " already set.")
Func _Hotkey()
    Switch @HotKeyPressed
        Case "{ESC}"
            Exit MsgBox(262144, " ", "Exit", 0)
        Case $FX
            $return = WinActivate("[CLASS:#32770;REGEXPTITLE:WMCap]")
            If Not $return Then Exit MsgBox(262144, " ", "WinActivate failure.", 0)
            $return = ControlClick("[CLASS:#32770;REGEXPTITLE:WMCap]", "", "[CLASS:Static; INSTANCE:6]")
            If Not $return Then MsgBox(262144, " ", "ControlClick instance #6 failure. Now we try #1", 0)
            $return = ControlClick("[CLASS:#32770;REGEXPTITLE:WMCap]", "", "[CLASS:Static; INSTANCE:1]")
            If Not $return Then Exit MsgBox(262144, " ", "ControlClick instance #1 failure.", 0)
            Exit MsgBox(262144, " ", "Congratulation. You got it.", 0)
    EndSwitch
EndFunc   ;==>_Hotkey

While 1
    MsgBox(262144, " ", "Press " & $FX & " or ESC", 2)
    Sleep(3000)
WEnd
Edited by Exit

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

Well, for some reason I got the WinActivate part to work when I changed "WMCap" to "WM Capture". "WM Capture" is what shows in the windows taskbar so I thought I'd give it a try and it worked.

Now, why would that work if it's not what is shown in the Autoit Info Tool?

I still have no luck on getting the ControlClick to work though :(

HotKeySet ( "{F2}", "F2" )
HotKeySet ( "{ESC}", "Terminate" )

While 1
Sleep(100)
WEnd

Func F2()
WinActivate ("WM Capture")
Sleep (500)
ControlClick ("WMCap", "", "[CLASS:Static; INSTANCE:6]")
EndFunc

Func Terminate()
Exit 0
EndFunc
Edited by tp9191
Link to comment
Share on other sites

It is possible that there is a "hidden" window or one that is off screen that the software developer uses for other operations. I have done that before. And it probably uses the same window title. If you winactivate and see that your window actually LOSES focus... then that is probably what is happening.

Lar.

f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Link to comment
Share on other sites

It is possible that there is a "hidden" window or one that is off screen that the software developer uses for other operations. I have done that before. And it probably uses the same window title. If you winactivate and see that your window actually LOSES focus... then that is probably what is happening.

Lar.

Wow... what the heck.... I've been waiting for days for an email notification of this topic update and it never came!

Anyhow, before your post, I had came back to say that I found the hidden window that resides in the left top corner of the screen.

It has a title of: WM Capture

And the Class says: Afx:00400000:0:00010011:00000010:D7040191

I managed to get the WinActivate to work, but for the life of me, I CANNOT get it to ControlClick to activate the Record button! I've tried several combinations following the examples in the help file.. and probably many of which are likely not even valid...

Can someone please download the program and/or help me out here?

Sorry, cannot debug further since i have no WM-Capture installed.

But your finding was incorrect:

Congratulations I got it. is wrong.

Congratulation. You got it. would be OK. :thumbsup:

Well, as it was, the code was extremely basic that i feel this was a big waste of time. >_<

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