It suprised me that there is no g-Label in Progress Ctrl :oops:
Never mind, i don't often use this control :lol: . However,if someone need,here is a simple one that may help:
Function:
;~ ################XClickableProgress################
;Usage: you have to put OnMessage(0x201,"XClickableProgress") on the very top of the Script to use XClickableProgress() Function. (XClickableProgress() Function can be put anywhere).That all.
;~ Note:It may work with Horizontal & Vertical Progress Ctrls,negative range numbers in progress ctrls, multi-GUI and unlimited amount of progress ctrls.
;~ ################BEGIN##################
OnMessage(0x201,"XClickableProgress") ; this line shoud be move to the top of your script
XClickableProgress() {
CoordMode,Mouse,Relative
MouseGetPos,,,,ClassNN
IfNotInString,ClassNN,msctls_progress32,return
MouseGetPos,,,,CtrlHwnd,2
ControlGet,Style,Style,,,ahk_id%CtrlHwnd%
ControlGetPos,X,Y,W,H,,ahk_id%CtrlHwnd%
VarSetCapacity(R,8)
SendMessage,0x0407,,&R,,ahk_id%CtrlHwnd%
R1:=NumGet(R,0,"Int"),R2:=NumGet(R,4,"Int")
while (GetKeyState("LButton"))
{
MouseGetPos,XM,YM
ToolTip % V := (V:=(Style&0x4 ? 1-(YM-Y)/H : (XM-X)/W))>=1 ? R2 : V<=0 ? R1 : Round(V*(R2-R1)+R1)
GuiControl,% A_Gui ":",% CtrlHwnd,% V
}
ToolTip
}
;~ #############END#############
Some Simple Examples:
Ex1: Pulover's Example (I hope you don't mind :wink: )
;~ ################XClickableProgress################
;Usage: you have to put OnMessage(0x201,"XClickableProgress") on the very top of the Script to use XClickableProgress() Function. (XClickableProgress() Function can be put anywhere).That all.
;~ Note:It may work with Horizontal & Vertical Progress Ctrls,negative range numbers in progress ctrls, multi-GUI and unlimited amount of progress ctrls.
;~ ################BEGIN##################
OnMessage(0x201,"XClickableProgress")
XClickableProgress() {
CoordMode,Mouse,Relative
MouseGetPos,,,,ClassNN
IfNotInString,ClassNN,msctls_progress32,return
MouseGetPos,,,,CtrlHwnd,2
ControlGet,Style,Style,,,ahk_id%CtrlHwnd%
ControlGetPos,X,Y,W,H,,ahk_id%CtrlHwnd%
VarSetCapacity(R,8)
SendMessage,0x0407,,&R,,ahk_id%CtrlHwnd%
R1:=NumGet(R,0,"Int"),R2:=NumGet(R,4,"Int")
while (GetKeyState("LButton"))
{
MouseGetPos,XM,YM
ToolTip % V := (V:=(Style&0x4 ? 1-(YM-Y)/H : (XM-X)/W))>=1 ? R2 : V<=0 ? R1 : Round(V*(R2-R1)+R1)
GuiControl,% A_Gui ":",% CtrlHwnd,% V
}
ToolTip
}
;~ #############END#############
MaxRange1 := 100
MaxRange2 := 200
MaxRange3 := 300
MaxRange4 := 500
MaxRange5 := 1000
margin := 4
Gui, Add, Progress, w300 h20 cGreen BackgroundLime vPrBar1 Range0-%MaxRange1%, 100
Gui, Add, Progress, x20 w500 h15 cRed BackgroundYellow vPrBar2 Range0-%MaxRange2%, 200
Gui, Add, Progress, x80 y60 w600 h40 cBlue vPrBar3 Range0-%MaxRange3%, 300
Gui, Add, Progress, x40 w150 h20 -Smooth vPrBar4 Range0-%MaxRange4%, 500
Gui, Add, Progress, x200 yp w450 h20 cBlack BackgroundSilver vPrBar5 Range0-%MaxRange5%, 1000
Gui, Show, w700 h140, Progress Bar Slider by Pulover
Loop, 9
GuiControlGet, PrBar%A_Index%, Pos
return
GuiClose:
GuiEscape:
ExitApp
Ex2:
;~ ################XClickableProgress################
;Usage: you have to put OnMessage(0x201,"XClickableProgress") on the very top of the Script to use XClickableProgress() Function. (XClickableProgress() Function can be put anywhere).That all.
;~ Note:It may work with Horizontal & Vertical Progress Ctrls,negative range numbers in progress ctrls, multi-GUI and unlimited amount of progress ctrls.
;~ ################BEGIN##################
OnMessage(0x201,"XClickableProgress")
XClickableProgress() {
CoordMode,Mouse,Relative
MouseGetPos,,,,ClassNN
IfNotInString,ClassNN,msctls_progress32,return
MouseGetPos,,,,CtrlHwnd,2
ControlGet,Style,Style,,,ahk_id%CtrlHwnd%
ControlGetPos,X,Y,W,H,,ahk_id%CtrlHwnd%
VarSetCapacity(R,8)
SendMessage,0x0407,,&R,,ahk_id%CtrlHwnd%
R1:=NumGet(R,0,"Int"),R2:=NumGet(R,4,"Int")
while (GetKeyState("LButton"))
{
MouseGetPos,XM,YM
ToolTip % V := (V:=(Style&0x4 ? 1-(YM-Y)/H : (XM-X)/W))>=1 ? R2 : V<=0 ? R1 : Round(V*(R2-R1)+R1)
GuiControl,% A_Gui ":",% CtrlHwnd,% V
}
ToolTip
}
;~ #############END#############
Gui, Font, s10, MS Shell Dlg
Gui, Color, Green, FFFFFF
Gui, Add, Progress, x10 y10 w230 h30 range100000-100000000,25
Gui, Add, Progress, x10 y260 w230 h30 range-1000000--1000,25
Gui, Add, Progress, x10 y40 w40 h220 +0x4 range0-100000,25
Gui, Add, Progress, x200 y40 w40 h220 +0x4 range-10000000--1000,25
Gui, Add, Button, x90 y130 w65 h30,nothing :D
Gui, Show, w253 h304,
Return
GuiClose:
ExitApp
nothing is impossible with ahk (_L).
Excuse my bad English.
Busy