Not Sending

11/25/2010 15:05 BlowFish#1
Hi there, I am trying to Send or ControlSend to a program but it appears to be 'blocked'. Is there a way round this in Autoit?

The logic and syntax are fine as it works OK sending to Notepad.

Tearing my hair out :(
11/25/2010 15:28 maxi39#2
#RequireAdmin ??
11/25/2010 15:48 BlowFish#3
Quote:
Originally Posted by maxi39 View Post
#RequireAdmin ??
Good point! I can now send keys and they are arriving at the control in the game but it seems to lock everything up except the keys being sent. I wonder if it has some sort of protection built in. Any other ideas gratefully received.
11/25/2010 16:54 BlowFish#4
It's strange if you run as admin and do pretty much anything with the window (including WinActivate it) it seems to stop updating the screen.
11/25/2010 17:09 }{exer#5
AIT is not good for Bots/Sending to Game Windows.
Write your Progg in C++
The most Games are protect for this and AIT isnt powerful enough
11/25/2010 17:20 lolkop#6
Quote:
Originally Posted by }{exer View Post
AIT is not good for Bots/Sending to Game Windows.
Write your Progg in C++
The most Games are protect for this and AIT isnt powerful enough
so how do you do it in c++?
guess u've found a secred, unknown, ultimate function to send keys?

normally send should be the most secure method to send keys...
if autoit's send fails, sendmessage, postmessage, etc will fail even more. in that case it have to be realized with codecaves in the target process.

and btw its autoit not ait!
11/25/2010 17:31 }{exer#7
ahhhhhh autoit not ait *laugh
heavy mistake ^^ LoL
now iam cursed

... and ait will be blocked at certain Windows cause using a Shield.
Cpp got free way at all !!!
11/25/2010 17:34 lolkop#8
Quote:
Originally Posted by }{exer View Post
ahhhhhh autoit not ait *laugh
heavy mistake ^^ LoL
now iam cursed

... and ait will be blocked at certain Windows cause using a Shield.
Cpp got free way at all !!!
...
if you don't know what u're talking about, you should just ****...
11/26/2010 09:27 BlowFish#9
I managed to get things working sort of. If I start the AIT executable (as admin) before running the game it works. It's odd as it doesn't seem to be explicitly trying to block stuff.

The attraction of AIT over 'real programming' is that it is really quick and easy to knock up something basic.

As a side question how does logitech's stuff compare? Is that executed at the keyboard driver level?
11/26/2010 13:15 PenGuin :O#10
Quote:
Originally Posted by BlowFish View Post
IAs a side question how does logitech's stuff compare? Is that executed at the keyboard driver level?
I guess, yes cause there's no other solution..
11/27/2010 09:48 Kamyshin#11
hmmm you can try KeySend as well
PHP Code:
send single keyboard event to non active window
event presseddownup
kdown key down delay
notesupports only lower case keys NUMxFxsome special keys and @
Func KeySend($inkey$evt ="pressed"$kdown 50)
    
$user32 DllOpen("user32.dll")
    if 
$user32 = -1 Then
        ConsoleWrite
("KeySend: cannot open user32.dll")
        Exit
    EndIf
        
    ; 
handling for special keys
    
Switch StringUpper($inkey)
    Case 
"@"
        
$skey 0x40
        $lparam 
0x00100001
        DllCall
($user32"int""PostMessage""hwnd"$hwnd"int"$WM_KEYDOWN"int"0x71"int"$lparam)
        
DllCall($user32"int""PostMessage""hwnd"$hwnd"int"$WM_CHAR"int"$skey"int"$lparam)
        
Sleep(20)
        
DllCall($user32"int""PostMessage""hwnd"$hwnd"int"$WM_KEYUP"int"0x71"int"BitOR($lparam0xC0000000))        
    Case 
"F1""F2""F3""F4""F5""F6""F7""F8""F9""F10""F11""F12"
        
$skey 0x6f Int(StringMid($inkey2)) 
        
ContinueCase
    
Case "NUM0""NUM1""NUM2""NUM3""NUM4""NUM5""NUM6""NUM7""NUM8" "NUM9"
        
if StringUpper(StringLeft($inkey3)) = "NUM" Then
            $skey 
0x60 Int(StringMid($inkey4)) 
        EndIf
        
ContinueCase
    
Case "RETURN""SPACE""TAB""BACK""END""HOME""SNAPSHOT""INSERT""DELETE""LEFT""RIGHT""UP""DOWN"
        
Switch StringUpper($inkey)
        Case 
"RETURN"
            
$skey 0x0D
        
Case "SPACE"
            
$skey 0x20
        
Case "TAB"
            
$skey 0x09
        
Case "BACK"
            
$skey 0x08
        
Case "END"
            
$skey 0x23
        
Case "HOME"
            
$skey 0x24
        
Case "SNAPSHOT"
            
$skey 0x2c
        
Case "INSERT"
            
$skey 0x2d
        
Case "DELETE"
            
$skey 0x2e
        
Case "LEFT"
            
$skey 0x25
        
Case "RIGHT"
            
$skey 0x27
        
Case "UP"
            
$skey 0x26
        
Case "DOWN"
            
$skey 0x28
        
EndSwitch
        
$ret DllCall($user32"int""MapVirtualKey""int"$skey"int"0)
        
$lparam BitShift($ret[0], -16)
        
$lparam BitOr($lparam1)
        
DllCall($user32"int""PostMessage""hwnd"$hwnd"int"$WM_KEYDOWN"int"$skey"int"$lparam)
        
Sleep($kdown)
        
DllCall($user32"int""PostMessage""hwnd"$hwnd"int"$WM_KEYUP"int"$skey"int",   BitOR($lparam0xC0000000))
    Case Else ; default 
lower case key handling
        $key 
DllCall($user32"int""VkKeyScan""int"Asc(StringLower($inkey)))
        
$skey $key[0]        
        
$ret DllCall($user32"int""MapVirtualKey""int"$skey"int"0)
        
$lparam BitShift($ret[0], -16)
        
$lparam BitOr($lparam1)
        
Select
        
Case $evt "pressed"
            
DllCall($user32"int""PostMessage""hwnd"$hwnd"int"$WM_KEYDOWN"int"$skey"int"$lparam)
            
Sleep($kdown)
            
DllCall($user32"int""PostMessage""hwnd"$hwnd"int"$WM_KEYUP"int"$skey"int",   BitOR($lparam0xC0000000))
        Case 
$evt "down"
            
DllCall($user32"int""PostMessage""hwnd"$hwnd"int"$WM_KEYDOWN"int"$skey"int"$lparam)
        Case 
$evt "up"
            
DllCall($user32"int""PostMessage""hwnd"$hwnd"int"$WM_KEYUP"int"$skey"int",   BitOR($lparam0xC0000000))
        
EndSelect        
    
EndSwitch

    
DllClose($user32)
EndFunc