AutoHotkey Community

It is currently May 27th, 2012, 12:22 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: November 26th, 2008, 11:10 pm 
Offline

Joined: October 19th, 2008, 11:51 pm
Posts: 12
Hi All,
I'm just wondering if it's possible to blockinput to a specific application rather than to everything?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 27th, 2008, 12:53 am 
Offline

Joined: December 8th, 2006, 5:17 am
Posts: 248
Location: Sydney Australia
Probably. Look in the HELP for
#IfWinActive / #IfWinExist AND BlockInput

_________________
Paul O


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 27th, 2008, 7:41 pm 
Offline

Joined: April 4th, 2008, 8:15 pm
Posts: 538
Location: Canada
If you blockinput without options when the window is active, you won't be able to change focus (Unless you use Task Manager)

Make sure you can move the mouse :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 27th, 2008, 11:27 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
:!: :!: :!: To get the keys unblocked you will need to press CTRL & ALT & DELTE and open Task Manager :!: :!: :!:

This will block input on windows defined in If statement.
Just add and WinActive("your window and/or ahk_class or ahk_id or ahk_pid")
To block for the whole application you will need ahk_pid
Code:
Loop
{
   If (WinActive("AHK_class SciTEWindow")or WinActive("AHK_class ExploreWClass"))
      BlockInput, On
   Else
      BlockInput, Off
}

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 28th, 2008, 3:56 am 
To Block input to a certain Window,
use WinSet, Disable, ...
Code:
run, notepad
Winwait, ahk_class Notepad
WinSet, Disable, , ahk_class Notepad
MsgBox
WinSet, Enable, , ahk_class Notepad


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 28th, 2008, 7:41 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Z_Gecko wrote:
To Block input to a certain Window,
use WinSet, Disable, ...
Code:
run, notepad
Winwait, ahk_class Notepad
WinSet, Disable, , ahk_class Notepad
MsgBox
WinSet, Enable, , ahk_class Notepad


That is surely the best way. :)

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 1st, 2008, 12:56 am 
Offline

Joined: October 19th, 2008, 11:51 pm
Posts: 12
Thanks for all your suggestions.

The problem with this method:
Code:
run, notepad
Winwait, ahk_class Notepad
WinSet, Disable, , ahk_class Notepad
MsgBox
WinSet, Enable, , ahk_class Notepad


is that although it blocks input to a specific window and allows the user to use other windows, it seems to not allow any windowing operations to be performed within the code on the window that is disabled.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], chaosad, Exabot [Bot], jrav and 16 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group