GuiSlider.au3 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. #include-once
  2. #include "SendMessage.au3"
  3. #include "SliderConstants.au3"
  4. #include "StructureConstants.au3"
  5. #include "UDFGlobalID.au3"
  6. #include "WinAPIConv.au3"
  7. #include "WinAPISysInternals.au3"
  8. ; #INDEX# =======================================================================================================================
  9. ; Title .........: Slider
  10. ; AutoIt Version : 3.3.14.5
  11. ; Language ......: English
  12. ; Description ...: Functions that assist with Slider Control "Trackbar" management.
  13. ; Author(s) .....: Gary Frost (gafrost)
  14. ; ===============================================================================================================================
  15. ; #VARIABLES# ===================================================================================================================
  16. Global $__g_hSLastWnd
  17. ; ===============================================================================================================================
  18. ; #CONSTANTS# ===================================================================================================================
  19. Global Const $__SLIDERCONSTANT_ClassName = "msctls_trackbar32"
  20. ; ===============================================================================================================================
  21. ; #CURRENT# =====================================================================================================================
  22. ; _GUICtrlSlider_ClearSel
  23. ; _GUICtrlSlider_ClearTics
  24. ; _GUICtrlSlider_Create
  25. ; _GUICtrlSlider_Destroy
  26. ; _GUICtrlSlider_GetBuddy
  27. ; _GUICtrlSlider_GetChannelRect
  28. ; _GUICtrlSlider_GetChannelRectEx
  29. ; _GUICtrlSlider_GetLineSize
  30. ; _GUICtrlSlider_GetLogicalTics
  31. ; _GUICtrlSlider_GetNumTics
  32. ; _GUICtrlSlider_GetPageSize
  33. ; _GUICtrlSlider_GetPos
  34. ; _GUICtrlSlider_GetRange
  35. ; _GUICtrlSlider_GetRangeMax
  36. ; _GUICtrlSlider_GetRangeMin
  37. ; _GUICtrlSlider_GetSel
  38. ; _GUICtrlSlider_GetSelEnd
  39. ; _GUICtrlSlider_GetSelStart
  40. ; _GUICtrlSlider_GetThumbLength
  41. ; _GUICtrlSlider_GetThumbRect
  42. ; _GUICtrlSlider_GetThumbRectEx
  43. ; _GUICtrlSlider_GetTic
  44. ; _GUICtrlSlider_GetTicPos
  45. ; _GUICtrlSlider_GetToolTips
  46. ; _GUICtrlSlider_GetUnicodeFormat
  47. ; _GUICtrlSlider_SetBuddy
  48. ; _GUICtrlSlider_SetLineSize
  49. ; _GUICtrlSlider_SetPageSize
  50. ; _GUICtrlSlider_SetPos
  51. ; _GUICtrlSlider_SetRange
  52. ; _GUICtrlSlider_SetRangeMax
  53. ; _GUICtrlSlider_SetRangeMin
  54. ; _GUICtrlSlider_SetSel
  55. ; _GUICtrlSlider_SetSelEnd
  56. ; _GUICtrlSlider_SetSelStart
  57. ; _GUICtrlSlider_SetThumbLength
  58. ; _GUICtrlSlider_SetTic
  59. ; _GUICtrlSlider_SetTicFreq
  60. ; _GUICtrlSlider_SetTipSide
  61. ; _GUICtrlSlider_SetToolTips
  62. ; _GUICtrlSlider_SetUnicodeFormat
  63. ; ===============================================================================================================================
  64. ; #FUNCTION# ====================================================================================================================
  65. ; Author ........: Gary Frost (gafrost)
  66. ; Modified.......:
  67. ; ===============================================================================================================================
  68. Func _GUICtrlSlider_ClearSel($hWnd)
  69. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  70. _SendMessage($hWnd, $TBM_CLEARSEL, True)
  71. EndFunc ;==>_GUICtrlSlider_ClearSel
  72. ; #FUNCTION# ====================================================================================================================
  73. ; Author ........: Gary Frost (gafrost)
  74. ; Modified.......:
  75. ; ===============================================================================================================================
  76. Func _GUICtrlSlider_ClearTics($hWnd)
  77. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  78. _SendMessage($hWnd, $TBM_CLEARTICS, True)
  79. EndFunc ;==>_GUICtrlSlider_ClearTics
  80. ; #FUNCTION# ====================================================================================================================
  81. ; Author ........: Gary Frost
  82. ; Modified.......:
  83. ; ===============================================================================================================================
  84. Func _GUICtrlSlider_Create($hWnd, $iX, $iY, $iWidth = 100, $iHeight = 20, $iStyle = $TBS_AUTOTICKS, $iExStyle = 0x00000000)
  85. If Not IsHWnd($hWnd) Then Return SetError(1, 0, 0) ; Invalid Window handle for _GUICtrlSlider_Create 1st parameter
  86. If $iWidth = -1 Then $iWidth = 100
  87. If $iHeight = -1 Then $iHeight = 20
  88. If $iStyle = -1 Then $iStyle = $TBS_AUTOTICKS
  89. If $iExStyle = -1 Then $iExStyle = 0x00000000
  90. $iStyle = BitOR($iStyle, $__UDFGUICONSTANT_WS_CHILD, $__UDFGUICONSTANT_WS_VISIBLE)
  91. Local $nCtrlID = __UDF_GetNextGlobalID($hWnd)
  92. If @error Then Return SetError(@error, @extended, 0)
  93. Local $hSlider = _WinAPI_CreateWindowEx($iExStyle, $__SLIDERCONSTANT_ClassName, "", $iStyle, $iX, $iY, $iWidth, $iHeight, $hWnd, $nCtrlID)
  94. _SendMessage($hSlider, $TBM_SETRANGE, True, _WinAPI_MakeLong(0, 100)); // min. & max. positions
  95. _GUICtrlSlider_SetTicFreq($hSlider, 5)
  96. Return $hSlider
  97. EndFunc ;==>_GUICtrlSlider_Create
  98. ; #FUNCTION# ====================================================================================================================
  99. ; Author ........: Gary Frost (gafrost)
  100. ; Modified.......:
  101. ; ===============================================================================================================================
  102. Func _GUICtrlSlider_Destroy(ByRef $hWnd)
  103. If Not _WinAPI_IsClassName($hWnd, $__SLIDERCONSTANT_ClassName) Then Return SetError(2, 2, False)
  104. Local $iDestroyed = 0
  105. If IsHWnd($hWnd) Then
  106. If _WinAPI_InProcess($hWnd, $__g_hSLastWnd) Then
  107. Local $nCtrlID = _WinAPI_GetDlgCtrlID($hWnd)
  108. Local $hParent = _WinAPI_GetParent($hWnd)
  109. $iDestroyed = _WinAPI_DestroyWindow($hWnd)
  110. Local $iRet = __UDF_FreeGlobalID($hParent, $nCtrlID)
  111. If Not $iRet Then
  112. ; can check for errors here if needed, for debug
  113. EndIf
  114. Else
  115. ; Not Allowed to Destroy Other Applications Control(s)
  116. Return SetError(1, 1, False)
  117. EndIf
  118. Else
  119. $iDestroyed = GUICtrlDelete($hWnd)
  120. EndIf
  121. If $iDestroyed Then $hWnd = 0
  122. Return $iDestroyed <> 0
  123. EndFunc ;==>_GUICtrlSlider_Destroy
  124. ; #FUNCTION# ====================================================================================================================
  125. ; Author ........: Gary Frost (gafrost)
  126. ; Modified.......:
  127. ; ===============================================================================================================================
  128. Func _GUICtrlSlider_GetBuddy($hWnd, $bLocation)
  129. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  130. Return _SendMessage($hWnd, $TBM_GETBUDDY, $bLocation, 0, 0, "wparam", "lparam", "hwnd")
  131. EndFunc ;==>_GUICtrlSlider_GetBuddy
  132. ; #FUNCTION# ====================================================================================================================
  133. ; Author ........: Gary Frost (gafrost)
  134. ; Modified.......:
  135. ; ===============================================================================================================================
  136. Func _GUICtrlSlider_GetChannelRect($hWnd)
  137. Local $tRECT = _GUICtrlSlider_GetChannelRectEx($hWnd)
  138. Local $aRect[4]
  139. $aRect[0] = DllStructGetData($tRECT, "Left")
  140. $aRect[1] = DllStructGetData($tRECT, "Top")
  141. $aRect[2] = DllStructGetData($tRECT, "Right")
  142. $aRect[3] = DllStructGetData($tRECT, "Bottom")
  143. Return $aRect
  144. EndFunc ;==>_GUICtrlSlider_GetChannelRect
  145. ; #FUNCTION# ====================================================================================================================
  146. ; Author ........: Gary Frost (gafrost)
  147. ; Modified.......:
  148. ; ===============================================================================================================================
  149. Func _GUICtrlSlider_GetChannelRectEx($hWnd)
  150. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  151. Local $tRECT = DllStructCreate($tagRECT)
  152. _SendMessage($hWnd, $TBM_GETCHANNELRECT, 0, $tRECT, 0, "wparam", "struct*")
  153. Return $tRECT
  154. EndFunc ;==>_GUICtrlSlider_GetChannelRectEx
  155. ; #FUNCTION# ====================================================================================================================
  156. ; Author ........: Gary Frost (gafrost)
  157. ; Modified.......:
  158. ; ===============================================================================================================================
  159. Func _GUICtrlSlider_GetLineSize($hWnd)
  160. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  161. Return _SendMessage($hWnd, $TBM_GETLINESIZE)
  162. EndFunc ;==>_GUICtrlSlider_GetLineSize
  163. ; #FUNCTION# ====================================================================================================================
  164. ; Author ........: Gary Frost
  165. ; Modified.......:
  166. ; ===============================================================================================================================
  167. Func _GUICtrlSlider_GetLogicalTics($hWnd)
  168. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  169. Local $iArraySize = _GUICtrlSlider_GetNumTics($hWnd) - 2
  170. Local $aTics[$iArraySize]
  171. Local $pArray = _SendMessage($hWnd, $TBM_GETPTICS)
  172. If @error Then Return SetError(@error, @extended, $aTics)
  173. Local $tArray = DllStructCreate("dword[" & $iArraySize & "]", $pArray)
  174. For $x = 1 To $iArraySize
  175. $aTics[$x - 1] = _GUICtrlSlider_GetTicPos($hWnd, DllStructGetData($tArray, 1, $x))
  176. Next
  177. Return $aTics
  178. EndFunc ;==>_GUICtrlSlider_GetLogicalTics
  179. ; #FUNCTION# ====================================================================================================================
  180. ; Author ........: Gary Frost (gafrost)
  181. ; Modified.......:
  182. ; ===============================================================================================================================
  183. Func _GUICtrlSlider_GetNumTics($hWnd)
  184. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  185. Return _SendMessage($hWnd, $TBM_GETNUMTICS)
  186. EndFunc ;==>_GUICtrlSlider_GetNumTics
  187. ; #FUNCTION# ====================================================================================================================
  188. ; Author ........: Gary Frost (gafrost)
  189. ; Modified.......:
  190. ; ===============================================================================================================================
  191. Func _GUICtrlSlider_GetPageSize($hWnd)
  192. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  193. Return _SendMessage($hWnd, $TBM_GETPAGESIZE)
  194. EndFunc ;==>_GUICtrlSlider_GetPageSize
  195. ; #FUNCTION# ====================================================================================================================
  196. ; Author ........: Gary Frost (gafrost)
  197. ; Modified.......:
  198. ; ===============================================================================================================================
  199. Func _GUICtrlSlider_GetPos($hWnd)
  200. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  201. Return _SendMessage($hWnd, $TBM_GETPOS)
  202. EndFunc ;==>_GUICtrlSlider_GetPos
  203. ; #FUNCTION# ====================================================================================================================
  204. ; Author ........: Gary Frost (gafrost)
  205. ; Modified.......:
  206. ; ===============================================================================================================================
  207. Func _GUICtrlSlider_GetRange($hWnd)
  208. Local $aMinMax[2]
  209. $aMinMax[0] = _GUICtrlSlider_GetRangeMin($hWnd)
  210. $aMinMax[1] = _GUICtrlSlider_GetRangeMax($hWnd)
  211. Return $aMinMax
  212. EndFunc ;==>_GUICtrlSlider_GetRange
  213. ; #FUNCTION# ====================================================================================================================
  214. ; Author ........: Gary Frost (gafrost)
  215. ; Modified.......:
  216. ; ===============================================================================================================================
  217. Func _GUICtrlSlider_GetRangeMax($hWnd)
  218. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  219. Return _SendMessage($hWnd, $TBM_GETRANGEMAX)
  220. EndFunc ;==>_GUICtrlSlider_GetRangeMax
  221. ; #FUNCTION# ====================================================================================================================
  222. ; Author ........: Gary Frost (gafrost)
  223. ; Modified.......:
  224. ; ===============================================================================================================================
  225. Func _GUICtrlSlider_GetRangeMin($hWnd)
  226. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  227. Return _SendMessage($hWnd, $TBM_GETRANGEMIN)
  228. EndFunc ;==>_GUICtrlSlider_GetRangeMin
  229. ; #FUNCTION# ====================================================================================================================
  230. ; Author ........: Gary Frost (gafrost)
  231. ; Modified.......:
  232. ; ===============================================================================================================================
  233. Func _GUICtrlSlider_GetSel($hWnd)
  234. Local $aSelStartEnd[2]
  235. $aSelStartEnd[0] = _GUICtrlSlider_GetSelStart($hWnd)
  236. $aSelStartEnd[1] = _GUICtrlSlider_GetSelEnd($hWnd)
  237. Return $aSelStartEnd
  238. EndFunc ;==>_GUICtrlSlider_GetSel
  239. ; #FUNCTION# ====================================================================================================================
  240. ; Author ........: Gary Frost (gafrost)
  241. ; Modified.......:
  242. ; ===============================================================================================================================
  243. Func _GUICtrlSlider_GetSelEnd($hWnd)
  244. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  245. Return _SendMessage($hWnd, $TBM_GETSELEND)
  246. EndFunc ;==>_GUICtrlSlider_GetSelEnd
  247. ; #FUNCTION# ====================================================================================================================
  248. ; Author ........: Gary Frost (gafrost)
  249. ; Modified.......:
  250. ; ===============================================================================================================================
  251. Func _GUICtrlSlider_GetSelStart($hWnd)
  252. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  253. Return _SendMessage($hWnd, $TBM_GETSELSTART)
  254. EndFunc ;==>_GUICtrlSlider_GetSelStart
  255. ; #FUNCTION# ====================================================================================================================
  256. ; Author ........: Gary Frost (gafrost)
  257. ; Modified.......:
  258. ; ===============================================================================================================================
  259. Func _GUICtrlSlider_GetThumbLength($hWnd)
  260. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  261. Return _SendMessage($hWnd, $TBM_GETTHUMBLENGTH)
  262. EndFunc ;==>_GUICtrlSlider_GetThumbLength
  263. ; #FUNCTION# ====================================================================================================================
  264. ; Author ........: Gary Frost (gafrost)
  265. ; Modified.......:
  266. ; ===============================================================================================================================
  267. Func _GUICtrlSlider_GetThumbRect($hWnd)
  268. Local $tRECT = _GUICtrlSlider_GetThumbRectEx($hWnd)
  269. Local $aRect[4]
  270. $aRect[0] = DllStructGetData($tRECT, "Left")
  271. $aRect[1] = DllStructGetData($tRECT, "Top")
  272. $aRect[2] = DllStructGetData($tRECT, "Right")
  273. $aRect[3] = DllStructGetData($tRECT, "Bottom")
  274. Return $aRect
  275. EndFunc ;==>_GUICtrlSlider_GetThumbRect
  276. ; #FUNCTION# ====================================================================================================================
  277. ; Author ........: Gary Frost (gafrost)
  278. ; Modified.......:
  279. ; ===============================================================================================================================
  280. Func _GUICtrlSlider_GetThumbRectEx($hWnd)
  281. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  282. Local $tRECT = DllStructCreate($tagRECT)
  283. _SendMessage($hWnd, $TBM_GETTHUMBRECT, 0, $tRECT, 0, "wparam", "struct*")
  284. Return $tRECT
  285. EndFunc ;==>_GUICtrlSlider_GetThumbRectEx
  286. ; #FUNCTION# ====================================================================================================================
  287. ; Author ........: Gary Frost (gafrost)
  288. ; Modified.......:
  289. ; ===============================================================================================================================
  290. Func _GUICtrlSlider_GetTic($hWnd, $iTic)
  291. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  292. Return _SendMessage($hWnd, $TBM_GETTIC, $iTic)
  293. EndFunc ;==>_GUICtrlSlider_GetTic
  294. ; #FUNCTION# ====================================================================================================================
  295. ; Author ........: Gary Frost (gafrost)
  296. ; Modified.......:
  297. ; ===============================================================================================================================
  298. Func _GUICtrlSlider_GetTicPos($hWnd, $iTic)
  299. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  300. Return _SendMessage($hWnd, $TBM_GETTICPOS, $iTic)
  301. EndFunc ;==>_GUICtrlSlider_GetTicPos
  302. ; #FUNCTION# ====================================================================================================================
  303. ; Author ........: Gary Frost (gafrost)
  304. ; Modified.......:
  305. ; ===============================================================================================================================
  306. Func _GUICtrlSlider_GetToolTips($hWnd)
  307. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  308. Return _SendMessage($hWnd, $TBM_GETTOOLTIPS, 0, 0, 0, "wparam", "lparam", "hwnd")
  309. EndFunc ;==>_GUICtrlSlider_GetToolTips
  310. ; #FUNCTION# ====================================================================================================================
  311. ; Author ........: Gary Frost (gafrost)
  312. ; Modified.......:
  313. ; ===============================================================================================================================
  314. Func _GUICtrlSlider_GetUnicodeFormat($hWnd)
  315. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  316. Return _SendMessage($hWnd, $TBM_GETUNICODEFORMAT) <> 0
  317. EndFunc ;==>_GUICtrlSlider_GetUnicodeFormat
  318. ; #FUNCTION# ====================================================================================================================
  319. ; Author ........: Gary Frost (gafrost)
  320. ; Modified.......:
  321. ; ===============================================================================================================================
  322. Func _GUICtrlSlider_SetBuddy($hWnd, $bLocation, $hBuddy)
  323. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  324. If Not IsHWnd($hBuddy) Then $hBuddy = GUICtrlGetHandle($hBuddy)
  325. Return _SendMessage($hWnd, $TBM_SETBUDDY, $bLocation, $hBuddy, 0, "wparam", "hwnd", "hwnd")
  326. EndFunc ;==>_GUICtrlSlider_SetBuddy
  327. ; #FUNCTION# ====================================================================================================================
  328. ; Author ........: Gary Frost (gafrost)
  329. ; Modified.......:
  330. ; ===============================================================================================================================
  331. Func _GUICtrlSlider_SetLineSize($hWnd, $iLineSize)
  332. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  333. Return _SendMessage($hWnd, $TBM_SETLINESIZE, 0, $iLineSize)
  334. EndFunc ;==>_GUICtrlSlider_SetLineSize
  335. ; #FUNCTION# ====================================================================================================================
  336. ; Author ........: Gary Frost (gafrost)
  337. ; Modified.......:
  338. ; ===============================================================================================================================
  339. Func _GUICtrlSlider_SetPageSize($hWnd, $iPageSize)
  340. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  341. Return _SendMessage($hWnd, $TBM_SETPAGESIZE, 0, $iPageSize)
  342. EndFunc ;==>_GUICtrlSlider_SetPageSize
  343. ; #FUNCTION# ====================================================================================================================
  344. ; Author ........: Gary Frost (gafrost)
  345. ; Modified.......:
  346. ; ===============================================================================================================================
  347. Func _GUICtrlSlider_SetPos($hWnd, $iPosition)
  348. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  349. _SendMessage($hWnd, $TBM_SETPOS, True, $iPosition)
  350. EndFunc ;==>_GUICtrlSlider_SetPos
  351. ; #FUNCTION# ====================================================================================================================
  352. ; Author ........: Gary Frost (gafrost)
  353. ; Modified.......:
  354. ; ===============================================================================================================================
  355. Func _GUICtrlSlider_SetRange($hWnd, $iMinimum, $iMaximum)
  356. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  357. _SendMessage($hWnd, $TBM_SETRANGE, True, _WinAPI_MakeLong($iMinimum, $iMaximum))
  358. EndFunc ;==>_GUICtrlSlider_SetRange
  359. ; #FUNCTION# ====================================================================================================================
  360. ; Author ........: Gary Frost (gafrost)
  361. ; Modified.......:
  362. ; ===============================================================================================================================
  363. Func _GUICtrlSlider_SetRangeMax($hWnd, $iMaximum)
  364. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  365. _SendMessage($hWnd, $TBM_SETRANGEMAX, True, $iMaximum)
  366. EndFunc ;==>_GUICtrlSlider_SetRangeMax
  367. ; #FUNCTION# ====================================================================================================================
  368. ; Author ........: Gary Frost (gafrost)
  369. ; Modified.......:
  370. ; ===============================================================================================================================
  371. Func _GUICtrlSlider_SetRangeMin($hWnd, $iMinimum)
  372. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  373. _SendMessage($hWnd, $TBM_SETRANGEMIN, True, $iMinimum)
  374. EndFunc ;==>_GUICtrlSlider_SetRangeMin
  375. ; #FUNCTION# ====================================================================================================================
  376. ; Author ........: Gary Frost (gafrost)
  377. ; Modified.......:
  378. ; ===============================================================================================================================
  379. Func _GUICtrlSlider_SetSel($hWnd, $iMinimum, $iMaximum)
  380. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  381. _SendMessage($hWnd, $TBM_SETSEL, True, _WinAPI_MakeLong($iMinimum, $iMaximum))
  382. EndFunc ;==>_GUICtrlSlider_SetSel
  383. ; #FUNCTION# ====================================================================================================================
  384. ; Author ........: Gary Frost (gafrost)
  385. ; Modified.......:
  386. ; ===============================================================================================================================
  387. Func _GUICtrlSlider_SetSelEnd($hWnd, $iMaximum)
  388. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  389. _SendMessage($hWnd, $TBM_SETSELEND, True, $iMaximum)
  390. EndFunc ;==>_GUICtrlSlider_SetSelEnd
  391. ; #FUNCTION# ====================================================================================================================
  392. ; Author ........: Gary Frost (gafrost)
  393. ; Modified.......:
  394. ; ===============================================================================================================================
  395. Func _GUICtrlSlider_SetSelStart($hWnd, $iMinimum)
  396. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  397. _SendMessage($hWnd, $TBM_SETSELSTART, True, $iMinimum)
  398. EndFunc ;==>_GUICtrlSlider_SetSelStart
  399. ; #FUNCTION# ====================================================================================================================
  400. ; Author ........: Gary Frost (gafrost)
  401. ; Modified.......:
  402. ; ===============================================================================================================================
  403. Func _GUICtrlSlider_SetThumbLength($hWnd, $iLength)
  404. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  405. _SendMessage($hWnd, $TBM_SETTHUMBLENGTH, $iLength)
  406. EndFunc ;==>_GUICtrlSlider_SetThumbLength
  407. ; #FUNCTION# ====================================================================================================================
  408. ; Author ........: Gary Frost (gafrost)
  409. ; Modified.......:
  410. ; ===============================================================================================================================
  411. Func _GUICtrlSlider_SetTic($hWnd, $iPosition)
  412. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  413. _SendMessage($hWnd, $TBM_SETTIC, 0, $iPosition)
  414. EndFunc ;==>_GUICtrlSlider_SetTic
  415. ; #FUNCTION# ====================================================================================================================
  416. ; Author ........: Gary Frost (gafrost)
  417. ; Modified.......:
  418. ; ===============================================================================================================================
  419. Func _GUICtrlSlider_SetTicFreq($hWnd, $iFreg)
  420. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  421. _SendMessage($hWnd, $TBM_SETTICFREQ, $iFreg)
  422. EndFunc ;==>_GUICtrlSlider_SetTicFreq
  423. ; #FUNCTION# ====================================================================================================================
  424. ; Author ........: Gary Frost (gafrost)
  425. ; Modified.......:
  426. ; ===============================================================================================================================
  427. Func _GUICtrlSlider_SetTipSide($hWnd, $iLocation)
  428. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  429. _SendMessage($hWnd, $TBM_SETTIPSIDE, $iLocation)
  430. EndFunc ;==>_GUICtrlSlider_SetTipSide
  431. ; #FUNCTION# ====================================================================================================================
  432. ; Author ........: Gary Frost (gafrost)
  433. ; Modified.......:
  434. ; ===============================================================================================================================
  435. Func _GUICtrlSlider_SetToolTips($hWnd, $hWndTT)
  436. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  437. _SendMessage($hWnd, $TBM_SETTOOLTIPS, $hWndTT, 0, 0, "hwnd")
  438. EndFunc ;==>_GUICtrlSlider_SetToolTips
  439. ; #FUNCTION# ====================================================================================================================
  440. ; Author ........: Gary Frost (gafrost)
  441. ; Modified.......:
  442. ; ===============================================================================================================================
  443. Func _GUICtrlSlider_SetUnicodeFormat($hWnd, $bUnicode)
  444. If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
  445. Return _SendMessage($hWnd, $TBM_SETUNICODEFORMAT, $bUnicode) <> 0
  446. EndFunc ;==>_GUICtrlSlider_SetUnicodeFormat