Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Settings
- Const $ED_Windowname = "Elite - Dangerous (CLIENT)"
- Const $WinBorderWidth = -8 ;pixels
- Const $WinBorderHeight = -30 ;pixels
- Const $TargetX = -1920 + $WinBorderWidth
- Const $TargetY = 0 + $WinBorderHeight
- Const $CheckEvery = 500 ;ms
- ; Inits
- Opt("WinTitleMatchMode", 3)
- HotKeySet("#{BACKSPACE}", "Terminate") ;Win+Backspace hotkey to quit the script
- $OnTop = False
- While 1
- Sleep($CheckEvery)
- Main()
- WEnd
- Func Main()
- If WinActive($ED_Windowname) Then
- ; Check current window position, reposition if not at target coordinate
- $Current_Window_Position = WinGetPos($ED_Windowname)
- If ($Current_Window_Position[0] <> $TargetX) Or ($Current_Window_Position[1] <> $TargetY) Then
- WinMove($ED_Windowname, "", $TargetX, $TargetY)
- EndIf
- ; Set window to on top if active
- If Not $OnTop Then
- If WinSetOnTop($ED_Windowname, "", 1) Then
- $OnTop = True
- EndIf
- EndIf
- Else
- ; Set window to NOT on top if not active
- If $OnTop Then
- If WinSetOnTop($ED_Windowname, "", 0) Then
- $OnTop = False
- EndIf
- EndIf
- EndIf
- EndFunc ;==>Main
- Func Terminate()
- Exit
- EndFunc ;==>Terminate
Advertisement
Add Comment
Please, Sign In to add comment