inactive window

Get help with using AutoHotkey and its commands and hotkeys
xWojtal
Posts: 2
Joined: 27 May 2019, 07:45

inactive window

27 May 2019, 08:02

This code work in 100% but now I need this script to work in an inactive window. Name this window is bot1. Can someone help me im new. Sry for me english.


Code: Select all

^1::
 
 {
	Loop
    {	
		{
		sendinput {Lshift down}
		sendinput {LButton down}
		sleep 300000
		sendinput {LButton up}
		sendinput {Lshift up}
		}
		
		{
		sleep 5000
		sendinput {/}
		sleep 100
		sendinput {c}
		sleep 100
		sendinput {x}
		sleep 100
		sendinput {Enter}
		}
		
		{
		sleep 200
		sendinput {e down}
		sleep 20
		sendinput {e up}
		sleep 100
		MouseMove, -140, 10 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		sendinput {RButton down}
		sendinput {RButton up}
		sleep 200
		MouseMove, -80, 0 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		MouseMove, 100, 0 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		sendinput {RButton down}
		sendinput {RButton up}
		sleep 200
		MouseMove, -100, 0 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		sendinput {esc down}
		sleep 100
		sendinput {esc up}
		}
		
		{
		sendinput {Lshift down}
		sendinput {LButton down}
		sleep 270000
		sendinput {LButton up}
		sendinput {Lshift up}
		}
		
		{
		sleep 5000
		sendinput {/}
		sleep 100
		sendinput {c}
		sleep 100
		sendinput {x}
		sleep 100
		sendinput {Enter}
		}
		
		{
		sleep 200
		sendinput {e down}
		sleep 20
		sendinput {e up}
		sleep 100
		MouseMove, -140, 10 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		sendinput {RButton down}
		sendinput {RButton up}
		sleep 200
		MouseMove, -80, 0 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		MouseMove, 100, 0 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		sendinput {RButton down}
		sendinput {RButton up}
		sleep 200
		MouseMove, -100, 0 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		sendinput {esc down}
		sleep 100
		sendinput {esc up}
		}
	 
		{
		sendinput {Lshift down}
		sendinput {LButton down}
		sleep 300000
		sendinput {LButton up}
		sendinput {Lshift up}
		}
		
		{
		sleep 5000
		sendinput {/}
		sleep 100
		sendinput {c}
		sleep 100
		sendinput {x}
		sleep 100
		sendinput {Enter}
		}
		
		{
		sleep 200
		sendinput {e down}
		sleep 20
		sendinput {e up}
		sleep 100
		MouseMove, -140, 10 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		sendinput {RButton down}
		sendinput {RButton up}
		sleep 200
		MouseMove, -80, 0 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		MouseMove, 100, 0 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		sendinput {RButton down}
		sendinput {RButton up}
		sleep 200
		MouseMove, -100, 0 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		sendinput {esc down}
		sleep 100
		sendinput {esc up}
		}
		
		
		{
		sendinput {Lshift down}
		sendinput {LButton down}
		sleep 270000
		sendinput {LButton up}
		sendinput {Lshift up}
		}
		
		
		{
		sleep 5000
		sendinput {/}
		sleep 100
		sendinput {c}
		sleep 100
		sendinput {x}
		sleep 100
		sendinput {Enter}
		}
		
		{
		sleep 5000
		sendinput {/}
		sleep 100
		sendinput {c}
		sleep 100
		sendinput {x}
		sleep 100
		sendinput {Enter}
		}
	
		{
		sleep 4000
		sendinput {d down}
		sleep 2000
		sendinput {d up}
		sleep 200
		sendinput {RButton down}
		sendinput {RButton up}
		sleep 300
		MouseMove, -140, 130 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		MouseMove, 30, -200 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		MouseMove, 0, 200 , 25, R
		sendinput {RButton down}
		sendinput {RButton up}
		sleep 200
		MouseMove, 100, -190 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		MouseMove, 120, 0 , 25, R
		sendinput {1 down}
		sendinput {1 up}
		sleep 200
		MouseMove, -120, 0 , 25, R
		sendinput {Lshift down}
		sleep 200
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		sendinput {Lshift up}
		sleep 200
		MouseMove, -130, 80 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		sendinput {RButton down}
		sendinput {RButton up}
		sleep 200
		MouseMove, -80, 0 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		MouseMove, 100, 0 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		sendinput {RButton down}
		sendinput {RButton up}
		sleep 200
		MouseMove, -100, 0 , 25, R
		sendinput {LButton down}
		sendinput {LButton up}
		sleep 200
		sendinput {esc down}
		sleep 100
		sendinput {esc up}
		sleep 100
		sendinput {a down}
		sleep 2000
		sendinput {a up}
		}
		
		
	}
	return
 }
 
^2::
 {
	pause
 }
[Mod note: [code][/code] tags added.]
Albireo
Posts: 864
Joined: 16 Oct 2013, 13:53

Re: inactive window

27 May 2019, 13:36

Welcome to AHK!
You must know the Hwnd or WinID or.. for the window you want to use.
Then you must to know the name of the controller you want to control.
Check first with the AHK-program Window Spy and get the ClassNN values and some more information.
After that you can use WinGet to get the specified window's unique ID.... (it's new values every time you run your AHK- program)

When you have control of all this, the you can use ControlSend.
Mouse move and right clic… on a hidden window - You must use other instructions eg. ControlClick
xWojtal
Posts: 2
Joined: 27 May 2019, 07:45

Re: inactive window

27 May 2019, 14:24

Albireo wrote: Welcome to AHK!
You must know the Hwnd or WinID or.. for the window you want to use.
Then you must to know the name of the controller you want to control.
Check first with the AHK-program Window Spy and get the ClassNN values and some more information.
After that you can use WinGet to get the specified window's unique ID.... (it's new values every time you run your AHK- program)

When you have control of all this, the you can use ControlSend.
Mouse move and right clic… on a hidden window - You must use other instructions eg. ControlClick
That's the my Win spy can you give me straight template with WinGet and some ControlSend. And thank you for trying to help me.

Image
Attachments
Win spy.jpg
Win spy.jpg (32.73 KiB) Viewed 365 times
Albireo
Posts: 864
Joined: 16 Oct 2013, 13:53

Re: inactive window

27 May 2019, 16:39

Do as follows to get the windows "WinID" / "Hwnd"

This example shows how to get Hwnd for the program Notepad
1)AHK starts the program Notepad
2)Waiting for Notepad to activate
3)Show information about Notepad
WinID - Notepad


This example shows how to get Hwnd for the Active program.
1) Start this AHK-program
2) Activate the program you want to get info about.
3) Press Alt + 3
4) Now you get some values ​​about the activated program
Show program info
Maybe you can do this to get Hwnd from your program

Code: Select all

WinGet Hwnd1, ID, ahk_class AAAA
MsgBox % Hwnd1
Usually works. (if not try another WinTitle)
But you have a bigger problem. The control box is empty (under the header .: Control Under Mouse position ).
You can't use the instruction ControlSend … (I have no solution for you)

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], MSN [Bot], TAC109, torks and 179 guests