Discussion:
[power-pro] Thumbnails
evewebber@yahoo.co.uk [power-pro]
2018-01-20 11:34:55 UTC
Permalink
Is it possible to minimise windows to thumbnails on the desktop, either singly or all windows?
brucexs@yahoo.com [power-pro]
2018-01-20 11:43:07 UTC
Permalink
Perhaps with some scripting. The idea would be to minimize the window (and also or alternatively hide if you do not want the window on the taskbar) and at the same time create a shortcut on the desktop with the command line set to a powerpro command line to restore the window and delete the shortcut, probably by running a script with an argument for the minimized window.

File plugin can make shortcuts and locate system folders like desktop folder. See help for powerpro command line info. Win plugin can list all open windows for all windows use case.


If you want to try the script and need a bit more detail, let me know. I'm not sure if this work, so you'd have to be comfortable with scripting to play with various possibilities.
evewebber@yahoo.co.uk [power-pro]
2018-01-20 12:09:43 UTC
Permalink
Many thanks for the prompt reply. Yes, I would appreciate more details on the script.
brucexs@yahoo.com [power-pro]
2018-01-21 10:53:27 UTC
Permalink
Also see my other post about command list solutions which might be better for you.


I assume you are comfortable with scripting and using the help. If not, this is probably not going to work for you. Please review and test the script to make sure you are happy with it.


Your post said "thumbnails". This script shows icons of exe, not thumbnails of its current screen. It is not possible to do screen images with PPro functions (although you can possibly do it with dll plugin and win32 api).


Here is how the script works:
1. You put the script in a file in your script folders called desk.txt (or desk.powerpro).
2. You create a hot key with the command ***@to(win.handle("under")). This minimizes the window under mouse to desktop. Use "active" instead of "under" if you prefer to minimize foreground window regardless of mouse location.
3. The to function in the script creates the shortcut and mimimizes/hides the window.
4. The shortcut runs the from function in the script which restores the windows and deletes the shortcut.


It has limitations. One is that may fail if there are two instances of same program with same caption. To fix this, possibly you could include handle in .lnk name, through this would make caption for shortcut ugly.


It only handles one window at a time. To min/hide all to desktop, you'd need to change the recommended hot key to loop on win.handlelist and pass each handle to the script. To show all, you'd need to go through the shortcuts on the desktop using eg file.listfiles and pick out the ones you created, possibly by using some kind of naming convention for the file names you create. For example, you could prefix each file name by _minned_ which is unlikely to be used in a standard shortcut.


After you have tested and are satisfied, you may want to change win.minimize to win.hide.


Function to(hwnd)


if (not win.exists(hwnd)) do
MessageBox ("ok", "Window does not exist: "++hwnd, "Todesk error")
return
endif


local deskpath = file.getsystemfolder("desktop")
local inexename = win.exename(hwnd)
local cap = hwnd.caption[0,20].replacechars(":?*\\/.| ")
local outpath = deskpath ++ "\\" ++ inexename ++ " - " ++ cap ++ ".lnk"




local cmd = ?-C:\Program Files (x86)\PowerPro\Powerpro.exe-
local params = "***@from(" ++ hwnd ++ ?-,"- ++inexename++ ?-")-
//win.debug(outpath, hwnd.caption[0,20])
//win.debug( cmd, params, hwnd.exepath)
if (file.createshortcut(cmd,outpath, hwnd.caption[0,20], params, hwnd.exepath,0)) do
win.minimize(hwnd) // *** change to win.hide when satisfied with script
else
MessageBox ("ok", "Shortcut failed\n"++outpath, "Todesk error")
endif
return


Function from(hwnd, exename)
//win.debug("fromdesk", hwnd, exename)
win.show(hwnd)


local deskpath = file.getsystemfolder("desktop")
//win.debug("delete: ", deskpath ++ "\\"++ exename ++ ".lnk")
file.delete(deskpath ++ "\\"++ exename ++ ".lnk")
return
brucexs@yahoo.com [power-pro]
2018-01-21 11:04:42 UTC
Permalink
The posted scripted has a bug in that the shortcut is not deleted in the from script. This is because the wrong filename is used in creating the call to the from function in the shortcut parameters.

I'll leave it to you to fix the bug in your testing.....
evewebber@yahoo.co.uk [power-pro]
2018-01-21 12:13:33 UTC
Permalink
Many thanks to both of you for your useful input. I will experiment.
brucexs@yahoo.com [power-pro]
2018-01-21 10:56:00 UTC
Permalink
Quanticworks script that he posts about is probably a better idea to meet your requirements. Using a bar gives more flexibility int he look and placement of the icons. For example, it could be caption position or always on top so that it is always visible.

The idea is to create buttons on a command list shown as a bar rather than desktop icons. You may want to work with this script or build your own version based on your needs.
quantic_@hotmail.com [power-pro]
2018-01-20 23:52:21 UTC
Permalink
Hi Bruce,

I remember a script I used back in XP from Alex Peters that did sort of what OP is asking.
Maybe you remember it too and could be of any help?


FloatingTag.zip in scripts folder under files.
Loading...