This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Lua Scripts
 General Action Scripts
 restore last minimized window
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

chagui

14 Posts

Posted - 08/14/2015 :  08:45:49  Show Profile
Hi,
This is a recurent action we all make i think ,
minimize a window , do other stuff , and restore this last minimized window,
again , again (with pain) :)
I wonder if it would possible with strokes plus , a guy did it with auto hotkey if
he can help , don't know if its adaptable ..

http://www.autohotkey.com/board/topic/66101-hotkeys-minimize-and-restore-previously-minimized-window/

chagui

14 Posts

Posted - 08/14/2015 :  08:52:35  Show Profile
i should precise , minimize a browser window , next restore it from desktop ,
as there ever a minimize window browser , i guess it will need an action from desktop to restore the window
Go to Top of Page

Noesis

25 Posts

Posted - 08/14/2015 :  10:09:44  Show Profile
You guess correctly it will need an action to restore from the taskbar, I call mine Unminimize Last Minimized. It's a bit different to the ahk one, as it stores a history of all minimized windows which can be restored in reverse sequence. Also it will only work with windows minimized using the minimize gesture, not by clicking the minimize icon in the title bar.

In the Global Lua section you will need the following:

minimized_windows = {}

function IsIconic(iWnd) --Checks if Window is Minimized
local Alien_IsIconic = alien.core.load("user32.dll").IsIconic
Alien_IsIconic:types{ ret = 'long', abi = 'stdcall', 'long'}
if Alien_IsIconic(iWnd) == 0 then
return false
else
return true
end
end


The minimize action code should be:

local handle = acGetParentWindowByPoint(gsx, gsy)
acMinimizeWindow(nil, gsx, gsy)
for i=1, #minimized_windows do
if minimized_windows[i] == handle then
table.remove(minimized_windows, i)
end
end
minimized_windows[#minimized_windows + 1] = handle


And finally the Restore or Unminimize Last Minimized code:

local winRestored = false
for i = #minimized_windows, 1, -1 do
if IsIconic(minimized_windows[i]) then
if winRestored == false then
acRestoreWindow(minimized_windows[i], nil, nil)
acActivateWindow(minimized_windows[i], nil, nil, 0)
table.remove(minimized_windows, i)
winRestored = true
end
else
table.remove(minimized_windows, i)
end
end
Go to Top of Page

chagui

14 Posts

Posted - 08/28/2015 :  23:47:16  Show Profile
I took asome moment to test it , Many thanks , works like a charm !
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000