topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 2:57 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Send key or run app/function when window gets/loses focus or is hovered on  (Read 6335 times)

tmpusr

  • Member
  • Joined in 2005
  • **
  • Posts: 154
  • Instantiation stuck in meatspace with no backup
    • View Profile
    • Donate to Member
Features:

-Action just by having the cursor enter/leave the window or clicking
-Send key combo
-Run a cmd line app with the window's name, path\exe, or PID as a parameter
-Suspend process
-Resume process
-Change window size and state (max/min just vertically or horizontally)
-Action delay by ms (so that you could leave the window for a while without triggering)
-Configure actions per window name, exe, or PID
-Exclusion list so that not all windows (vital system processes, like Explorer, Taskmgr) are affected


Examples:

Save CPU: Suspend almost every process except the window with focus.
This would be accomplished by suspending/resuming the process or sending a pause/resume key combo to a virtual machine when it loses/gets focus.

Screen filled with auto-resizing windows: Resize/maximize window when it's clicked/hovered on, and when it loses focus it's resized back/minimized.

What to call it? The Windowator, or the Windowizer?
« Last Edit: September 11, 2010, 09:45 PM by tmpusr »

tmpusr

  • Member
  • Joined in 2005
  • **
  • Posts: 154
  • Instantiation stuck in meatspace with no backup
    • View Profile
    • Donate to Member
Here's how it might be implemented:

Since a suspended process is unresponsive to anything else but the resume command, create a hidden rectangle over each paused process window that reacts to mouse entering it and issuing a resume. When the mouse leaves it, suspend again.

Please, could you at least tell me can this be done?

To focus CPU I currently use Actual Booster for setting the active process priority high, while (almost) every process is set to low by default, increasing system responsiveness in some cases tremendously.

Applies also to:

IDEA: VirtualBox/VMware auto-pause/resume when mouse leaves/enters window
https://www.donation....msg173448#msg173448


MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member

tmpusr

  • Member
  • Joined in 2005
  • **
  • Posts: 154
  • Instantiation stuck in meatspace with no backup
    • View Profile
    • Donate to Member
It seems to me that the needed pieces are known and mostly coded already, except for 'create rectangle and react to it'. I wonder does this qualify as a snack or would it require a lot of coding? It all seems very straightforward. While I've never coded in this language and don't even know where to start, it looks like some of you could almost just drop in some blocks of existing code and be done with it.
« Last Edit: August 07, 2010, 08:35 PM by tmpusr »

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
The trouble is, when you start juggling around the priorities of tasks on the system, it's an easy way to turn a working system into something that hangs, blue screens, and otherwise makes the user mad.

I know I don't want to mess with it.

tmpusr

  • Member
  • Joined in 2005
  • **
  • Posts: 154
  • Instantiation stuck in meatspace with no backup
    • View Profile
    • Donate to Member
There are no problems whatsoever with lowering priorities. Only if you RealTime something, things may get stuck(ish) - so that's never used.
Suspending and resuming processes is not dangerous either, you can try it with Process Explorer.

I use a script that sets all processes' priorities low, except for csrss.exe which is set high (only because lowering it made the interface sluggish). The System process may also benefit from not being lowered, but having it low makes copying and moving files impact system responsiveness less. The thing is to have Actual Booster keeping the foreground app at normal or raised priority.

I've used this for some years already. No problems, no blue screens.
« Last Edit: August 07, 2010, 08:56 PM by tmpusr »

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Then I suggest you take up the task.  It's one thing to set a couple of priorities. It's another to react to mouse movement over windows, dynamically juggling priorities, and all through a script sandbox.  No thanks man. That's the type of stuff they pay system software engineers to do.

You can learn to program trial and error same as I. ahk is free for the download.

tmpusr

  • Member
  • Joined in 2005
  • **
  • Posts: 154
  • Instantiation stuck in meatspace with no backup
    • View Profile
    • Donate to Member
With this you can have practically 100% CPU for the foreground app, when everything else gets suspended automatically, making it essentially a single-tasking system, though you can exclude apps that need to run in the background. To me this seems a very flexible, universal tool, like WinWarden, ProcessGuard, and MouseActivate, obviously worth coding.

This is far from deep system engineering no matter how you look at it. Setting priorities breaks nothing, and that's been done in some scripts already. That's not what this is about. What I'm suggesting is building an invisible frame over every window (only needed in case you're going to suspend them) and sending suspend command to the associated window, and when hovering again over that rectangle (under which the frozen window remains) sending resume. That's all.

Another application would be auto-resizing windows, switching between two windows sizes when hovering/not. It's just passing commands to windows based on mouse position. The thing is, it's almost done already. I know nothing of this stuff so I would have to teach myself the language, inspect code, and hang around forums asking questions and finally, if anyone bothered answering, they would most likely end up writing the code, not me.
« Last Edit: August 07, 2010, 09:59 PM by tmpusr »