You could get the title of the window with eg.WinApi.GetWindowText(result[0]). I don't see how printing out the result[0] itself would be useful as it just contains a window handle (a number).
If you want instead of printing to the log you could show the name of the minimized window with the ShowOSD action. example:
Code: Select all
from eg.WinApi.Dynamic import GetWindowLong, ShowWindow, SW_RESTORE, SW_MAXIMIZE, SW_MINIMIZE
# Check that we have a window to try to minimize/restore
# Use Find Window action before this script!
if len(result) > 0:
# Check if WS_MINIMIZE bit is set
if(GetWindowLong(result[0], -16) & 0x20000000):
eg.plugins.EventGhost.ShowOSD('Minimized ' + eg.WinApi.GetWindowText(eg.result[0]), None, (255, 255, 255), (0, 0, 0), 0, (0, 0), 0, 3.0, None)
ShowWindow(result[0], SW_RESTORE)
else:
eg.plugins.EventGhost.ShowOSD('Maximized ' + eg.WinApi.GetWindowText(eg.result[0]), None, (255, 255, 255), (0, 0, 0), 0, (0, 0), 0, 3.0, None)
ShowWindow(result[0], SW_MINIMIZE)
Sorry I did not quite get what you wanted to do with the printing but I hope the above example is useful.
-jinxdone