Jump to content

Running a script with Skin UDF causes buttons to be instantly clicked


Kira16651
 Share

Recommended Posts

Hello,

I'm trying to have a script run in the background and when I press a hotkey, it should start another script. This works just fine for other programs.

Now I tried to make one with some buttons using the Skin UDF (https://www.autoitscript.com/forum/topic/166535-skin-udf/) and whenever I press the hotkey, the window with the buttons is opened and it's like I instantly click the first button. No idea wheather this is because of the Skin UDF or not. I also noticed that the buttons aren't displayed when I press the hotkey.

I isolated the relevant code and added it in the example file.

The "test.exe" is supposed to run in the background. When you press {INS} on the keyboard the "menu.exe" should open. It opens the script without the buttons displayed and the first button i seen as instantly pressed.

When you run the "menu.exe" normally without using the hotkey it works just fine.

Any ideas?

test.zip

Edited by Kira16651
cleaned up example project
Link to comment
Share on other sites

Just found out that if i put the "test.exe" in the same folder as the "menu.exe" it works just fine.

HotKeySet("{INS}", "_RunMenu")

While True
WEnd

Func _RunMenu()
    Local $sMenuPath = @ScriptDir & "\menu.exe"
    Run($sMenuPath)
EndFunc

It doesn't work if i put it in the parent folder however.

HotKeySet("{INS}", "_RunMenu")

While True
WEnd

Func _RunMenu()
    Local $sMenuPath = @ScriptDir & "\menu\menu.exe"
    Run($sMenuPath)
EndFunc

So I still don't know why that happens or how to prevent that. Putting both executables in the same folder is a really bad option for this project that I would like to avoid if at all possible.

Oh and I tried using absolute pathing, but that changes nothing.

Edited by Kira16651
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...