Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/24/2011 in all areas

  1. UDF Deprecated - 23 Dec 2013 As since the release of v3.3.10.0 the basis of this UDF is now included in the standard AutoIt UDFs as _FileListToArrayRec in File.au3, support will end in this thread and any future bug reports or feature requests should be made via Trac. Note that there are a couple of major changes in the new function compared to this UDF: - You must place the Include|Exclude|Exclude_Folder masks in the single $sMask parameter, delimited by "|". The old syntax with the "exclude" masks at the end of the parameter list will no longer work, unlike this UDF. - The values returned in @extended in the event of an error have been reordered to reflect the above - so you might need to amend your errorchecking. But note that "no files found" still returns 9 in @extended - I am not that cruel! - The sort algorithm has been changed from QuickSort to DualPivot, which is significantly faster for large arrays. I hope you appreciate the faster return times. This zip remians available for those who do not wish to update immediately: RFLTA.zip M23
    1 point
  2. Jon

    AutoIt v3.3.8.0 Released

    AutoIt v3.3.8.0 Released Thanks to all involved in coding and testing. Merry xmas. Download History Script Breaking Changes
    1 point
  3. It was done in this post, but I decided to create a separate topic. Maybe it will be useful to someone... #Include <GUIButton.au3> #Include <GUIImageList.au3> #Include <WinAPI.au3> #Include <WindowsConstants.au3> GUICreate('MyGUI', 200, 200) GUICtrlCreateButton('', 65, 170, 70, 23) _GUICtrlButton_SetTextColor(-1, 'OK', 0xFF0000) GUISetState() Do Until GUIGetMsg() = -3 Func _GUICtrlButton_SetTextColor($iCtrlID, $sText, $iTextColor) Local $hWnd, $hTheme, $hImageList, $hBitmap, $hBack, $hDC, $hMemDC, $hSrcDC, $tRect, $pRect, $Width, $Height, $Prev, $Flags = BitOR($DT_CENTER, $DT_SINGLELINE, $DT_VCENTER) $hWnd = GUICtrlGetHandle($iCtrlID) If Not $hWnd Then Return 0 EndIf $hTheme = DllCall('uxtheme.dll', 'ptr', 'OpenThemeData', 'hwnd', $hWnd, 'wstr', 'BUTTON') If (@error) Or (Not $hTheme[0]) Then GUICtrlSetColor($iCtrlID, $iTextColor) GUICtrlSetData($iCtrlID, $sText) Return 1 EndIf $Width = _WinAPI_GetClientWidth($hWnd) $Height = _WinAPI_GetClientHeight($hWnd) $hImageList = _GUIImageList_Create($Width - 8, $Height - 8, 4, 4) $tRect = DllStructCreate('int[4]') DllStructSetData($tRect, 1, -4, 1) DllStructSetData($tRect, 1, -4, 2) DllStructSetData($tRect, 1, $Width - 4, 3) DllStructSetData($tRect, 1, $Height - 4, 4) $pRect = DllStructGetPtr($tRect) $hDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hDC) $hSrcDC = _WinAPI_CreateCompatibleDC($hDC) $hBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $Width - 8, $Height - 8) $hBack = _WinAPI_CreateCompatibleBitmap($hDC, $Width - 8, $Height - 8) _WinAPI_ReleaseDC(0, $hDC) _WinAPI_SelectObject($hSrcDC, $hBack) _WinAPI_SelectObject($hMemDC, _SendMessage($hWnd, $WM_GETFONT)) _WinAPI_SetTextColor($hMemDC, BitOR(BitAND($iTextColor, 0x00FF00), BitShift(BitAND($iTextColor, 0x0000FF), -16), BitShift(BitAND($iTextColor, 0xFF0000), 16))) _WinAPI_SetBkMode($hMemDC, $TRANSPARENT) ; PBS_NORMAL, PBS_HOT, PBS_PRESSED, PBS_DISABLED, PBS_DEFAULTED For $i = 1 To 5 $Prev = _WinAPI_SelectObject($hMemDC, $hBitmap) DllCall('uxtheme.dll', 'int', 'DrawThemeBackground', 'ptr', $hTheme[0], 'hwnd', $hSrcDC, 'int', 1, 'int', $i, 'ptr', $pRect, 'ptr', 0) _WinAPI_BitBlt($hMemDC, 0, 0, $Width - 8, $Height - 8, $hSrcDC, 0, 0, $MERGECOPY) If $i = 4 Then DllCall('uxtheme.dll', 'int', 'DrawThemeText', 'ptr', $hTheme[0], 'hwnd', $hMemDC, 'int', 1, 'int', 4, 'wstr', $sText, 'int', -1, 'dword', $Flags, 'dword', 0, 'ptr', $pRECT) Else _WinAPI_DrawText($hMemDC, $sText, $tRect, $Flags) EndIf _WinAPI_SelectObject($hMemDC, $Prev) _GUIImageList_Add($hImageList, $hBitmap) Next ; PBS_HOT (Stylus Hot) _GUIImageList_SetImageCount($hImageList, 6) _GUIImageList_Copy($hImageList, 1, 5) _WinAPI_DeleteDC($hMemDC) _WinAPI_DeleteDC($hSrcDC) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteObject($hBack) DllCall('uxtheme.dll', 'int', 'CloseThemeData', 'ptr', $hTheme[0]) $Prev = _GUICtrlButton_GetImageList($hWnd) If $Prev[0] Then _GUIImageList_Destroy($Prev[0]) EndIf GUICtrlSetData($iCtrlID, '') If Not _GUICtrlButton_SetImageList($hWnd, $hImageList, 4) Then _GUIImageList_Destroy($hImageList) Return 0 EndIf Return 1 EndFunc ;==>_GUICtrlButton_SetTextColor
    1 point
  4. Yashied

    Button Text Color

    Fixed. #Include <GUIButton.au3> #Include <GUIImageList.au3> #Include <WinAPI.au3> #Include <WindowsConstants.au3> GUICreate('MyGUI', 200, 200) GUICtrlCreateButton('', 65, 170, 70, 23) _GUICtrlButton_SetTextColor(-1, 'OK', 0xFF0000) GUISetState() Do Until GUIGetMsg() = -3 Func _GUICtrlButton_SetTextColor($iCtrlID, $sText, $iTextColor) Local $hWnd, $hTheme, $hImageList, $hBitmap, $hBack, $hDC, $hMemDC, $hSrcDC, $tRect, $pRect, $Width, $Height, $Prev, $Flags = BitOR($DT_CENTER, $DT_SINGLELINE, $DT_VCENTER) $hWnd = GUICtrlGetHandle($iCtrlID) If Not $hWnd Then Return 0 EndIf $hTheme = DllCall('uxtheme.dll', 'ptr', 'OpenThemeData', 'hwnd', $hWnd, 'wstr', 'BUTTON') If (@error) Or (Not $hTheme[0]) Then GUICtrlSetColor($iCtrlID, $iTextColor) GUICtrlSetData($iCtrlID, $sText) Return 1 EndIf $Width = _WinAPI_GetClientWidth($hWnd) $Height = _WinAPI_GetClientHeight($hWnd) $hImageList = _GUIImageList_Create($Width - 8, $Height - 8, 4, 4) $tRect = DllStructCreate('int[4]') DllStructSetData($tRect, 1, -4, 1) DllStructSetData($tRect, 1, -4, 2) DllStructSetData($tRect, 1, $Width - 4, 3) DllStructSetData($tRect, 1, $Height - 4, 4) $pRect = DllStructGetPtr($tRect) $hDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hDC) $hSrcDC = _WinAPI_CreateCompatibleDC($hDC) $hBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $Width - 8, $Height - 8) $hBack = _WinAPI_CreateCompatibleBitmap($hDC, $Width - 8, $Height - 8) _WinAPI_ReleaseDC(0, $hDC) _WinAPI_SelectObject($hSrcDC, $hBack) _WinAPI_SelectObject($hMemDC, _SendMessage($hWnd, $WM_GETFONT)) _WinAPI_SetTextColor($hMemDC, BitOR(BitAND($iTextColor, 0x00FF00), BitShift(BitAND($iTextColor, 0x0000FF), -16), BitShift(BitAND($iTextColor, 0xFF0000), 16))) _WinAPI_SetBkMode($hMemDC, $TRANSPARENT) ; PBS_NORMAL, PBS_HOT, PBS_PRESSED, PBS_DISABLED, PBS_DEFAULTED For $i = 1 To 5 $Prev = _WinAPI_SelectObject($hMemDC, $hBitmap) DllCall('uxtheme.dll', 'int', 'DrawThemeBackground', 'ptr', $hTheme[0], 'hwnd', $hSrcDC, 'int', 1, 'int', $i, 'ptr', $pRect, 'ptr', 0) _WinAPI_BitBlt($hMemDC, 0, 0, $Width - 8, $Height - 8, $hSrcDC, 0, 0, $MERGECOPY) If $i = 4 Then DllCall('uxtheme.dll', 'int', 'DrawThemeText', 'ptr', $hTheme[0], 'hwnd', $hMemDC, 'int', 1, 'int', 4, 'wstr', $sText, 'int', -1, 'dword', $Flags, 'dword', 0, 'ptr', $pRECT) Else _WinAPI_DrawText($hMemDC, $sText, $tRect, $Flags) EndIf _WinAPI_SelectObject($hMemDC, $Prev) _GUIImageList_Add($hImageList, $hBitmap) Next ; PBS_HOT (Stylus Hot) _GUIImageList_SetImageCount($hImageList, 6) _GUIImageList_Copy($hImageList, 1, 5) _WinAPI_DeleteDC($hMemDC) _WinAPI_DeleteDC($hSrcDC) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteObject($hBack) DllCall('uxtheme.dll', 'int', 'CloseThemeData', 'ptr', $hTheme[0]) $Prev = _GUICtrlButton_GetImageList($hWnd) If $Prev[0] Then _GUIImageList_Destroy($Prev[0]) EndIf GUICtrlSetData($iCtrlID, '') If Not _GUICtrlButton_SetImageList($hWnd, $hImageList, 4) Then _GUIImageList_Destroy($hImageList) Return 0 EndIf Return 1 EndFunc ;==>_GUICtrlButton_SetTextColor
    1 point
×
×
  • Create New...