htopmini v0.8.3
- MasterFocus
- Posts: 146
- Joined: 01 Oct 2013, 09:47
- Location: Rio de Janeiro - RJ - Brasil
- Contact:
Re: htop mini ?!
Suggestion: allow the user to toggle on/off the percentage (%) of things in the center of the respective bars.
Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.
Need help? Please post on the forum before sending me a PM.
Re: htop mini ?!
update: v0.6.3
- Toggle Percentage in Progressbar
- Toggle Percentage in Progressbar
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Re: htop mini ?!
The problem persists, although it changed a little bit. Now I can also hide my Scite when htopmini is already hidden (but I can't bring Scite back) and I can toggle transparency on Scite when htopmini is hidden.Cant reproduce your Scite problem but changed something so test it pls
But I noticed, that only happens under special circumstances: When Scite's window title starts with 'htopmini'. (But when I test a program, such circumstances aren't so unlikely. )
Of course, now I know how to avoid these problems, but perhaps it is possible to finetune the title matching.
Thanks again for your efforts.
Re: htop mini ?!
Alt+TAB puzzle persists... issue of move/drag drags on...
Re: htop mini ?!
Move/drag actually works for me. But I just noticed that the RAM percentage is always like 200-350% (or even more) on my machine (but the bar is green most of the time...). The drives look fine, though...Guest10 wrote:Alt+TAB puzzle persists... issue of move/drag drags on...
jNizM, we are not complaining, just testing and reporting
Edit: I am pretty sure, you are dividing Used/Free instead of Used/Total for the RAM percentage.
- MasterFocus
- Posts: 146
- Joined: 01 Oct 2013, 09:47
- Location: Rio de Janeiro - RJ - Brasil
- Contact:
Re: htop mini ?!
Hey jNizM...
TL;DR VERSION:
Here's the paste of my current version (will expire in 30 days): http://pastebin.com/1ibmmq1M
Search the code for "[MF]" to find what I've changed.
Feel free to create a v0.6.4 with my modifications or whatever you wish.
DETAILED VERSION:
------ {{{ 1 }}} ------
I suppose some stuff is unnecessarily slow in your code.
GlobalMemoryStatusEx() is called more than once with the same input.
You could simply store that in a variable instead of calling the function again.
In fact, GlobalMemoryStatusEx() itself can be improved.
One possibility is to make it return an object contaning all information gathered by the DllCall.
Even if you don't want to deal with objects, you could still return all that info as a delimited string or anything like that.
------ {{{ 2 }}} ------
I added some Menu, Tray, ToggleCheck calls:
(with this, you're supposed to use Menu, Tray, ToggleCheck, Toggle Transparency once in the auto-exec part of the script)
------ {{{ 3 }}} ------
If you add the +E0x08000000 ExStyle to your GUI, you can still click on it, but it never gets activated.
( reference: http://www.autohotkey.com/board/topic/5 ... clickable/ )
It forces you to use PostMessage, 0xA1, 2,,, htopmini instead of PostMessage, 0xA1, 2,,, A.
This causes a problem with the Show/Hide routine, so it's necessary to rewrite it:
( reference: http://www.autohotkey.com/board/topic/5 ... ntry318484 )
------ {{{ 4 }}} ------
Final notes:
[4.1] It's worth mentioning that, after all these modifications, moving the GUI around seems to misbehave sometimes - the GUI keeps getting updated but only appears at the new position when I release the mouse button. Possibly caused by the +E0x08000000 ExStyle, but I'm not quite sure.
[4.2] Another problem is that, as I modified, the Show/Hide routine only really makes sense if you're using AlwaysOnTop.
TL;DR VERSION:
Here's the paste of my current version (will expire in 30 days): http://pastebin.com/1ibmmq1M
Search the code for "[MF]" to find what I've changed.
Feel free to create a v0.6.4 with my modifications or whatever you wish.
DETAILED VERSION:
------ {{{ 1 }}} ------
I suppose some stuff is unnecessarily slow in your code.
GlobalMemoryStatusEx() is called more than once with the same input.
You could simply store that in a variable instead of calling the function again.
In fact, GlobalMemoryStatusEx() itself can be improved.
One possibility is to make it return an object contaning all information gathered by the DllCall.
Even if you don't want to deal with objects, you could still return all that info as a delimited string or anything like that.
Code: Select all
UpdateMemory:
GlobMemStat1 := GlobalMemoryStatusEx(1)
GlobMemStat2 := GlobalMemoryStatusEx(2)
GlobMemStat3 := GlobalMemoryStatusEx(3)
GuiControl,, RAM1, % Round(GlobMemStat2 - GlobMemStat3, 2) " MB"
GuiControl,, RAM2, % GlobMemStat3 " MB"
GuiControl,, RAM3, % GlobMemStat2 " MB"
GuiControl, % (GlobMemStat1 <= "75") ? "+c00FF00" : (GlobMemStat1 <= "90") ? "+cFFA500" : "+cFF0000", RAM4
GuiControl,, RAM4, % GlobMemStat1
GuiControl,, RAM5, % (varPerc = "1") ? Round((GlobMemStat2 - GlobMemStat3) / GlobMemStat3 * 100, 2) " %" : ""
SetTimer, UpdateMemory, 2000
return
I added some Menu, Tray, ToggleCheck calls:
Code: Select all
TogPerc:
varPerc := (varPerc = "0") ? "1" : "0"
Menu, Tray, ToggleCheck, Toggle Percentage
return
Transparency:
WinGet, ct, Transparent, htopmini
WinSet, Transparent, % ct = "150" ? "Off" : "150", htopmini
Menu, Tray, ToggleCheck, Toggle Transparency
return
OnTop:
WinSet, AlwaysOnTop, Toggle, htopmini
Menu, Tray, ToggleCheck, Toggle AlwaysOnTop
return
------ {{{ 3 }}} ------
If you add the +E0x08000000 ExStyle to your GUI, you can still click on it, but it never gets activated.
( reference: http://www.autohotkey.com/board/topic/5 ... clickable/ )
It forces you to use PostMessage, 0xA1, 2,,, htopmini instead of PostMessage, 0xA1, 2,,, A.
This causes a problem with the Show/Hide routine, so it's necessary to rewrite it:
Code: Select all
ShowHide:
WinGet, winStyle, Style, htopmini
If (winStyle & 0x10000000)
WinHide, htopmini
else
WinShow, htopmini
return
------ {{{ 4 }}} ------
Final notes:
[4.1] It's worth mentioning that, after all these modifications, moving the GUI around seems to misbehave sometimes - the GUI keeps getting updated but only appears at the new position when I release the mouse button. Possibly caused by the +E0x08000000 ExStyle, but I'm not quite sure.
[4.2] Another problem is that, as I modified, the Show/Hide routine only really makes sense if you're using AlwaysOnTop.
Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.
Need help? Please post on the forum before sending me a PM.
- MasterFocus
- Posts: 146
- Joined: 01 Oct 2013, 09:47
- Location: Rio de Janeiro - RJ - Brasil
- Contact:
Re: htop mini ?!
The following changes are not present in the version I previously pasted above.
A possible workaround for the Show/Hide problem is calling WinSet, AlwaysOnTop, Toggle, htopmini twice right after WinShow:
And here's my current UpdateMemory routine:
I'd also like to say that it would be awesome to have the GUI update itself automatically when drives are added/removed, but I know it's not trivial to add this feature.
And, once again, thanks jNizM for this script!
A possible workaround for the Show/Hide problem is calling WinSet, AlwaysOnTop, Toggle, htopmini twice right after WinShow:
Code: Select all
ShowHide:
WinGet, winStyle, Style, htopmini
If (winStyle & 0x10000000)
WinHide, htopmini
else
{
WinShow, htopmini
WinSet, AlwaysOnTop, Toggle, htopmini
WinSet, AlwaysOnTop, Toggle, htopmini
}
return
Code: Select all
UpdateMemory:
GlobMemStat2 := GlobalMemoryStatusEx(2) ; total memory in MB
GlobMemStat3 := GlobalMemoryStatusEx(3) ; free memory in MB
GlobMemStat1 := Round(GlobMemStat2-GlobMemStat3,2) ; used memory in MB
GuiControl,, RAM1, % GlobMemStat1 " MB"
GlobMemStat1 := Round((GlobMemStat2-GlobMemStat3)*100/GlobMemStat2,2) ; percentage of used memory
GuiControl,, RAM2, % GlobMemStat3 " MB"
GuiControl,, RAM3, % GlobMemStat2 " MB"
GuiControl, % (GlobMemStat1 <= "75") ? "+c00FF00" : (GlobMemStat1 <= "90") ? "+cFFA500" : "+cFF0000", RAM4
GuiControl,, RAM4, % GlobMemStat1
GuiControl,, RAM5, % (varPerc = "1") ? GlobMemStat1 " %" : ""
SetTimer, UpdateMemory, 2000
return
And, once again, thanks jNizM for this script!
Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.
Need help? Please post on the forum before sending me a PM.
Re: htop mini ?!
Hi Masterfocus,
Problems with style +E0x08000000 and that PostMessage code to drag the Gui have been documented before in the old forum. The following drag-no-activate strategy by Learning one works perfectly for me on Gui's with style +E0x08000000:
http://www.autohotkey.com/board/topic/6 ... /?p=429015
Problems with style +E0x08000000 and that PostMessage code to drag the Gui have been documented before in the old forum. The following drag-no-activate strategy by Learning one works perfectly for me on Gui's with style +E0x08000000:
http://www.autohotkey.com/board/topic/6 ... /?p=429015
Re: htop mini ?!
MasterFocus, I get an error when running your version. See image below.TL;DR VERSION:
Here's the paste of my current version (will expire in 30 days): http://pastebin.com/1ibmmq1M
- Attachments
-
- htopmini_MasterFocusVersion.jpg (31.58 KiB) Viewed 6944 times
Check out my scripts. (MyIpChanger) (ClipBoard Manager) (SavePictureAs)
All my scripts are tested on Windows 10, AutoHotkey 32 bit Ansi unless otherwise stated.
All my scripts are tested on Windows 10, AutoHotkey 32 bit Ansi unless otherwise stated.
Re: htop mini ?!
because his line breaks
ill upload new version in few hours
ill upload new version in few hours
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Re: htop mini ?!
in jNizM i trust!
jNizM wrote:because his line breaks
ill upload new version in few hours
- MasterFocus
- Posts: 146
- Joined: 01 Oct 2013, 09:47
- Location: Rio de Janeiro - RJ - Brasil
- Contact:
Re: htop mini ?!
Thanks for pointing that out.lblb wrote:The following drag-no-activate strategy by Learning one works perfectly for me on Gui's with style +E0x08000000:
http://www.autohotkey.com/board/topic/6 ... /?p=429015
This method requires a hotkey to be created. ~*LButton is probably the best option, although it may interfere depending on what other scripts you're running.
I suppose there's a way of using OnMessage() to move the GUI by clicking "anywhere" on it, but I can't find it right now.
Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.
Need help? Please post on the forum before sending me a PM.
Re: htop mini ?!
Hi Masterfocus,
You could perhaps use it as a g-label (on a picture/button or maybe a background picture?):
Label:
If Getkeystate("LButton","p")
DragNotActivate(hGui1)
Return
You could perhaps use it as a g-label (on a picture/button or maybe a background picture?):
Label:
If Getkeystate("LButton","p")
DragNotActivate(hGui1)
Return
- MasterFocus
- Posts: 146
- Joined: 01 Oct 2013, 09:47
- Location: Rio de Janeiro - RJ - Brasil
- Contact:
Re: htop mini ?!
I tried using WinSet, Redraw,, the_gui_title_here but it doesn't seem to work always.
Anyway, this script made me hate my sidebar.exe for how much memory it consumes.
I've found other solutions out there with smaller memory footprints, such as Rainmeter and Samurize, but I think an AHK alternative is great.
I'm trying to modify it and create a "htopmicro" version. Here's how it looks so far (just a quick preview, really):
Anyway, this script made me hate my sidebar.exe for how much memory it consumes.
I've found other solutions out there with smaller memory footprints, such as Rainmeter and Samurize, but I think an AHK alternative is great.
I'm trying to modify it and create a "htopmicro" version. Here's how it looks so far (just a quick preview, really):
Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.
Need help? Please post on the forum before sending me a PM.
Re: htop mini ?!
MasterFocus wrote:Thanks for pointing that out.lblb wrote:The following drag-no-activate strategy by Learning one works perfectly for me on Gui's with style +E0x08000000:
http://www.autohotkey.com/board/topic/6 ... /?p=429015
This method requires a hotkey to be created. ~*LButton is probably the best option, although it may interfere depending on what other scripts you're running.
I suppose there's a way of using OnMessage() to move the GUI by clicking "anywhere" on it, but I can't find it right now.
Code: Select all
; Allow moving the GUI by dragging any point in its client area.
OnMessage(0x201, "WM_LBUTTONDOWN")
WM_LBUTTONDOWN()
{
if A_gui
PostMessage, 0xA1, 2 ; WM_NCLBUTTONDOWN
}
Check out my scripts. (MyIpChanger) (ClipBoard Manager) (SavePictureAs)
All my scripts are tested on Windows 10, AutoHotkey 32 bit Ansi unless otherwise stated.
All my scripts are tested on Windows 10, AutoHotkey 32 bit Ansi unless otherwise stated.
Re: htop mini ?!
where can i find MasterFocus's FULL VERSION for RAW DATA download?
Re: htop mini ?!
Hi DataLife, this should be better:
If use A_Gui, then click anywhere (like edit/button) inside GUI will execute that PostMessage.
Code: Select all
; Allow moving the GUI by dragging any point in its client area.
Gui, +hwndhMain
OnMessage(0x201, "WM_LBUTTONDOWN")
WM_LBUTTONDOWN(wParam, lParam, msg, hwnd)
{
global hMain
If (hwnd = hMain)
PostMessage, 0xA1, 2 ; WM_NCLBUTTONDOWN
}
Re: htop mini ?!
thank you, much bettertmplinshi wrote:Hi DataLife, this should be better:If use A_Gui, then click anywhere (like edit/button) inside GUI will execute that PostMessage.Code: Select all
; Allow moving the GUI by dragging any point in its client area. Gui, +hwndhMain OnMessage(0x201, "WM_LBUTTONDOWN") WM_LBUTTONDOWN(wParam, lParam, msg, hwnd) { global hMain If (hwnd = hMain) PostMessage, 0xA1, 2 ; WM_NCLBUTTONDOWN }
Check out my scripts. (MyIpChanger) (ClipBoard Manager) (SavePictureAs)
All my scripts are tested on Windows 10, AutoHotkey 32 bit Ansi unless otherwise stated.
All my scripts are tested on Windows 10, AutoHotkey 32 bit Ansi unless otherwise stated.
Re: htop mini ?!
Maybe a mod could move this part of the thread in the help section has it is a good discussion but it's really taking the emphasis away from jNizM's great script...
In any case, Datalife and tmplinshi:
Your strategies work well to move the Gui but they don't address Masterfocus' point:
If you give the Gui a style of +E0x08000000 (which makes it clickable without stealing the focus away from the active window), then you can still use your code to move the Gui but you won't see it move in real time: it will only move once you release the mouse button. I think Learning one's code that I pointed to (maybe you can try to adapt it similarly to your code) is the most efficient solution that has been posted on the old forum to move a +E0x08000000 Gui in real time.
In any case, Datalife and tmplinshi:
Your strategies work well to move the Gui but they don't address Masterfocus' point:
If you give the Gui a style of +E0x08000000 (which makes it clickable without stealing the focus away from the active window), then you can still use your code to move the Gui but you won't see it move in real time: it will only move once you release the mouse button. I think Learning one's code that I pointed to (maybe you can try to adapt it similarly to your code) is the most efficient solution that has been posted on the old forum to move a +E0x08000000 Gui in real time.