ControlClick from "Test Project"

Area for english topics
Antworten
Hooch604
Beiträge: 8
Registriert: Mo 28. Nov 2016, 03:30
Kontaktdaten:

ControlClick from "Test Project"

Beitrag von Hooch604 »

Hi, I found this IDE from searching google after I got tired of Scite. Amazing. Thank you very much for this work.

My issue:
When I test my project from within the editor it works fine, except, my ControlClick functions won't work at all. No errors, just no click. Same code ran from Scite or compiled exe works just fine.

Known issue?

-Shane (Hooch604)

ControlClick($hWnd, "", "[CLASSNN:Qt5QWindowIcon10]", "left", "1", "238", "58")
Benutzeravatar
ISI360
Administrator
Beiträge: 322
Registriert: Fr 11. Okt 2013, 13:06
Kontaktdaten:

Re: ControlClick from "Test Project"

Beitrag von ISI360 »

Hi!

Thanks for your feedback! ;)

Hmmm..i don´t think this problem comes from the ISN. The ISN "executes" your code with the same .exe as the Scite does.
For more details, please post your whole script or some running examples.
Hooch604
Beiträge: 8
Registriert: Mo 28. Nov 2016, 03:30
Kontaktdaten:

Re: ControlClick from "Test Project"

Beitrag von Hooch604 »

Thanks for the reply, below are the functions in question.

The purpose, toggle visual elements in my OBS Studio application (Twitch streaming).
I first was using hotkeys but I can only use so many of those when gaming so needed another method that would allow me to access controls without leaving focus of the game. ControlClick is the best I could come up with.

As I mentioned, it works quite nice from Scite or compiled exe, just nothing when executed from within the IDE. Which I get is weird as it should be no different then running a test execution through Scite.

I can work around it and test this particular function outside of the IDE but that will be a pain as the visuals that these controls are a part of are most of the functionality I am working on.

Code: Alles auswählen

;

Func showDolores()
   SoundPlay("C:\Users\Hue\Music\Dolores\sounds\acknowledgeBeep.mp3", 0)
   Local $hWnd = WinGetHandle("OBS 0.")
   Local $elementOffColor = 10000280
   Local $elementOnColor  = 14803169
   If WinExists($hWnd) Then

	  ;Dolores
	  Local $dColor = PixelGetColor(3127, 610)
	  if $dColor = $elementOffColor Then
		 ControlClick($hWnd, "", "[CLASSNN:Qt5QWindowIcon10]", "left", "1", "238", "58")
	  EndIf

	  ;Dolores BG
	  Local $bgColor = PixelGetColor(3127, 630)
	  if $bgColor = $elementOffColor Then
	     ControlClick($hWnd, "", "[CLASSNN:Qt5QWindowIcon10]", "left", "1", "238", "78")
	  EndIf

   EndIf
EndFunc

;

Func hideDolores()
   SoundPlay("C:\Users\Hue\Music\Dolores\Sounds\xindi_controls02.mp3", 0)
   ;sleep(500)
   Local $hWnd = WinGetHandle("OBS 0.")
   Local $elementOffColor = 10000280
   Local $elementOnColor  = 14803169
   If WinExists($hWnd) Then

	  ;Dolores
	  Local $dColor = PixelGetColor(3127, 610)
	  if $dColor = $elementOnColor Then
		 ControlClick($hWnd, "", "[CLASSNN:Qt5QWindowIcon10]", "left", "1", "238", "58")
	  EndIf

	  ;Dolores BG
	  Local $bgColor = PixelGetColor(3127, 630)
	  if $bgColor = $elementOnColor Then
	     ControlClick($hWnd, "", "[CLASSNN:Qt5QWindowIcon10]", "left", "1", "238", "78")
	  EndIf

   EndIf
EndFunc
Benutzeravatar
ISI360
Administrator
Beiträge: 322
Registriert: Fr 11. Okt 2013, 13:06
Kontaktdaten:

Re: ControlClick from "Test Project"

Beitrag von ISI360 »

Hmm..can you test the following: Enable "start autoit scripts via the autoit3wrapper" in the setings of the ISN. (Settings -> Script Editor)

Maybe this helps.

Or you can try inserting #RequireAdminin in the startline of your script.
Hooch604
Beiträge: 8
Registriert: Mo 28. Nov 2016, 03:30
Kontaktdaten:

Re: ControlClick from "Test Project"

Beitrag von Hooch604 »

You nailed it with #requireadmin

I had never actually seen that "keyword" before (coding autoit since 2002)

Thank you very much for the help, and again, thank you for this tool. So nice. You have definitely improved my autoit quality of life :)

-Shane
Benutzeravatar
ISI360
Administrator
Beiträge: 322
Registriert: Fr 11. Okt 2013, 13:06
Kontaktdaten:

Re: ControlClick from "Test Project"

Beitrag von ISI360 »

You're welcome! ;)
I'm happy, that you like my work!
Antworten