-
Posts
11,869 -
Joined
-
Last visited
-
Days Won
66
mLipok last won the day on March 29
mLipok had the most liked content!
About mLipok

- Birthday 07/19/1978
Profile Information
-
Member Title
Sometimes... even usually I'm nitpicky.
-
Location
Europe, Poland, Upper Silesia, Zabrze
-
Interests
¯\_(ツ)_/¯
Recent Profile Visitors
mLipok's Achievements
-
mLipok reacted to a post in a topic:
ListView - ScrollBar color with WM_CTLCOLORSCROLLBAR
-
mLipok reacted to a post in a topic:
ListView - ScrollBar color with WM_CTLCOLORSCROLLBAR
-
WildByDesign reacted to a post in a topic:
GUIDarkTheme UDF
-
@WildByDesign you UDF is for _GUIDarkTheme_* .... ahhhh... wondering why not for Theme at all ? EDIT: rewordering: you UDF is for _GUIDarkTheme_* .... ahhhh... wondering why not for all possible Theme cases?
-
ListView - ScrollBar color with WM_CTLCOLORSCROLLBAR
mLipok replied to mLipok's topic in AutoIt GUI Help and Support
Also here are some interesting findings: https://superuser.com/a/1435181/1049106 about Registry settings: also you may want to take a look here: -
mLipok reacted to a post in a topic:
GUIDarkTheme UDF
-
ListView - ScrollBar color with WM_CTLCOLORSCROLLBAR
mLipok replied to mLipok's topic in AutoIt GUI Help and Support
Here is my another approach: #include <ColorConstants.au3> #include <GuiConstants.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> _Example() Func _Example() Local $hGUI = GUICreate("Test", 400, 200, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_HSCROLL, $WS_VSCROLL)) GUISetBkColor($COLOR_LIGHTSEAGREEN, $hGUI) Local $hScrollBarGUI = _SBCreate($hGUI, 1000, 20, 30, 330, 30) #forceref $hScrollBarGUI ;~ GUIRegisterMsg($WM_CTLCOLORSCROLLBAR, __WM_CTLCOLORSCROLLBAR) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Example Func _SBCreate($hWnd, $idCtrlID, $iX, $iY, $iWidth, $iHeight, $iStyle = -1, $iExStyle = $WS_EX_TOPMOST, $bBorder = True) If $iStyle = -1 Then $iStyle = BitOR($WS_VISIBLE, $WS_CHILD) If $iExStyle = -1 Then $iExStyle = 0 If $bBorder Then Local $idLabel = GUICtrlCreateLabel("", $iX - 2, $iY - 2, $iWidth + 4, $iHeight + 4, $SS_BLACKRECT) GUICtrlSetColor($idLabel, $COLOR_LIGHTCORAL) EndIf Return _WinAPI_CreateWindowEx($iExStyle, $WC_SCROLLBAR, "", $iStyle, $iX, $iY, $iWidth, $iHeight, $hWnd, $idCtrlID, _WinAPI_GetModuleHandle(0), 0) EndFunc ;==>_SBCreate Func __WM_CTLCOLORSCROLLBAR($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam ;~ Return _WinAPI_GetStockObject($BLACK_BRUSH) ;~ Return _WinAPI_GetStockObject($DKGRAY_BRUSH) Return _WinAPI_GetStockObject($GRAY_BRUSH) ;~ Local $tItem = DllStructCreate($tagNMLVCUSTOMDRAW, $lParam) ; $tagNMLVCUSTOMDRAW is defined in #include <StructureConstants.au3> ; https://learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-nmlvcustomdraw ;~ Local $hDC = $tItem.hdc ; Device context ;~ Return _WinAPI_SetDCBrushColor($hDC, $COLOR_LIGHTBLUE) EndFunc ;==>__WM_CTLCOLORSCROLLBAR But I see that $WS_EX_TOPMOST is not working as I expected. I mean I can't click / move the ScrollBar created with _SBCreate() as my $idLabel is cover this scrollbar. Any body has better / easier way to draw border in specific color for this ScrollBar created with _SBCreate() ? Or just move Z order of the ScrollBar over the Label ? -
ListView - ScrollBar color with WM_CTLCOLORSCROLLBAR
mLipok replied to mLipok's topic in AutoIt GUI Help and Support
Little modified #include <ColorConstants.au3> #include <GuiConstants.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> _Example() Func _Example() Local $hGUI = GUICreate("Test", 400, 200, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_HSCROLL, $WS_VSCROLL)) GUISetBkColor($COLOR_LIGHTSEAGREEN, $hGUI) Local $hScrollBarGUI = _SBCreate($hGUI, 1000, 20, 30, 330, 30) #forceref $hScrollBarGUI GUIRegisterMsg($WM_CTLCOLORSCROLLBAR, __WM_CTLCOLORSCROLLBAR) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Example Func _SBCreate($hWnd, $idCtrlID, $iX, $iY, $iWidth, $iHeight, $iStyle = -1, $iExStyle = -1) If $iStyle = -1 Then $iStyle = BitOR($WS_VISIBLE, $WS_CHILD) If $iExStyle = -1 Then $iExStyle = 0 Return _WinAPI_CreateWindowEx($iExStyle, $WC_SCROLLBAR, "", $iStyle, $iX, $iY, $iWidth, $iHeight, $hWnd, $idCtrlID, _WinAPI_GetModuleHandle(0), 0) EndFunc ;==>_SBCreate Func __WM_CTLCOLORSCROLLBAR($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam ;~ Return _WinAPI_GetStockObject($BLACK_BRUSH) ;~ Return _WinAPI_GetStockObject($DKGRAY_BRUSH) Return _WinAPI_GetStockObject($GRAY_BRUSH) ;~ Local $tItem = DllStructCreate($tagNMLVCUSTOMDRAW, $lParam) ; $tagNMLVCUSTOMDRAW is defined in #include <StructureConstants.au3> ; https://learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-nmlvcustomdraw ;~ Local $hDC = $tItem.hdc ; Device context ;~ Return _WinAPI_SetDCBrushColor($hDC, $COLOR_LIGHTBLUE) EndFunc ;==>__WM_CTLCOLORSCROLLBAR I read here: https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-getstockobject about: For this reason I was trying to use my specific color like $COLOR_LIGHTBLUE in this part: Local $tItem = DllStructCreate($tagNMLVCUSTOMDRAW, $lParam) ; $tagNMLVCUSTOMDRAW is defined in #include <StructureConstants.au3> ; https://learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-nmlvcustomdraw Local $hDC = $tItem.hdc ; Device context Return _WinAPI_SetDCBrushColor($hDC, $COLOR_LIGHTBLUE) EndFunc ;==>__WM_CTLCOLORSCROLLBAR But with no success Any help please ? EDIT: also tried this way: Local Static $hBrush = _WinAPI_CreateSolidBrush($COLOR_AQUA) Local $tItem = DllStructCreate($tagNMLVCUSTOMDRAW, $lParam) ; $tagNMLVCUSTOMDRAW is defined in #include <StructureConstants.au3> ; https://learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-nmlvcustomdraw Local $hDC = $tItem.hdc ; Device context _WinAPI_SelectObject($hDC, $hBrush) Return $CDRF_SKIPDEFAULT EndFunc ;==>__WM_CTLCOLORSCROLLBAR Still with no success -
mLipok reacted to a post in a topic:
ListView - ScrollBar color with WM_CTLCOLORSCROLLBAR
-
mLipok reacted to a post in a topic:
Scrollbars Made Easy - New version 27 Jan 22
-
mLipok reacted to a post in a topic:
How can I detect if a control is within a Tab control?
-
WildByDesign reacted to a post in a topic:
How can I detect if a control is within a Tab control?
-
WildByDesign reacted to a post in a topic:
How can I detect if a control is within a Tab control?
-
WildByDesign reacted to a post in a topic:
How can I detect if a control is within a Tab control?
-
WildByDesign reacted to a post in a topic:
How can I detect if a control is within a Tab control?
-
WildByDesign reacted to a post in a topic:
How can I detect if a control is within a Tab control?
-
mLipok reacted to a post in a topic:
Help to change color scroll bar listview
-
Scrollbars Made Easy - New version 27 Jan 22
mLipok replied to Melba23's topic in AutoIt Example Scripts
For example, I was thinking about creating an additional window with zero height or a height suitable for displaying a ScrollBar. This additional window could be displayed above the ListView window, or generally above the ListView, so the ListView could remain in the main GUI. Then somehow combine the scrolling of this additional window (maybe in WM_NOTIFY) with the moving of the invisible scrollbar for the Listview. -
Scrollbars Made Easy - New version 27 Jan 22
mLipok replied to Melba23's topic in AutoIt Example Scripts
Hello @Melba23 I just tried to use your example. just modified a little: #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include "GUIScrollbars_Ex.au3" $hGUI = GUICreate("Test", 500, 500) GUISetBkColor(0xFFCCCC) $cButton_1 = GUICtrlCreateButton("Recreate LV", 10, 450, 80, 30) GUISetState() $hAperture = GUICreate("", 400, 400, 50, 10, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) GUISetBkColor(0xCCFFCC) $cLV = _CreateLV(10, 10) _GUIScrollbars_Generate($hAperture, 920, 0, 0, 0, False, 0, True) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton_1 ; Get current horizontal scroll position $iPos = _GUIScrollBars_GetScrollPos($hAperture, $SB_HORZ) ; Move to full left scroll _GUIScrollBars_SetScrollInfoPos($hAperture, $SB_HORZ, 0) Sleep(1000) ; These Sleep lines are just to slow the process for visualisation, they are not otherwise required ; Delete ListView GUICtrlDelete($cLV) Sleep(1000) ; Recreate ListView _CreateLV(50, 50) Sleep(1000) ; Scroll back to previous position _GUIScrollBars_SetScrollInfoPos($hAperture, $SB_HORZ, $iPos) EndSwitch WEnd Func _CreateLV($iX, $iY) $cListView = GUICtrlCreateListView("", $iX, $iY, 900, 300) GUICtrlSetBkColor($cListView, 0xCCCCFF) For $i = 0 To 8 _GUICtrlListView_AddColumn($cListView, "Column " & $i, 100) Next Return $cListView EndFunc ;==>_CreateLV I have 2 questions. Is there a way to use Horizontal scroll a the top of the $hAperture gui. and Is there a way to set different color fo the scroll bar ? maybe with WM_CTLCOLORSCROLLBAR ? -
argumentum reacted to a post in a topic:
Help to change color scroll bar listview
-
mLipok reacted to a post in a topic:
Scrollbars Made Easy - New version 27 Jan 22
-
Help to change color scroll bar listview
mLipok replied to rootx's topic in AutoIt General Help and Support
https://www.codeproject.com/ is not available any more ? -
mLipok reacted to a post in a topic:
Adjustment UDF — Least Squares Adjustment for AutoIt
-
How can I detect if a control is within a Tab control?
mLipok replied to WildByDesign's topic in AutoIt GUI Help and Support
Here is my next example: ;~ https://www.autoitscript.com/forum/topic/213665-how-can-i-detect-if-a-control-is-within-a-tab-control #AutoIt3Wrapper_UseX64=n #include <GUIConstantsEx.au3> #include <GuiTab.au3> #include <WinAPITheme.au3> #include <WinAPISysWin.au3> ; initiate System DPI awareness DllCall("user32.dll", "bool", "SetProcessDpiAwarenessContext", @AutoItX64 ? "int64" : "int", -2) Example() Func Example() Local $hGUI_Main = GUICreate("My GUI Tab", 220, 180) ConsoleWrite("$hGUI_Main= " & $hGUI_Main & @CRLF) GUISetBkColor(0x808080) GUISetFont(9, 300) Local $id_Tab_Main = GUICtrlCreateTab(10, 10, 200, 100) Local $h_Tab_Main = ControlGetHandle($hGUI_Main, "", $id_Tab_Main) ConsoleWrite("$id_Tab_Main= " & $id_Tab_Main & @CRLF) ConsoleWrite("$h_Tab_Main= " & $h_Tab_Main & @CRLF) ConsoleWrite("WIN GET HANDL= " & WinGetHandle($h_Tab_Main) & @CRLF) Local $id_Tab_0 = GUICtrlCreateTabItem("Tab 0") Local $id_CheckBox_0 = GUICtrlCreateCheckbox("Checkbox 0", 20, 50) Local $h_CheckBox_0 = ControlGetHandle($hGUI_Main, "", $id_CheckBox_0) ConsoleWrite("$id_Tab_0= " & $id_Tab_0 & @CRLF) ConsoleWrite("$h_CheckBox_0= " & $h_CheckBox_0 & @CRLF) ConsoleWrite("WIN GET HANDL= " & WinGetHandle($h_CheckBox_0) & @CRLF) Local $hParent = _WinAPI_GetParent($h_CheckBox_0) ConsoleWrite("$hParent= " & WinGetHandle($hParent) & @CRLF) ConsoleWrite("$GA_PARENT= " & _WinAPI_GetAncestor($h_CheckBox_0, $GA_PARENT) & @CRLF) ConsoleWrite("$GA_ROOT= " & _WinAPI_GetAncestor($h_CheckBox_0, $GA_ROOT) & @CRLF) ConsoleWrite("$GA_ROOTOWNER= " & _WinAPI_GetAncestor($h_CheckBox_0, $GA_ROOTOWNER) & @CRLF) Local $id_Tab_1 = GUICtrlCreateTabItem("Tab 1") Local $id_CheckBox_1 = GUICtrlCreateCheckbox("Checkbox 1", 20, 50) ConsoleWrite("$id_Tab_1= " & $id_Tab_1 & @CRLF) ConsoleWrite("$id_CheckBox_1= " & $id_CheckBox_1 & @CRLF) Local $id_Tab_2 = GUICtrlCreateTabItem("Tab 2") Local $id_CheckBox_2 = GUICtrlCreateCheckbox("Checkbox 2", 20, 50) ConsoleWrite("$id_Tab_2= " & $id_Tab_2 & @CRLF) ConsoleWrite("$id_CheckBox_2= " & $id_CheckBox_2 & @CRLF) Local $id_TAB_END = GUICtrlCreateTabItem("") ; end tabitem definition ConsoleWrite("! WARRNING FAKE ID : $id_TAB_END= " & $id_TAB_END & @CRLF) Local $id_TAB_END_DUMMY = GUICtrlCreateDummy() ConsoleWrite("$id_TAB_END_DUMMY= " & $id_TAB_END_DUMMY & @CRLF) Local $id_CheckBox_Out = GUICtrlCreateCheckbox("Checkbox outside the TAB area", 20, 120) ConsoleWrite("$id_CheckBox_Out= " & $id_CheckBox_Out & @CRLF) Local $id_DUMMY_END = GUICtrlCreateDummy() For $IDX = 0 To $id_DUMMY_END ConsoleWrite($IDX & " >>> " & _WinAPI_GetClassName(GUICtrlGetHandle($IDX)) & " >>> " & ControlGetText($hGUI_Main, "", $IDX) & @CRLF) Next GUISetState(@SW_SHOW) Local $idMsg ; Loop until the user exits. While 1 $idMsg = GUIGetMsg() If $idMsg = $GUI_EVENT_CLOSE Then ExitLoop ElseIf $idMsg > $id_Tab_0 And $idMsg < $id_Tab_1 Then ConsoleWrite("Clicked control: " & $idMsg & " on TAB 0 >>> " & _WinAPI_GetClassName(GUICtrlGetHandle($idMsg)) & " >>> " & ControlGetText($hGUI_Main, "", $idMsg) & @CRLF) ElseIf $idMsg > $id_Tab_1 And $idMsg < $id_Tab_2 Then ConsoleWrite("Clicked control: " & $idMsg & " on TAB 1 >>> " & _WinAPI_GetClassName(GUICtrlGetHandle($idMsg)) & " >>> " & ControlGetText($hGUI_Main, "", $idMsg) & @CRLF) ElseIf $idMsg > $id_Tab_2 And $idMsg < $id_TAB_END_DUMMY Then ConsoleWrite("Clicked control: " & $idMsg & " on TAB 2 >>> " & _WinAPI_GetClassName(GUICtrlGetHandle($idMsg)) & " >>> " & ControlGetText($hGUI_Main, "", $idMsg) & @CRLF) EndIf WEnd #Region ; TAB DELETE TEST ConsoleWrite("DELETE TEST 0: " & $id_CheckBox_1 & " >>> " & _WinAPI_GetClassName(GUICtrlGetHandle($id_CheckBox_1)) & " >>> " & ControlGetText($hGUI_Main, "", $id_CheckBox_1) & @CRLF) _GUICtrlTab_DeleteAllItems($id_Tab_Main) ConsoleWrite("DELETE TEST 1: " & $id_CheckBox_1 & " >>> " & _WinAPI_GetClassName(GUICtrlGetHandle($id_CheckBox_1)) & " >>> " & ControlGetText($hGUI_Main, "", $id_CheckBox_1) & @CRLF) MsgBox($MB_TOPMOST, "TEST #" & @ScriptLineNumber, 'Check what happens with CheckBoxes after TabItems was Deleted') GUICtrlDelete($id_Tab_Main) #QUESTION How AutoIt knows that deleting TAB control also internal checkboxes should be deleted ? ConsoleWrite("! DELETE TEST 2: " & $id_CheckBox_1 & " >>> " & _WinAPI_GetClassName(GUICtrlGetHandle($id_CheckBox_1)) & " >>> " & ControlGetText($hGUI_Main, "", $id_CheckBox_1) & @CRLF) MsgBox($MB_TOPMOST, "TEST #" & @ScriptLineNumber, 'Check what happens with CheckBoxes after Tab control was Deleted') #EndRegion ; TAB DELETE TEST EndFunc ;==>Example Take a look speciffically for #Region ; TAB DELETE TEST and -
How can I detect if a control is within a Tab control?
mLipok replied to WildByDesign's topic in AutoIt GUI Help and Support
Another question is why GUICtrlCreateTabItem("") does not immediately create a DUMMY control ID. Local $id_TAB_END = GUICtrlCreateTabItem("") ; end tabitem definition ConsoleWrite("! WARRNING FAKE ID : $id_TAB_END= " & $id_TAB_END & @CRLF) Local $id_TAB_END_DUMMY = GUICtrlCreateDummy() ConsoleWrite("$id_TAB_END_DUMMY= " & $id_TAB_END_DUMMY & @CRLF) It seemed to me that I understood that this ID was being created, because the HelpFile documentation does not mention that it should happen otherwise. what is your opinion? -
How can I detect if a control is within a Tab control?
mLipok replied to WildByDesign's topic in AutoIt GUI Help and Support
It seems that in C++, the programmer, as the application creator, determines by WM_NOTIFY that user is changing TAB from 0 to 1 and calls a function that hides or shows all controls inside TAB 0 or TAB 1. In this case, it seems that AutoIt handles this internally. You'd have to ask @jpm or @Jon about that . -
How can I detect if a control is within a Tab control?
mLipok replied to WildByDesign's topic in AutoIt GUI Help and Support
This isn't a good approach. A given control located in the same area as a TAB may be obscured by it or may obscure the TAB by being outside of that TAB's structure. Like in this following example #include <GUIConstantsEx.au3> #include <WinAPITheme.au3> ; initiate System DPI awareness DllCall("user32.dll", "bool", "SetProcessDpiAwarenessContext", @AutoItX64 ? "int64" : "int", -2) Example() Func Example() GUICreate("My GUI Tab", 220, 110) GUISetBkColor(0x808080) GUISetFont(9, 300) Local $idTab = GUICtrlCreateTab(10, 10, 200, 100) GUICtrlCreateTabItem("tab0") GUICtrlCreateCheckbox("Checkbox 1", 20, 50) GUICtrlCreateTabItem("tab1") GUICtrlCreateTabItem("tab2") GUICtrlCreateTabItem("") ; end tabitem definition GUICtrlCreateCheckbox("Checkbox 2", 0, 0, 220, 110) GUISetState(@SW_SHOW) Local $idMsg ; Loop until the user exits. While 1 $idMsg = GUIGetMsg() If $idMsg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example -
How can I detect if a control is within a Tab control?
mLipok replied to WildByDesign's topic in AutoIt GUI Help and Support
and maybe this MSDN article will be handy: https://learn.microsoft.com/en-us/windows/win32/controls/tab-controls?source=recommendations https://learn.microsoft.com/en-us/windows/win32/controls/tab-controls#default-tab-control-message-processing https://learn.microsoft.com/en-us/windows/win32/controls/tab-controls?source=recommendations#display-area -
How can I detect if a control is within a Tab control?
mLipok replied to WildByDesign's topic in AutoIt GUI Help and Support
just modified the example just try to click each CheckBox and observe the console -
How can I detect if a control is within a Tab control?
mLipok replied to WildByDesign's topic in AutoIt GUI Help and Support
Check also GUICtrlRead() In 'advanced' mode