Skip to content

Any alternative to setforeground.exe? #66

Answered by FuPeiJiang
ajkessel asked this question in Q&A
Discussion options

You must be logged in to vote

ahk_v2

replace

Run "`"" A_LineFile "\..\SetForeGroundWindow.exe`" " hWnd

with

Run "cmd /c echo DllCall(`"SetForegroundWindow`",`"Ptr`"," hWnd ")|`"" A_AhkPath "`" *",,"Hide"

ahk_v1

replace

Run % """" A_LineFile "\..\SetForeGroundWindow.exe"" " hWnd

with

Run % "cmd /c echo DllCall(""SetForegroundWindow"",""Ptr""," hWnd ")|""" A_AhkPath """ *",,% "Hide"

concepts:
AutoHotkey.exe * reads the code from stdin
example:

echo MsgBox 123|AutoHotkey64.exe *

the requirement is having a new process, a new process has to be an exe:
instead of compiling another SetForeGroundWindow.exe which won't be flagged/quarantined,
I'm gonna use AutoHotkey.exe to do the same thing: SetForegroundWindow https://l…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@micjoh
Comment options

@ajkessel
Comment options

Answer selected by ajkessel
Comment options

You must be logged in to vote
3 replies
@micjoh
Comment options

@micjoh
Comment options

@ajkessel
Comment options

Comment options

You must be logged in to vote
1 reply
@micjoh
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants