Sign in to follow this  
Followers 0
calmnus

works in SciTE Script Editor, doesn't work as EXE

7 posts in this topic

This script runs perfectly from inside the Script editor. It launches Solitaire, makes it full screen, and sets it to always on top.

As soon as I convert it to and run the Executable, it only launches "Solitaire", it doesn't make it full screen or set it to Always on Top.

Anyone have any ideas? Am I doing something wrong, or does the EXE just not do full screen and always on top?

Thanks,

Opt("WinTitleMatchMode", -2)

Run("C:\WINDOWS\system32\sol.exe")

Run("C:\Program Files\Microsoft Games\Solitaire\Solitaire.exe")

Sleep(100)

WinSetOnTop("solitaire", "", 1 )

WinSetState("solitaire", "", @SW_MAXIMIZE)

Exit

Share this post


Link to post
Share on other sites



I think it might be your sleep command. It's generally not a good idea to sleep if you waiting for a window to load.

Instead of Sleep, Try WinWait.

So in this case:

WinWait("solitaire")

Share this post


Link to post
Share on other sites

Thanks,

I changed the "Sleep" to a "WinWait".

Still works when run from the Script Editor, but still doesn't work when converted to an EXE

Share this post


Link to post
Share on other sites

Run("C:\WINDOWS\system32\sol.exe","",@SW_MAXIMIZE)
WinWaitActive("Solitaire")
WinSetOnTop("Solitaire", "", 1 )


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

I used your code as follows with the winwait and it works both in scite and as an EXE.

Opt("WinTitleMatchMode", -2)
Run("C:\WINDOWS\system32\sol.exe")
Run("C:\Program Files\Microsoft Games\Solitaire\Solitaire.exe")
WinWait("solitaire")
WinSetOnTop("solitaire", "", 1 )
WinSetState("solitaire", "", @SW_MAXIMIZE)
Exit

Share this post


Link to post
Share on other sites

My guess is that he have two identical programs on different locations and im still not getting what win is he trying to maximize or to set on top flag if thet have identical win names?


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

ok, I'm an idiot.

I just realized what I was doing wrong.

I renamed my "solitaire.au3" file to "solLitaire.au3" (added an L in the middle) because when I was running from the script editor it was picking up "solitaire" in the title bar of the script editor and making it top most. The problem was, I was still converting "solitaire.au3" to an EXE instead of "solLitaire.au3". Once I figured out my mistake and converted the correct ".au3" file, the EXE worked as expected.

Thanks for all your help,

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