Jump to content


Photo

block input to virtual box window only


  • Please log in to reply
3 replies to this topic

#1 mrhobbeys

mrhobbeys
  • Members
  • 37 posts

Posted 23 May 2012 - 07:13 PM

I have a virtual box that I run scripts in mostly converting files or grabbing information from the web and putting it into excel sheets. As of right now I run my virtual box and then minimize it while I do other things with my computer. I would like to set the virtual box to seemless mode and be able to watch the scripts in action without disturbing them.

So is there a way to block input to a specific window? Has anyone tried this before?

Thanks

#2 LazyMan

LazyMan
  • Members
  • 450 posts

Posted 23 May 2012 - 10:03 PM

You could try hooking shell window activations, checking if your specific window was just activated, and then activating the Program Manager if so. :?:

#3 mrhobbeys

mrhobbeys
  • Members
  • 37 posts

Posted 25 May 2012 - 03:20 AM

I hate to take my own topic OT....

But that is sweet!!!! Show me more. I want some more stuff like experiment 4 in that post. I want to know more about what is going on in some windows!

#4 LazyMan

LazyMan
  • Members
  • 450 posts

Posted 25 May 2012 - 09:37 PM

I'm glad you found the link interesting. :D

I tried my suggestion for Notepad. It's not perfect, but perhaps it will suit your needs:

DllCall("RegisterShellHookWindow", UInt, A_ScriptHwnd)
MsgNum := DllCall("RegisterWindowMessage", Str, "SHELLHOOK")
OnMessage(MsgNum, "BlockInputFromNotepad")

Return

BlockInputFromNotepad(wParam, lParam)
{
   If ( wParam = 4 ) ; HSHELL_WINDOWACTIVATED
   {
      WinGetTitle Title, ahk_id %lParam%
      If ( Title = "Untitled - Notepad" )
            WinActivate Program Manager
   }
}