 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
holomind
Joined: 11 Mar 2006 Posts: 299 Location: Munich, Germany
|
Posted: Sun Oct 01, 2006 7:15 pm Post subject: |
|
|
| Laszlo wrote: | | I will use a version of it all the time. |
i am happy if people find my scripts useful..
| Laszlo wrote: | | Thanks Holomind for sharing it. (Don't worry about the comments on the format. It is fine!). |
the comment is all right, but its a general problem with this forum and not just my posts...
Note from moderator: Discussion moved toCustomize the Forum to Help the Posting of Scripts.
| Quote: | | I only have problems with disappearing command prompt (console) windows (Version 0.3). They randomly show up or remain black after pressing F12. All other windows behave properly. |
i dont have the same problem, having 6 windows with 3 of them consolse (cmd.exe or command.exe) on windows xp-home sp2, shows up correctly.
this will be a problem of the printwindow-function. black window or even only showing the first half is a known-bug of printwindow() function.
or do you mean they dissapear. (because they are smaller than 100px ?) |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 3942 Location: Pittsburgh
|
Posted: Sun Oct 01, 2006 7:40 pm Post subject: |
|
|
| I have 7 windows, 2 command prompts, open. I press F12, and one console window appears in the GUI completely black (no border, title or content is visible). It is there, I can click on its place and it brings me to that window, but nothing is visible in the GUI. Now the blacked out window is active. I press F12 and in the GUI the other console window appears black, blending in the background. It is also there, its place is not covered by any other window, I can click on this empty-looking area to activate that window, but it is not visible. And so on. Sometimes both consoles are visible, sometimes none. I could not find a pattern in their behaviors. |
|
| Back to top |
|
 |
holomind
Joined: 11 Mar 2006 Posts: 299 Location: Munich, Germany
|
Posted: Sun Oct 01, 2006 9:28 pm Post subject: |
|
|
| Laszlo wrote: | | Sometimes both consoles are visible, sometimes none. I could not find a pattern in their behaviors. |
it was hard to reproduce it, i need to have very many windows open to see the effect. also on cmd.exe and sometimes with firefox which does not show the contens.
so this updated version repaints all windows every 1second, then the missing windows show up automatically. a nice effect now also is that your windows are updated in "realtime" so you can see tail/logfiles in your console running or if you have flash banners in your browser you can see them "blink" (very useful feature
post1 is updated again, the script has all features of the versions before and can be easily configured in the read-config part, if you dont like some of the new features, i also added comments to the config so you know what the parameters are for. |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3592 Location: Belgrade
|
Posted: Sun Oct 01, 2006 10:22 pm Post subject: |
|
|
I think I have very cool addon idea
What troubles me is that youi can only use mouse to select window
What about implementing arrows to move and Enter to select  _________________
 |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 3942 Location: Pittsburgh
|
Posted: Sun Oct 01, 2006 11:45 pm Post subject: |
|
|
Now it works perfectly for me (Version 0.5).
How hard is changing the order of the thumbnails to the same as the taskbar title order? It does not change that often. I remember the last position of my windows in the GUI, but they change between each activation, so I have to search. |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 3942 Location: Pittsburgh
|
Posted: Sun Oct 01, 2006 11:53 pm Post subject: |
|
|
| I tried inserting Sleep 0 before the dll call PrintWindow. It seems to solve the black out windows problem, without the periodic repaint (XP SP2). What is your experience? |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3592 Location: Belgrade
|
Posted: Mon Oct 02, 2006 8:14 am Post subject: |
|
|
Laszlo is right, this should also be done.
And window exclussions, since some windows are not needed (object dock for instance)
BTW, I tried expose variants for windows and I am very dissapointed. Only 2 apps, one in dotNet (winexposer, slow, ubeleivable bad, commercial), other in VB (iEx, disaster, doesn't work like it should at all, slow). Your script outperformed that junk even in this early stage. _________________
 |
|
| Back to top |
|
 |
holomind
Joined: 11 Mar 2006 Posts: 299 Location: Munich, Germany
|
Posted: Mon Oct 02, 2006 8:54 am Post subject: |
|
|
@lazlo: i will experiment with the sleep0, perhaps this works, as the order of gui, add ... has an effect if added before or after the dllcall for printwindow. on slower cpus it would perhaps be better to draw the images only once. on my cpu its ok. 1,4ghz laptop.
the sync with taskbar order is not so easy, i dont know how to get this with akh, i read program manager like many other taskswitching tools. the order of thumbnails it the stacking of your windows on the desktop. if you only open the first window after f12 they should be the same, or if you call f12 2 times.
one solution could be to remember the positions (=ahk_ids + win_now) on the first draw and next time to draw them first and then the new windows. if your number of windows changed then you would have a gap. then you could either try to fill it with a new one or move all images up one position (easier).
we even could sort the windows , either bei ahk_id, no pattern visible but consistent, or by window-tilte which would sort your consoles etc. together.
perhaps i try both and you can configure it in the config section.
@majkinetor: i also tried winexposer (which isnt too bad, but having to instll dotnet is a no-no, hmm commercial = $10 is fair , iEx was one of the first and run also on my slower computer, but it has some bugs, also the config was very funny) i stuck with topdesk which is quite good. i also use the activation in the hotzone (lowerleft-corner and seldom the f9=mac, f12=xgl) for activation.
i quess there even is a hot-corner script somewhere in this forum, but you could simply use both scripts and map one corner to f12. or use my gesturescript to activate expose from the gui.
what do you think about the transparent animation. should there be an option to turn transparency off ? i choose to use offscreen painting and showing the finished gui instead of watching printwindow. i personally think a little bit fade makes it more smooth to switch instead of 1/0 changing guis. (many expose clones to animations)
now we also would need a config gui, i'd like the one in this script, perhaps somebody can show me in a small example how to integrate it. (all variables in the readconfig function, i even would put the config script into the readconfig function
http://www.autohotkey.com/forum/viewtopic.php?t=11327&highlight=config
to the choosing with keys. perhaps not so easy. but there are some things to start with. there already exists a gui with pictures which have a g... label, so actiating this pictures with keyboard would be enough. perhaps use button instead of picture? highlighting is a bit more complicated but pherhaps the src of the pictures could be changed but as the thumbnails are only bitblited any change will remove the thumbnail, window does not know how to repaint them, tooltips perhaps would not interfere ?
we also have the number of windows and their position and their ahk_ids and their titles, mix them up and some keyboard activation should be possible. also one could add little labels to the gui showing the title and change the color of the windowtitle on selecting this window. but the thumbnail and label should not overlay not to destroy the "fragile" dc-bitblit refresh. perhaps this also could be a solution.
a) make the thumbnails a bit smaller and add a button above to activate it
b) the buttons should automatically have a select/active effect (even with mouse hover?) then tabbing through the form should work automatically and activating a button with enter should be builtin with ahk.
c) one could add numbers to the thumbnails and open the window with 1.2-9-0 keys if there are not too many open windows. one even could go on with a-b-c..z for window number 11-40
p.s. somebody like to show some code, or am i the only to "change" this script  |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3592 Location: Belgrade
|
Posted: Mon Oct 02, 2006 9:14 am Post subject: |
|
|
Well, holo, it is your script and it is not so big, I guess you can handle it alone for now . Currently I am asking around how can we speed up process of thumbnailing windows to be in (near) real time.
About buttons and such I vote not to have any extra interface elemnts, except maybe numbers as you suggested, but those can be imopsed in the thumbs, for instance in upper left corner. Some form of selection should be visible, like bold rectangle around currently selected window, if that is possible. If not, numbers will do for the start. Other things should be optional and set by setup gui.
About setup, you have example in ISense script. See Setup_GUI.ahk. It is invoked using tray menu item, and created in that time, and destoryed after usage. It is completely black boxed from the other parts of the code.
Template for Setup is this:
| Code: | ISSetup_Create()
{
global
ISSetup_GUI := <some number>
if (ISSetup_visible)
{
WinActivate ahk_id %ISSetup_hwnd%
return
}
ISSetup_visible := true
;create gui
Gui, %ISSetup_Gui%: +labelISSetup_ Toolwindow
Gui, %ISSetup_Gui%:Add,
Gui, %ISSetup_Gui%:Add,
....
....
;get handle of this window
Gui, %ISSetup_GUI%: +LastFound
ISSetup_hwnd := WinExist()
;set up controls
ISSetup_OnShow()
Gui, %ISSetup_GUI%:Show, x396 y253 h300 w305 , InteliSense Setup
}
;------------------------
; set up fields from ini
;
ISSetup_OnShow()
{
global
local bg, fg
;read from ini
IniRead,
IniRead,
...
;set gui controls
GuiControl,
GuiControl,
....
}
;------------------------
;
ISSetup_Close:
Gui, %ISSetup_Gui%:Destroy
ISSetup_Visible := false
return
ISSetup_Escape:
goto ISSetup_Close
return
;------------------------
; save into ini
;
ISSetup_OnSaveClick()
{
global
local c1, c2
Gui %ISSetup_Gui%:Submit
;write to ini
IniWrite ....
IniWrite ...
;reread from ini into main script variables.
ReadConfig()
Gosub ISSetup_Close
}
ISSetup_OnSaveClickDispatch:
ISSetup_OnSaveClick()
return |
Then if you put this in separate script, just include it at the end of your main script so, your important code isn't killed by management. You can create setup window by calling ISSetup_Create() anywhere in the script. _________________
 |
|
| Back to top |
|
 |
holomind
Joined: 11 Mar 2006 Posts: 299 Location: Munich, Germany
|
Posted: Mon Oct 02, 2006 9:27 am Post subject: |
|
|
@mjikenetor: thanks for the gui example, but i still dont understand it. its not easy to use and quite complicated. i want to have something like this:
| Code: |
read_config:
ini_values = ini_value1,ini_value2,var_x,var_y
loop
read_ini ... each ini_values
return
edit_config:
gui 2: show config editor
loop
gui 2: add editfield, each ini_values + comments
gui 2: add submit, onsubmit call save_config
return
save_config:
loop %inivalues%
write_ini each values + comments
return
|
---------
or in the usage of this plugin-script from toralf could be easier
| Code: |
#include plugin_config.ahk
ini_path := my.ini
hotkey, f11 , edit_config ; calls some function in config
|
and additionally i create on configfile to start with manually (inifiles look like ahk-code (variables) anyways. |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3592 Location: Belgrade
|
Posted: Mon Oct 02, 2006 9:42 am Post subject: |
|
|
Well, its up to you.
That is my prefered setup for reasons I don't want to come into here. _________________
 |
|
| Back to top |
|
 |
holomind
Joined: 11 Mar 2006 Posts: 299 Location: Munich, Germany
|
Posted: Mon Oct 02, 2006 10:01 am Post subject: |
|
|
oh, i thought you would post an example of torafs, but you added your own gui, which is not too different from my idea with three .._config: functions.
but i would prefering doing it in loops automatically, and not position each button. its only meant to make editing configs easier and not to win a design price. it should be fast and easy. i smell a new script comming, holomind simple config gui ...
i will look into your isense config gui to see how to use iniread, write and some things with gui creation.
-------
the buttons would be needed to enable keypress. there needs to be something to highlight and press.
but perhaps this can be done "guiless", as you can choose selected window with key up / down (register hotkey only if in expose gui and unregister hotkey afterwards) the highllighting of the currentselection overlaying a transparent tooltip over the selected thumbnail, very low visibility. like in the drag-select tooltip i use for live-windows. adding numbers for quickselect would not hurt. little lables on upperleft cornder of the window. |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3592 Location: Belgrade
|
Posted: Mon Oct 02, 2006 10:08 am Post subject: |
|
|
I tried TopDesk.
I am not very impressed. I still prefer your script.
It is very slow and have glitches.
I don't know how it is on the Mac, but XGL rocks. I don't need to go in such details, and live preview is not big deal for me. But the speed of presentation should be real time. _________________
 |
|
| Back to top |
|
 |
holomind
Joined: 11 Mar 2006 Posts: 299 Location: Munich, Germany
|
Posted: Mon Oct 02, 2006 10:19 am Post subject: |
|
|
@lazlo: your sleep 0 is added (dont know if it has effects
also the windows are now sorted by ahk_id and stay in the same position after repeated calls of gui.
@majkinetor: with the speed there is not much which can be done to improve it. as the slow part is
a) animation
b) printwindow() dll call which is outside of ahk
if you change translevel_start to 200 you can see the "speed" of printwindow. i prefer to do it offscreen and not watch each window popping up.
for making it faster it would now get quite complicated as you would need to buffer the images and on the next call use the bufferd window, and then after 2 seconds refresh them with real printwindows. but then you also would use more memory as you need to store the images etc. and saving images as bmp or other to disk would not be fast either ?
deskman uses a different technique as it takes the screenshots "on the go" and uses small bmps to save them using print_window is better as you always get a "fresh" look of your windows, i would prefer this to "faster" old windows.
doing caching either would involve some dllcalls to create some hdc_buffers (using memory which you dont like in topdesk)
or saving thumbnails and moving them into the pictures and overpaint them with printwindow.
this cant be done in 15minutes, so its low prio on my list
if you want instant feedback get a faster computer (core-duo 2ghz *lol*) |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3592 Location: Belgrade
|
Posted: Mon Oct 02, 2006 11:28 am Post subject: |
|
|
I have faster computer
2x3GHZ
I wait about 2 seconds. _________________
 |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|