Author |
Topic |
|
chagui
14 Posts |
|
chagui
14 Posts |
Posted - 08/14/2015 : 08:52:35
|
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 |
|
|
Noesis
25 Posts |
Posted - 08/14/2015 : 10:09:44
|
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
|
|
|
chagui
14 Posts |
Posted - 08/28/2015 : 23:47:16
|
I took asome moment to test it , Many thanks , works like a charm ! |
|
|
|
Topic |
|
|
|