Jump to content
Sign in to follow this  
myspacee

Desktop widget anchored on right

Recommended Posts

myspacee

Hello,
try to build a widget with some tools inside. I want that this GUI is anchored on the right and have as first tool a drag&drop area.

I imagine something like this, without trasparencies and other things  :

Widget-Bar.jpg

replacing clock with a drag&drop area. (exist AI function to enable drag&drop for multiple files ? )

 

thank you fro any examples,

m.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • UEZ
      By UEZ
      Nothing special - just another analogue clock.  -> Read https://en.wikipedia.org/wiki/Swiss_railway_clock for more information.

       
      Requires Windows7+ OS!
      ;the Hilfiker / MobaTime Swiss Railway Clock ;coded by UEZ build 2018-03-01 ;thanks to Eukalyptus for the _CreateBrushedAluminum() function! #Pragma Compile(Icon, "GDI+ Swiss Railway Clock.ico") #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /pe /rm #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3" #AutoIt3Wrapper_UseX64=n Break(0) #include <GDIPlus.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> ProcessSetPriority(@AutoItPID, $PROCESS_LOW) _GDIPlus_Startup() Global $hGUI, $iFPS = 0, $iShowFPS = 0, $bExit Global Const $iW = 512, $iH = $iW, $iWh = $iW / 2, $iHh = $iH / 2, $sTitle = "GDI+ Swiss Railway Clock v1.1" Global Const $fRad = ACos(-1) / 180, $fDeg = 180 / ACos(-1), $iTimer = 30, $fDeltaShadow = $iW * 0.020 Global $hDC, $hCanvas, $hBitmap_Clock, $hBrush_Shadow, $hBrush_Update, $hPen_Update, $fDiameter = $iW, $hDC_backbuffer, $fShadowAngle, $fMin_next, _ $fRadius = $fDiameter / 2, $fSec, $fMin, $fHr, $fAmplitude = 3 AutoItSetOption("GUIOnEventMode", 1) GDIPlus_SwissRailwayClock() AutoItSetOption("GUIOnEventMode", 0) _GDIPlus_Shutdown() Func GDIPlus_SwissRailwayClock() $bExit = False $hGUI = GUICreate($sTitle, $iW + $fDeltaShadow, $iH + $fDeltaShadow, -1, -1, -1, $WS_EX_TOPMOST) GUISetBkColor(0xFFFFFF, $hGUI) GUISetState(@SW_SHOW, $hGUI) ;~ GUISetCursor(16, 1) ;create canvas elements $hDC = _WinAPI_GetDC($hGUI) Local Const $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $iW + $fDeltaShadow, $iH + $fDeltaShadow) $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC) Local Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBitmap) $hCanvas = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer) $hBrush_Shadow = _GDIPlus_BrushCreateSolid(0x14A0A0A0) $hPen_Update = _GDIPlus_PenCreate(0xFFA02020) $hBrush_Update = _GDIPlus_BrushCreateSolid(0) _GDIPlus_GraphicsSetSmoothingMode($hCanvas, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsSetPixelOffsetMode($hCanvas, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) $fDiameter = $fDiameter < 128 ? 128 : $fDiameter > 1024 ? 1024 : $fDiameter $hBitmap_Clock = GenerateClockBg($fDiameter) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_About") $fMin_next = @MIN GUIRegisterMsg($WM_TIMER, "Draw") ;$WM_TIMER = 0x0113 Local $iID = DllCall("User32.dll", "uint_ptr", "SetTimer", "hwnd", $hGUI, "uint_ptr", 1, "uint", $iTimer, "ptr", 0)[0] Do If $bExit Then ExitLoop Until Not Sleep(100) ;release resources GUIRegisterMsg($WM_TIMER, "") DllCall("user32.dll", "bool", "KillTimer", "hwnd", $hGUI, "uint_ptr", $iID) _GDIPlus_PenDispose($hPen_Update) _GDIPlus_BrushDispose($hBrush_Shadow) _GDIPlus_BrushDispose($hBrush_Update) _GDIPlus_GraphicsDispose($hCanvas) _WinAPI_SelectObject($hDC_backbuffer, $DC_obj) _WinAPI_DeleteDC($hDC_backbuffer) _WinAPI_DeleteObject($hHBitmap) _WinAPI_ReleaseDC($hGUI, $hDC) GUIDelete($hGUI) EndFunc ;==>GDIPlus_SwissRailwayClock Func Draw($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam _GDIPlus_GraphicsDrawImageRect($hCanvas, $hBitmap_Clock, 0, 0, $fDiameter + $fDeltaShadow, $fDiameter + $fDeltaShadow) UpdateClock($hCanvas, $fDiameter) _WinAPI_BitBlt($hDC, 0, 0, $iW + $fDeltaShadow, $iH + $fDeltaShadow, $hDC_backbuffer, 0, 0, $SRCCOPY) EndFunc Func _Exit_About() $bExit = True EndFunc ;==>_Exit_About Func UpdateClock($hGfx, $fDiameter) Static $bBounce = 0, $f = 0 Local $m1 = $fDiameter * 0.015 ;hour $fHr = 30 * (@HOUR + @MIN / 60) _GDIPlus_GraphicsTranslateTransform($hGfx, $fRadius, $fRadius) _GDIPlus_GraphicsRotateTransform($hGfx, $fHr) _GDIPlus_GraphicsTranslateTransform($hGfx, -$fRadius, -$fRadius) Local $iWidth1 = $fDiameter * 0.0375, _ $iHeight1 = $fDiameter / 2.5, _ $iWidth12 = $iWidth1 / 2, _ $fPosY = $fDiameter * 0.2, $iWidth2, $iWidth22, $fPosY2 _GDIPlus_BrushSetSolidColor($hBrush_Update, 0xFF101010) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Shadow, _ "float", $fRadius - $iWidth12 + Cos(($fShadowAngle - $fHr) * $fRad) * $m1, _ "float", $fPosY + Sin(($fShadowAngle - $fHr) * $fRad) * $m1, _ "float", $iWidth1, "float", $iHeight1) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Update, _ "float", $fRadius - $iWidth12, _ "float", $fPosY, _ "float", $iWidth1, "float", $iHeight1) _GDIPlus_GraphicsResetTransform($hGfx) ;min If $fMin_next <> @MIN Then $bBounce = 1 Switch $bBounce Case 1 $fMin = (6 * Mod(($fMin_next + 1), 60)) + Sin($f * 1.9) * $fAmplitude If $fAmplitude = 0 Then $fMin_next = @MIN $f = 0 $fAmplitude = 3 $bBounce = 0 Else $fAmplitude -= 0.5 $fAmplitude = $fAmplitude <= 0 ? 0 : $fAmplitude $f += 1 EndIf Case Else $fMin = (6 * @MIN) EndSwitch _GDIPlus_GraphicsTranslateTransform($hGfx, $fRadius, $fRadius) _GDIPlus_GraphicsRotateTransform($hGfx, $fMin) _GDIPlus_GraphicsTranslateTransform($hGfx, -$fRadius, -$fRadius) $iWidth1 = $fDiameter * 0.03 $iHeight1 = $fRadius $iWidth12 = $iWidth1 / 2 $fPosY = $fDiameter * 0.1 DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Shadow, _ "float", $fRadius - $iWidth12 + Cos(($fShadowAngle - $fMin) * $fRad) * $m1, _ "float", $fPosY + Sin(($fShadowAngle - $fMin) * $fRad) * $m1, _ "float", $iWidth1, "float", $iHeight1) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Update, _ "float", $fRadius - $iWidth12, _ "float", $fPosY, _ "float", $iWidth1, "float", $iHeight1) _GDIPlus_GraphicsResetTransform($hGfx) ;sec $fSec = 6 * (@SEC * 1.02564 + @MSEC / 1000) If $fSec >= 360 Then $fSec = 0 _GDIPlus_GraphicsTranslateTransform($hGfx, $fRadius, $fRadius) _GDIPlus_GraphicsRotateTransform($hGfx, $fSec) _GDIPlus_GraphicsTranslateTransform($hGfx, -$fRadius, -$fRadius) $fPosY = $fDiameter * 0.27 $fPosY2 = $fDiameter * 0.19 $iWidth1 = $fDiameter * 0.0095 $iHeight1 = $fRadius * 1.3 - $fPosY $iWidth12 = $iWidth1 / 2 $iWidth2 = $fDiameter * 0.083333 $iWidth22 = $iWidth2 / 2 ;shadow seconds DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Shadow, _ "float", $fRadius + Cos(($fShadowAngle - $fSec) * $fRad) * $m1, _ "float", $fPosY + Sin(($fShadowAngle - $fSec) * $fRad) * $m1, _ "float", $iWidth1 + $fDiameter * 0.006667, "float", $iHeight1 + $fDiameter * 0.006667) DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hGfx, "handle", $hBrush_Shadow, _ "float", $fRadius - $iWidth22 + Cos(($fShadowAngle - $fSec) * $fRad) * $m1, _ "float", $fPosY2 + Sin(($fShadowAngle - $fSec) * $fRad) * $m1, _ "float", $iWidth2, "float", $iWidth2) ;seconds _GDIPlus_BrushSetSolidColor($hBrush_Update, 0xFFC01010) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Update, _ "float", $fRadius - $iWidth12, _ "float", $fPosY, _ "float", $iWidth1, "float", $iHeight1) DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hGfx, "handle", $hBrush_Update, _ "float", $fRadius - $iWidth22, _ "float", $fPosY2, _ "float", $iWidth2, "float", $iWidth2) _GDIPlus_GraphicsResetTransform($hGfx) ;button in the center DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hGfx, "handle", $hBrush_Update, _ "float", $fRadius - $iWidth1, _ "float", $fRadius - $iWidth1, _ "float", 2 * $iWidth1, "float", 2 * $iWidth1) DllCall($__g_hGDIPDll, "int", "GdipDrawEllipse", "handle", $hGfx, "handle", $hPen_Update, _ "float", $fRadius - $iWidth1, _ "float", $fRadius - $iWidth1, _ "float", 2 * $iWidth1, "float", 2 * $iWidth1) EndFunc Func GenerateClockBg($fDiameter) Local Const $hBitmap = _GDIPlus_BitmapCreateFromScan0($fDiameter + $fDeltaShadow, $fDiameter + $fDeltaShadow), $hGfx = _GDIPlus_ImageGetGraphicsContext($hBitmap), _ $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000), $fBorderSize = $fDiameter * 0.03333, _ $hEffect = _GDIPlus_EffectCreateBlur($fDiameter / 50, 0), $hPen = _GDIPlus_PenCreate(0xA0000000, $fBorderSize) _GDIPlus_GraphicsSetSmoothingMode($hGfx, 4) _GDIPlus_GraphicsSetPixelOffsetMode($hGfx, 4) _GDIPlus_GraphicsSetTextRenderingHint($hGfx, 4) _GDIPlus_GraphicsClear($hGfx, 0xFFFFFFFF) Local Const $fSize = $fDiameter * 0.95 - $fBorderSize / 2 Local $fShadow_vx = $fDiameter * 0.0095, $fShadow_vy = $fDiameter * 0.01 $fShadowAngle = ATan($fShadow_vy / $fShadow_vx) * $fDeg If $fShadow_vx < 0 And $fShadow_vy >= 0 Then $fShadowAngle += 180 If $fShadow_vx < 0 And $fShadow_vy < 0 Then $fShadowAngle -= 180 _GDIPlus_GraphicsDrawEllipse($hGfx, $fBorderSize + $fShadow_vx, $fBorderSize + $fShadow_vy, $fSize, $fSize, $hPen) _GDIPlus_BitmapApplyEffect($hBitmap, $hEffect) _GDIPlus_PenSetColor($hPen, 0xF0000000) Local Const $hBitmap_Texture = _CreateBrushedAluminum($fDiameter, $fDiameter, $fShadowAngle) Local Const $hTexture = _GDIPlus_TextureCreate($hBitmap_Texture) DllCall($__g_hGDIPDll, "int", "GdipSetPenBrushFill", "ptr", $hPen, "ptr", $hTexture) _GDIPlus_GraphicsDrawEllipse($hGfx, $fBorderSize, $fBorderSize, $fSize, $fSize, $hPen) _GDIPlus_GraphicsTranslateTransform($hGfx, $fRadius, $fRadius) _GDIPlus_GraphicsRotateTransform($hGfx, -6) _GDIPlus_GraphicsTranslateTransform($hGfx, -$fRadius, -$fRadius) Local $iWidth1 = $fDiameter * 0.026667, $iHeight1 = $fDiameter / 10, $iWidth12 = $iWidth1 / 2, $fPosY = $fDiameter * 0.083333, _ $iWidth2 = $fDiameter * 0.013333, $iHeight2 = $fDiameter * 0.0416667, $iWidth22 = $iWidth2 / 2 For $i = 0 to 59 _GDIPlus_GraphicsTranslateTransform($hGfx, $fRadius, $fRadius) _GDIPlus_GraphicsRotateTransform($hGfx, 6) _GDIPlus_GraphicsTranslateTransform($hGfx, -$fRadius, -$fRadius) Switch Mod($i, 5) Case 0 _GDIPlus_GraphicsFillRect($hGfx, $fRadius - $iWidth12, $fPosY, $iWidth1, $iHeight1, $hBrush) Case Else _GDIPlus_GraphicsFillRect($hGfx, $fRadius - $iWidth22, $fPosY, $iWidth2, $iHeight2, $hBrush) EndSwitch Next _GDIPlus_GraphicsResetTransform($hGfx) Local Const $hBitmap_Logo = _GDIPlus_BitmapCreateFromMemory(_Au3_Icon()) Local Const $hBitmap_Logo_Scaled = _GDIPlus_ImageResize($hBitmap_Logo, $fDiameter * 0.08, $fDiameter * 0.08) Local $aDim = _GDIPlus_ImageGetDimension($hBitmap_Logo_Scaled) _GDIPlus_GraphicsDrawImageRect($hGfx, $hBitmap_Logo_Scaled, $fRadius - $aDim[0] / 2, $fRadius / 1.75, $aDim[0], $aDim[1]) _GDIPlus_ImageDispose($hBitmap_Logo) _GDIPlus_ImageDispose($hBitmap_Logo_Scaled) Local Const $hFamily = _GDIPlus_FontFamilyCreate("Segoe Script"), $hFont = _GDIPlus_FontCreate($hFamily, $fDiameter * 0.025), $hFormat = _GDIPlus_StringFormatCreate() _GDIPlus_StringFormatSetAlign($hFormat, 1) _GDIPlus_StringFormatSetLineAlign($hFormat, 1) ;~ _GDIPlus_BrushSetSolidColor($hBrush, 0xFF400000) _GDIPlus_GraphicsDrawStringEx($hGfx, "Clock by" & @CRLF & "UEZ", $hFont, _GDIPlus_RectFCreate($fRadius - $fRadius * 0.2, $fRadius + $fRadius * 0.2, $fRadius * 0.4, $fRadius * 0.4), $hFormat, $hBrush) _GDIPlus_ImageDispose($hBitmap_Texture) _GDIPlus_BrushDispose($hTexture) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_EffectDispose($hEffect) _GDIPlus_PenDispose($hPen) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGfx) Return $hBitmap EndFunc Func _CreateBrushedAluminum($iW, $iH, $fLightAngle = 40, $iBlurDist = 12, $fBlurTrans = 0.6666, $fRed = 0.8, $fGreen = 0.9, $fBlue = 1, $iLightColor = 0xF0FFFFFF, $fLightSigma = 0.5, $fLightScale = 0.83) ;coded by Eukalyptus! $iBlurDist = Ceiling($iBlurDist) $iBlurDist += 1 - Mod($iBlurDist, 2) Local $iOverSize = 0 For $i = 1 To $iBlurDist Step 2 $iOverSize += $i + $i + 1 Next Local $iWO = $iW + $iOverSize ;========================================= ; Add Noise ;========================================= Local $iNoiseSize = 40 Local $hBmp_Noise = _GDIPlus_BitmapCreateFromScan0($iNoiseSize, $iNoiseSize) Local $hGfx_Noise = _GDIPlus_ImageGetGraphicsContext($hBmp_Noise) Local $tData = _GDIPlus_BitmapLockBits($hBmp_Noise, 0, 0, $iNoiseSize, $iNoiseSize, BitOR($GDIP_ILMREAD, $GDIP_ILMWRITE), $GDIP_PXF32ARGB) Local $iStride = DllStructGetData($tData, "Stride") Local $iWidth = DllStructGetData($tData, "Width") Local $iHeight = DllStructGetData($tData, "Height") Local $pScan0 = DllStructGetData($tData, "Scan0") Local $tPixel = DllStructCreate("dword[" & $iWidth * $iHeight & "];", $pScan0) Local $iAmp For $row = 0 To $iHeight - 1 For $col = 0 To $iWidth - 1 $iAmp = Random(0, 0xFF, 1) DllStructSetData($tPixel, 1, BitOR(0xFF000000, BitShift($iAmp, -16), BitShift($iAmp, -8), $iAmp), $row * $iWidth + $col + 1) Next Next _GDIPlus_BitmapUnlockBits($hBmp_Noise, $tData) ;========================================= ; Create Full NoiseBitmap ;========================================= Local $hBmp_Full = _GDIPlus_BitmapCreateFromScan0($iWO, $iH) Local $hGfx_Full = _GDIPlus_ImageGetGraphicsContext($hBmp_Full) _GDIPlus_GraphicsSetSmoothingMode($hGfx_Full, 4) _GDIPlus_GraphicsSetInterpolationMode($hGfx_Full, 3) Local $iXOff, $iYOff, $iSizeX, $iSizeY For $y = 0 To $iH Step $iNoiseSize / 2 For $x = 0 To $iWO Step $iNoiseSize / 2 $iXOff = Random(0, $iNoiseSize / 2, 1) $iYOff = Random(0, $iNoiseSize / 2, 1) $iSizeX = $iNoiseSize - $iXOff $iSizeY = $iNoiseSize - $iYOff _GDIPlus_GraphicsDrawImageRectRect($hGfx_Full, $hBmp_Noise, $iXOff, $iYOff, $iSizeX, $iSizeY, $x, $y, $iSizeX, $iSizeY) Next Next _GDIPlus_GraphicsDispose($hGfx_Noise) _GDIPlus_BitmapDispose($hBmp_Noise) ;========================================= ; MotionBlur ;========================================= Local $hBmp_Full2 = _GDIPlus_BitmapCreateFromScan0($iWO, $iH) Local $hGfx_Full2 = _GDIPlus_ImageGetGraphicsContext($hBmp_Full2) _GDIPlus_GraphicsSetSmoothingMode($hGfx_Full2, 4) _GDIPlus_GraphicsSetInterpolationMode($hGfx_Full, 3) Local $tColorMatrix = DllStructCreate("float[5]; float[5]; float[5]; float[5]; float[5];") DllStructSetData($tColorMatrix, 1, 1, 1) DllStructSetData($tColorMatrix, 2, 1, 2) DllStructSetData($tColorMatrix, 3, 1, 3) DllStructSetData($tColorMatrix, 4, $fBlurTrans, 4) DllStructSetData($tColorMatrix, 5, 1, 5) Local $hImgAttrib = _GDIPlus_ImageAttributesCreate() DllCall($__g_hGDIPDll, "int", "GdipSetImageAttributesColorMatrix", "ptr", $hImgAttrib, "int", 1, "int", 1, "struct*", $tColorMatrix, "struct*", 0, "int", 0) For $i = 1 To $iBlurDist Step 2 DllCall($__g_hGDIPDll, "int", "GdipDrawImageRectRect", "ptr", $hGfx_Full2, "ptr", $hBmp_Full, _ "float", $i, "float", 0, "float", $iWO, "float", $iH, _ "float", 0, "float", 0, "float", $iWO, "float", $iH, _ "int", 2, "ptr", $hImgAttrib, "ptr", 0, "ptr", 0) If $i >= $iBlurDist Then DllStructSetData($tColorMatrix, 1, $fRed, 1) DllStructSetData($tColorMatrix, 2, $fGreen, 2) DllStructSetData($tColorMatrix, 3, $fBlue, 3) DllStructSetData($tColorMatrix, 4, 1, 4) DllCall($__g_hGDIPDll, "int", "GdipSetImageAttributesColorMatrix", "ptr", $hImgAttrib, "int", 1, "int", 1, "struct*", $tColorMatrix, "struct*", 0, "int", 0) EndIf DllCall($__g_hGDIPDll, "int", "GdipDrawImageRectRect", "ptr", $hGfx_Full, "ptr", $hBmp_Full2, _ "float", $i + 1, "float", 0, "float", $iWO, "float", $iH, _ "float", 0, "float", 0, "float", $iWO, "float", $iH, _ "int", 2, "ptr", $hImgAttrib, "ptr", 0, "ptr", 0) Next _GDIPlus_ImageAttributesDispose($hImgAttrib) _GDIPlus_GraphicsDispose($hGfx_Full2) _GDIPlus_BitmapDispose($hBmp_Full2) _GDIPlus_GraphicsDispose($hGfx_Full) ;========================================= ; Add Light ;========================================= Local $hBmp_Alu = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local $hGfx_Alu = _GDIPlus_ImageGetGraphicsContext($hBmp_Alu) _GDIPlus_GraphicsSetSmoothingMode($hGfx_Alu, 4) _GDIPlus_GraphicsSetInterpolationMode($hGfx_Full, 3) _GDIPlus_GraphicsDrawImage($hGfx_Alu, $hBmp_Full, -$iOverSize, 0) _GDIPlus_BitmapDispose($hBmp_Full) Local $tPointF1 = DllStructCreate("float; float;") Local $tPointF2 = DllStructCreate("float; float;") DllStructSetData($tPointF2, 2, $iH * $fLightScale) $aResult = DllCall($__g_hGDIPDll, "int", "GdipCreateLineBrush", "struct*", $tPointF1, "struct*", $tPointF2, "uint", 0, "uint", $iLightColor, "int", 0, "handle*", 0) If @error Or Not IsArray($aResult) Then Return SetError(1, 4, False) Local $hBrush = $aResult[6] _GDIPlus_LineBrushSetSigmaBlend($hBrush, $fLightSigma) _GDIPlus_LineBrushSetGammaCorrection($hBrush) DllCall($__g_hGDIPDll, "int", "GdipRotateLineTransform", "ptr", $hBrush, "float", $fLightAngle, "int", 0) _GDIPlus_GraphicsFillRect($hGfx_Alu, 0, 0, $iW, $iH, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGfx_Alu) Return $hBmp_Alu EndFunc ;==>_CreateBrushedAluminum ;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2018-02-02 Func _Au3_Icon($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Au3_Icon $Au3_Icon &= 'iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAP0ElEQVR4XtWZW4hs6VXHf+v79qWquruquqtvZ/r0uc8540yScTIQQ0JkDOYyGhIkhhAxxhdR8mDAgAg+6FsE9UVffNMH8S0ERAwS1DFeEo3m6owzmUySc+Zc+15VXZd9+dZyp6ro4pDTORlGIfnDn703TW/+//X9v/Wt3i3PPfccP85w/GhBgLqkS23ixhpRfau6bgItIPpRN5Ag0Xl88jYrxu/E+KA492E0vJd44d245BKQ/H8bkAe80wMOEE5HA5c8SpQ822yv/ubW9vnfffyxR3+vs7r6YcS9HewZnP9ZXPwE0Py/NuCBJj65iERvQPybcNFP4JKzuPgq+CeR6GnwV3FJB4juM+mSNj55Ehe97/LFC5947PL2ey5tb755daW1+fiVc295+qk3fuTShfPPPnb10d+J60sfI6o9BbRer4EIaOLis1Nh6dtBfs6ljY82ljqfiNLFX8X597uk/ksrG4/8ftJo/lq62P51XPQOJHoc3DV8egZYxLkLcW3xQ088fvWTj2ysXItjnxRlGY6Ojmxvb98iJwtnz6xeXO80tx+9tP0Rcf6tuHhzLuS1YwmJLiHuslRVbzQbjydJsrXSbl4RIVlpLZ0xM71+e+cbC41a+8zayuVxlo9CCPnX/vslt7S89iEzy4/7R/+MT7+Lhq2V5dbbO63Ftbwog/feDYdDt7e3R71eo9vt2tbWlkZRRC1NFkHWQDpACmQ/bBuVWUyaiN+Kk9oH2q3mO/Ky0HNn1p9sNxeaBpiBmpl3TlTNqouoqkmFoKp5XuT1NKlVFS5ffOXm54ui2EFIr17afudCLV1SM5mBity+fRuAzc1NVC1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2NUjOjdzxgNBwVh73h3/ooGXrvk2w8esE0PI9Nus11oM9rhHzhi//xtpXV1c+msW92uz0ODw6fA/1t4Es8GDEu3kDcFRclP6Ua2nGcbMdxvI4hzossLdQvAeRFeS/Liv00jddUtej2Bs9pKP4TDYdgOdBD3C4h2wcCrx1M/8kn7j2Y/gxwM03Tz2RZdouHo4GLOuA2EGliNBGpY3qM8+uAoeV3MBvjXBucTJ5dfIcwGgIGlIDxOjAx8DrhgQioEdUjxCmmEQDlaDATGTPF+JRKv24Dbp71GX9M8L84Jo46QVTs6gAAAABJRU5ErkJggg==' Local $bString = _WinAPI_Base64Decode($Au3_Icon) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\au3-icon2.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Au3_Icon Func _WinAPI_Base64Decode($sB64String) Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "") Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]") $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "") Return DllStructGetData($bBuffer, 1) EndFunc ;==>_WinAPI_Base64Decode  
      If you want to run in x64 mode please use AutoIt version 3.3.14.3 since the bug in function _GDIPlus_EffectCreate() has been fixed!
       
      For the widget style clock see here:
       
    • VIP
      By VIP
      The simple widget shows the percentage of cpu, ram used and the CPU temperature (WMI).
      - Every 30s check, sync and update time for computer.
      - Drag adn Drop any files on GUI for reset Attribute (-RAHS) and set Full Access to Everyone !
      - Righ Click on x and click Un/Install app to boot with Windows!
      CPU_Widget_TimeSync.exe CRC32: 1956339E MD5: BFC2B596BD1EDA35D6B02B97F8FB57AE SHA-1: 796A663739EA5AC9890D9FA324A98E987F35E7C8
      Function code from:
      CPU: 
      RAM:  MemGetStats ( )
      Memory:   _WinAPI_EmptyWorkingSet ()
       
    • Omnitica
      By Omnitica
      Hello!
      I'm new to the forums! Couldn't find any threads covering this issue. Sorry if I'm wrong.

      I'm having problems changing the text/value of a input box. The particular box doesn't have a name or id, just: class="jq_hotkeys_enabled form-control".
      This class appears multiple times throughout the source, so I don't think It's right to reference that object. 
      See image 1.
      However, I've managed to find a object with the name "ctl00$content$ctrl$ucServiceTime$rpServicetimes$ctl00$edtHiddenResourceHelper" which contains the value of the input box, and the id for the person in the dropdown/combobox left of it. (with "dummy-1" selected).
      See image 2.
      As you can see the value is 3982,4545     ( name , time )
      But when I try to change the value of it by doing:
      #include <IE.au3> Local $oIE = _IEAttach(WinGetHandle("[CLASS:IEFrame]"),"embedded") Local $oForm = _IEFormGetObjByName($oIE, "aspnetForm") Local $oInput = _IEFormElementGetObjByName($oForm, "ctl00$content$ctrl$ucServiceTime$rpServicetimes$ctl00$edtHiddenResourceHelper") _IEFormElementSetValue($oInput, "3982,1337") The box doesn't get its new value. I  can see in the source that it's changed though.
      See image 3.
       
      However, if I do: 
      #include <IE.au3> Local $oIE = _IEAttach(WinGetHandle("[CLASS:IEFrame]"),"embedded") Local $oForm = _IEFormGetObjByName($oIE, "aspnetForm") Local $oInput = _IEFormElementGetObjByName($oForm, "ctl00$content$ctrl$ucServiceTime$rpServicetimes$ctl00$edtHiddenResourceHelper") _IEFormElementSetValue($oInput, "3982,1337") $oIE.document.parentwindow.execScript("theForm.submit()") ; But it needs to reload the page The box gets its new value after the page reloads by the theForm.submit() function. 
      This is a bit unfortunate as I want the changes to happen instantly like when I type in the box with the keyboard... or select in the combobox.
      Maybe someone knows how I can do this? Looking forward to an answer! 
      Thanks in advance.
       
      Note: Unfortunately I can't provide with the real URL as it is constricted to employees in the company I work for, but let me know If I should provide anything else.
       



    • Svrij22
      By Svrij22
      Hello Autoit,
      I recently made a cool little program that I wanted to share with you guys. I don't know if any of you has Admob, but if you do, this program automatically logs all your data and estimates how much you will make this day or month.
      Current Features:
      *Writes Log
      *Average per Hour
      *Estimated Month
      *Estimated Day
      Here's how it works: It opens an IE page, then reads all the text and splits it in an array, then filters the numbers and then calculates all the estimations.
       
      I hope some of you will use this
       
      Code:
      #include <GUIConstantsEx.au3> #include <IE.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <Date.au3> #Include <GuiEdit.au3> HotKeySet ("^g", "show") #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Admob Widget", 430, 230, 0, 0) $Label1 = GUICtrlCreateLabel("Today:", 8, 8, 80, 17) $Label2 = GUICtrlCreateLabel("Yesterday", 8, 24, 80, 17) $Label3 = GUICtrlCreateLabel("This Month:", 8, 40, 80, 17) $Label4 = GUICtrlCreateLabel("Previous Month:", 8, 56, 80, 17) $Label4 = GUICtrlCreateLabel("Estimated Today:", 8, 72, 185, 17) $Label4 = GUICtrlCreateLabel("Estimated Month:", 8, 88, 185, 17) $Label4 = GUICtrlCreateLabel("Average/Hour:", 8, 104, 185, 17) $state = GUICtrlCreateLabel("State: Logging In", 8, 194, 185, 17) $sleep = GUICtrlCreateCheckbox("Slow mode", 90, 150, 90, 17) $Label4 = GUICtrlCreateLabel("Graph Height:", 8, 152, 80, 17) $Input1 = GUICtrlCreateInput("100", 8, 168, 121, 21) $Label22 = GUICtrlCreateLabel("v3.8", 140, 174, 121, 21) $Label5 = GUICtrlCreateLabel("???", 112, 8, 100, 17) $Label6 = GUICtrlCreateLabel("???", 112, 24, 100, 17) $Label7 = GUICtrlCreateLabel("???", 112, 40, 100, 17) $Label8 = GUICtrlCreateLabel("???", 112, 56, 100, 15) $Label9 = GUICtrlCreateLabel("???", 112, 72, 100, 15) $Label10 = GUICtrlCreateLabel("???", 112, 88, 100, 15) $Label11 = GUICtrlCreateLabel("???", 112, 104, 100, 15) $SmartAvg = GUICtrlCreateCheckbox("Smart Average", 8, 210, 100, 17) $Button1 = GUICtrlCreateButton("View Log", 8, 120, 75, 25) $Button2 = GUICtrlCreateButton("Hide", 90, 120, 75, 25) $editctrl = GUICtrlCreateEdit("", 185, 8, 240, 215, $ES_AUTOVSCROLL + $ES_AUTOHSCROLL) GUISetState(@sw_SHOW) #EndRegion ### END Koda GUI section ### ;Starting Log $NowTime = string (_NowCalc()) $hFileOpen = FileOpen("Log.txt", $FO_APPEND) FileWrite($hFileOpen,$NowTime & " <--- Started (Widget by Svrij22)--->" & @crlf) $Ai = 0 $Aval = 0 $Avalp = 0 global $log = "" CheckLogin() Refresh() $i=0 $imax = 300 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $sTxtFileDir = @scriptdir & "\Log.txt" Run ( "notepad.exe " & $sTxtFileDir, @windowsdir, @sw_MAXIMIZE ) Case $Button2 MsgBox ("","","Press CTRL-G To show again") GUISetState(@sw_hide) EndSwitch sleep (60) $i+=1 if $i>$imax Then Refresh() $i=0 EndIf GUICtrlSetData ($state, "State: Idle "&$i) if GUICtrlRead($sleep) = $GUI_CHECKED Then $imax = 900 Else $imax = 300 EndIf WEnd func show() GUISetState(@sw_SHOW) EndFunc Func CheckLogin() Local $oIE = _IECreate("apps.admob.com", 0, 0, 0) _IELoadWait($oIE) sleep (4000) Local $sText = _IEBodyReadText($oIE) if StringInStr ($sText,"MONETIZE") Then GUICtrlSetData ($state, "State: Logged In Succesfully") sleep (150) Else MsgBox ("","","Failed to Retrieve Data. Please Login to your Admob account on Internet Explorer") $oIE = _IECreate("apps.admob.com",0,1,1) _IELoadWait($oIE) WinClose($Form1) GUICtrlSetData ($state, "State: Error 403") EndIf EndFunc Func Refresh() GUICtrlSetData ($state, "State: Connecting") Local $oIE = _IECreate("apps.admob.com", 0, 0, 0) _IELoadWait($oIE) sleep (4000) GUICtrlSetData ($state, "State: Getting Data") Local $sText = _IEBodyReadText($oIE) If StringInStr ($sText,"Yesterday") Then ; TEST CONNECTION $sText = StringRegExpReplace($sText, " ", "") $sText = StringRegExpReplace($sText, "[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]", "") $sText = StringRegExpReplace($sText, @crlf, "") $sText = StringRegExpReplace($sText, @cr, "") $sText = StringRegExpReplace($sText, @lf, "") $aSplit = StringSplit($sText, "€") _IEQuit($oIE) ;setdata $sToday = $aSplit[2] $sYes = $aSplit[3] $sTM = $aSplit[4] $sPM = $aSplit[5] $sPM = StringTrimRight ($sPM,29) GUICtrlSetData ($Label5,$sToday&" € Euro") GUICtrlSetData ($Label6,$sYes&" € Euro") GUICtrlSetData ($Label7,$sTM&" € Euro") GUICtrlSetData ($Label8,$sPM&" € Euro") GUICtrlSetData ($state, "State: Getting Date") sleep (150) ;Get Date $sTime2 = string (_NowTime()) $sTime2 = StringTrimRight ($sTime2,3) $sTime2 = StringReplace ($sTime2,":",".") $sTime2 = Number ($sTime2) if $sTime2 > 10 Then $sDate = @mday Else $sDate = @mday-1 EndIf GUICtrlSetData ($state, "State: Calculating Month Estimation") sleep (150) ;Calculate Month Estimation $sAvg = $sTM/$sDate $sAvg = $sAvg*31 $sAvg = Round ($sAvg,2) $sAvg = string ($sAvg) GUICtrlSetData ($Label10,$sAvg&" € Euro") GUICtrlSetData ($state, "State: Writing Ini for GM Graph") sleep (150) ;Write ini for GM Graph $hFileOpen = FileOpen("graph.txt", 2) FileWrite($hFileOpen,"[graph]" & @crlf) FileWrite($hFileOpen,"val="&$sToday& @crlf) FileWrite($hFileOpen,"hei="& GUICtrlRead ($Input1) & @crlf) FileWrite($hFileOpen,'date="'& string (_NowTime()) &'"'& @crlf) GUICtrlSetData ($state, "State: Calculating Time") sleep (150) ;Calculate Time again?? $sTime = string (_NowTime()) $sTime = StringTrimRight ($sTime,3) $sTime = StringReplace ($sTime,":",".") $sTime = Number ($sTime) if $sTime > 10 Then $sTime -= 10 Else $sTime += 14 EndIf GUICtrlSetData ($state, "State: Calculating Average/Hour") sleep (150) ;Calculate Average/Hour $sAvgT = $sToday/$sTime $sAvgT = round ($sAvgT,2) GUICtrlSetData ($Label11,$sAvgT&" € Euro") GUICtrlSetData ($state, "State: Calculating Hours Passed") sleep (150) ;Calculate hours passed $sTime = string (_NowTime()) $sTime = StringTrimRight ($sTime,3) $sTime = StringReplace ($sTime,":",".") $sTime = Number ($sTime) if $sTime > 10 Then $sTime -= 10 Else $sTime += 14 EndIf GUICtrlSetData ($state, "State: Calculating Day Estimation") sleep (150) ;Calculate Daily $sToday = Number ($sToday) $sEsti = ($sToday/$sTime)*24 $sEsti = round($sEsti,2) GUICtrlSetData ($Label9,"~"+string($sEsti)&" € Euro") $NowTime = string (_NowCalc()) $NowTime = string (_NowCalc()) GUICtrlSetData ($state, "State: Calculating Smart Average") sleep (150) ;SmartAvg Begin GUICtrlSetData ($state, "State: Calculating Smart Average") sleep (600) if GUICtrlRead($SmartAvg) = $GUI_CHECKED Then $Aval += $sEsti $Ai+=1 $Avalp = ($Aval/$Ai)*0.85 $sEsti = $Avalp GUICtrlSetData ($Label9,$Avalp&" € Euro") EndIf ;SmartAvg End GUICtrlSetData ($state, "State: Writing Log") sleep (150) ;Write Log $hFileOpen = FileOpen("Log.txt", $FO_APPEND) FileWrite($hFileOpen,$NowTime & " Earnings: " & $sToday & " Avg/Hour: " & $sAvgT & " Estimated Earnings: Today: " & $sEsti & " This month:" & $sAvg & @crlf) GUICtrlSetData ($state, "State: Calculating GUI Log") sleep (150) ;Calc gui log $log=$log & string (_NowTime()) & " E: " & $sToday & " A/H: " & $sAvgT & " ET: " & $sEsti & @CRLF GUICtrlDelete ($editctrl) $editctrl = GUICtrlCreateEdit("", 185, 8, 240, 215, $ES_AUTOVSCROLL + $ES_AUTOHSCROLL) _GUICtrlEdit_InsertText($editctrl,$log) GUICtrlSetData ($state, "State: Closing IE") sleep (150) ;Close IE ProcessClose ("iexplore.exe") ProcessClose ("iexplore.exe") Else GUICtrlSetData ($state, "State: Failed to Retrieve Data") EndIf GUICtrlSetData ($state, "State: Cleaning") sleep (500) GUICtrlSetData ($state, "State: Idle") EndFunc (Sorry if my code isn't so advanced and crappy)
    • marcoauto
      By marcoauto
      Ciao,
      I'm trying to filter a draggable Listview using checkbox, but when I filter a listview (idListiview) and I drag and drop a record to another listview, the listview that i filtered returns not filtered and the record that i would drag and drop is not the correct one
      There are 4 listview, LISTVIEWL1, LISTVIEWL2, LISTVIEWL3 and LISTVIEW. The filter must be work for LISTVIEW (and they work)
      Where I wrong?
      This is my script (Is not complete, but I rewrite it for the forum)
      I know that is not an optimized script...
       
      Thanks and sorry for my bad english
       
      Marco
       
      #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <GUIListView.au3> #include <EditConstants.au3> #include "GUIListViewEx.au3" #include <ButtonConstants.au3> #include <StaticConstants.au3> #include "_FileListToArrayEx_Marco.au3" #include <Array.au3> ; ******************************************************************************************************* ; **************************** LETTURA FILE CODICI DALLE CARTELLE *************************************** ; ******************************************************************************************************* ;~ $listaTotaleCodici = _FileListToArrayEx ("images", "*.png", 4);1+4); 1+4+128) ;<== original dim $listaTotaleCodici[11] $listaTotaleCodici[0] = 10 $listaTotaleCodici[1] = "01A_COD1_Tipo1_CHECK2_01_123456789_02_.png" $listaTotaleCodici[2] = "01A_COD2_Tipo1_CHECK3_02_321456789_01_.png" $listaTotaleCodici[3] = "02A_COD1_Tipo1_CHECK2_01_231456798_02_.png" $listaTotaleCodici[4] = "03A_COD1_Tipo2_CHECK1_01_888456789_01_.png" $listaTotaleCodici[5] = "04A_COD2_Tipo2_CHECK1_01_111456789_02_.png" $listaTotaleCodici[6] = "05A_COD1_Tipo1_CHECK2_01_777456789_02_.png" $listaTotaleCodici[7] = "05A_COD1_Tipo3_CHECK1_01_666456789_01_.png" $listaTotaleCodici[8] = "06A_COD1_Tipo1_CHECK2_01_555456789_02_.png" $listaTotaleCodici[9] = "07A_COD1_Tipo3_CHECK2_01_444456789_01_.png" $listaTotaleCodici[10] = "08A_COD1_Tipo1_CHECK2_01_666777789_02_.png" ;~ $listaTotaleCodici[11] = "08A_COD2_Tipo1_CHECK3_01_222456789_02_.png" ; read some png files ; Ex: ; 01A_COD_Tipo1_CHECK2_N_NUMBER_XY.png ; 02A_COD_Tipo1_CHECK2_N_NUMBER_XY.png ; 03A_COD_Tipo3_CHECK1_N_NUMBER_XY.png ; where NUMBER is differentfor any png files ; COD has max 2 values (COD1 or COD2) ; Tipo has max 3 values ; ******************************************************************************************************* ; ********************************* DICHIARAZIONI VARIABILI ********************************************* ; ******************************************************************************************************* dim $aArray[8] dim $filtrare[13] ;array dove vengono memorizzate le parole da filtrare (899, 01, webcom, ecc ecc) Global $fatto = 0 Global $iLV_L1,$iLV_L2,$iLV_L3,$iLV_Codici Dim $idItem[800] Dim $idItemL1[3] Dim $idItemL2[3] Dim $idItemL3[3] Global $idListviewL1, $idListviewL2, $idListviewL3, $idListview $x = 120 $y = 96 $offsetxpreview = 24+100 $offsetypreview = 129+96 $offsetx = $offsetxpreview + $x + 24 $offsety = 12 Global $offsetxradio = 345 Global $aList1, $tmp_String Dim $TotaleCodici[800] Dim $aTempArray[800] Dim $idButton[6] Global $offsetxbutton = 20 Global $offsetybutton = 45 Global $idx=0 Global $b = 0 Global $filtrato = 0 ; ******************************************************************************************************* ; **************************************** PARTENZA GDI ************************************************* ; ******************************************************************************************************* _GDIPlus_Startup() ;~ GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ; ******************************************************************************************************* ; *********************************** CREAZIONE GUI PRINCIPALE ****************************************** ; ******************************************************************************************************* $g_hGUI = GUICreate("GUI", 1038, 700, 192, 124) GUISetState() Global $Graphic = _GDIPlus_GraphicsCreateFromHWND($g_hGUI) ; ******************************************************************************************************* ; **************************************** CREAZIONE CHECKBOX ****************************************** ; ******************************************************************************************************* GUIStartGroup() $RadioCodice1 = GUICtrlCreateCheckbox("CHECK1", $offsetxradio+112, 10, 100, 17) GUICtrlSetState($RadioCodice1, $GUI_CHECKED) $RadioCodice2 = GUICtrlCreateCheckbox("CHECK2", $offsetxradio+227, 10, 100, 17) GUICtrlSetState($RadioCodice2, $GUI_CHECKED) $RadioCodice3 = GUICtrlCreateCheckbox("CHECK3", $offsetxradio+341, 10, 100, 17) GUICtrlSetState($RadioCodice3, $GUI_CHECKED) $Label1 = GUICtrlCreateLabel("LABEL:", $offsetxradio + 24 + 35, 10+2, 50, 17) $RadioTipo1 = GUICtrlCreateCheckbox("Tipo1", $offsetxradio+112, 45, 100, 17) GUICtrlSetState($RadioTipo1, $GUI_CHECKED) $RadioTipo2 = GUICtrlCreateCheckbox("Tipo2", $offsetxradio+227, 45, 100, 17) GUICtrlSetState($RadioTipo2, $GUI_CHECKED) $RadioTipo3 = GUICtrlCreateCheckbox("Tipo3", $offsetxradio+341, 45, 100, 17) GUICtrlSetState($RadioTipo3, $GUI_CHECKED) $LabelTipo = GUICtrlCreateLabel("TIPO:", $offsetxradio + 24 + 35, 45+2, 50, 17) Global $offsetxradio = 345 ;~ GUIStartGroup() $Radio1 = GUICtrlCreateCheckbox("A", $offsetxradio+112, 80, 50, 17) ;~ Local $idCheckbox = GUICtrlCreateCheckbox("Standard Checkbox", 10, 10, 185, 25) GUICtrlSetState($Radio1, $GUI_CHECKED) $Radio2 = GUICtrlCreateCheckbox("B", $offsetxradio+169, 80, 50, 17) GUICtrlSetState($Radio2, $GUI_CHECKED) $Radio3 = GUICtrlCreateCheckbox("C", $offsetxradio+227, 80, 50, 17) GUICtrlSetState($Radio3, $GUI_CHECKED) $Radio4 = GUICtrlCreateCheckbox("D", $offsetxradio+284, 80, 50, 17) GUICtrlSetState($Radio4, $GUI_CHECKED) $Radio5 = GUICtrlCreateCheckbox("E", $offsetxradio+341, 80, 50, 17) GUICtrlSetState($Radio5, $GUI_CHECKED) $Radio6 = GUICtrlCreateCheckbox("F", $offsetxradio+399, 80, 50, 17) GUICtrlSetState($Radio6, $GUI_CHECKED) $Radio7 = GUICtrlCreateCheckbox("ALL", $offsetxradio+456, 80, 50, 17) GUICtrlSetState($Radio7, $GUI_CHECKED) $LabelGruppi = GUICtrlCreateLabel("LABEL:", $offsetxradio + 24 + 35, 80+2, 50, 17) $ButtonFiltra = GUICtrlCreateButton("Filter", 870, 12, 150, 84) ;~ GUICtrlSetBkColor(-1,0x00FF00 $hGraphic = _GDIPlus_GraphicsCreateFromHWND($Graphic) $hPen = _GDIPlus_PenCreate(0xff000000, 2);red, 3pixels wide ; ******************************************************************************************************* ; **************************************** CREAZIONE BOTTONI ******************************************* ; ******************************************************************************************************* $cDelete_Button = GUICtrlCreateButton("Delete Line", 870, 115, 150, 30) $idListviewL1 = GUICtrlCreateListView("LISTVIEWL1", 400, 6+96, 450, 96) _GUICtrlListView_SetColumnWidth($idListviewL1, 0, 446) $idListviewL2 = GUICtrlCreateListView("LISTVIEWL2", 400, 6+96+96, 450, 96) _GUICtrlListView_SetColumnWidth($idListviewL2, 0, 446) $idListviewL3 = GUICtrlCreateListView("LISTVIEWL3", 400, 6+96+96+96, 450, 96) _GUICtrlListView_SetColumnWidth($idListviewL3, 0, 446) $idListview = GUICtrlCreateListView("LISTVIEW", 400, 6+96+96+96+96, 450, 573-96-96-96) _GUICtrlListView_SetColumnWidth($idListview, 0, 446) if $fatto = 0 Then ConsoleWrite("fatto = 0" & @CRLF) For $i = 1 To $listaTotaleCodici[0] ; Loop through the array to display the individual values. local $aArray = StringSplit($listaTotaleCodici[$i], '_');, $STR_ENTIRESPLIT) ; Pass the variable to StringSplit and using the delimiter "\n". Local $aList[$listaTotaleCodici[0]+1], $sText If IsArray($aArray) Then $sText = $aArray[1] & " " & $aArray[2] & " " & $aArray[3] & " " & $aArray[4] & " " & $aArray[6] $aList[$i] = $sText GUICtrlCreateListViewItem($sText, $idListview) EndIf Next $iLV_Codici = _GUIListViewEx_Init($idListview, $aList, 0, 0, True, 128 + 256) $TotaleEtichetteCodici = _GUIListViewEx_ReadToArray($idListview) $fatto = 1 EndIf $iLV_L1 = _GUIListViewEx_Init($idListviewL1, $idItemL1, 0, 0, True) ; No external drop, will drag to others - items deleted on drag $iLV_L2 = _GUIListViewEx_Init($idListviewL2, $idItemL2, 0, 0, True) ; No external drop, will drag to others - items deleted on drag $iLV_L3 = _GUIListViewEx_Init($idListviewL3, $idItemL3, 0, 0, True) ; No external drop, will drag to others - items deleted on drag ;~ $iLV_Codici = _GUIListViewEx_Init($idListview, $idItem, 0, 0, True, 128 + 256) ; No external drop, will drag to others - items NOT deleted on drag ;~ GUISetState() _GUIListViewEx_MsgRegister() _GUICtrlListView_SetColumnWidth($idListview, 0, $LVSCW_AUTOSIZE_USEHEADER) _GUICtrlListView_SetColumnWidth($idListview, 1, 1) ; <<<<<<<<<<<<<<<<<<<<<<<<<< GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ; ******************************************************************************************************* ; ********************************************* MAIN LOOP *********************************************** ; ******************************************************************************************************* Global $idMsg ;~ ; Loop until the user exits. While 1 Sleep(10) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $cDelete_Button $listaTotaleCodiciaAttiva = _GUIListViewEx_GetActive() ConsoleWrite(" active = " & $listaTotaleCodiciaAttiva & @CRLF) if $listaTotaleCodiciaAttiva <> 1 Then _GUIListViewEx_Delete() EndIf Case $ButtonFiltra _filtraCodici() EndSwitch WEnd ; Clean up resources _GDIPlus_GraphicsDispose($Graphic) _GDIPlus_Shutdown() ; ******************************************************************************************************* ; ***************************************** QUIT FUNCTION *********************************************** ; ******************************************************************************************************* Func Quit() _GDIPlus_Shutdown() Exit EndFunc ; ******************************************************************************************************* ; **************************************** ISCHECKED FUNCTION ******************************************* ; ******************************************************************************************************* Func _IsChecked($idControlID) Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked ; ******************************************************************************************************* ; ************************************ WM_NOTIFY FUNCTION *********************************************** ; ******************************************************************************************************* Func WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam) _GUIListViewEx_WM_NOTIFY_Handler($hWndGUI, $MsgID, $wParam, $lParam) #forceref $hWndGUI, $MsgID, $wParam Local $index $tStruct = DllStructCreate("hwnd;uint_ptr;int_ptr;int;int", $lParam) $hWndFrom = DllStructGetData($tStruct, 1) $idFrom = DllStructGetData($tStruct, 2) $code = DllStructGetData($tStruct, 3) $index = DllStructGetData($tStruct, 4) $hWndListView1 = GUICtrlGetHandle($iLV_L1) ;($idListviewL1) $hWndListView2 = GUICtrlGetHandle($iLV_L2) ;($idListviewL2) $hWndListView3 = GUICtrlGetHandle($iLV_L3) ;($idListviewL3) $hWndListViewCodici = GUICtrlGetHandle($iLV_Codici) ;($idListview) Switch $code Case $NM_CLICK ;Left Mouse Button ConsoleWrite("left mouse button") Switch $idFrom Case $iLV_L1 $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) ;~ ConsoleWrite("+Click: " & $index & @CRLF) $text = _GUICtrlListView_GetItemText($iLV_L1, DllStructGetData($tInfo, "Index")) ConsoleWrite("+text: " & $text & @CRLF) EndSwitch Case $NM_DBLCLK ;Double Left Mouse Button Switch $idFrom Case $idListviewL1 $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) ;~ ConsoleWrite("+Click: " & $index & @CRLF) $text = _GUICtrlListView_GetItemText($idListviewL1, DllStructGetData($tInfo, "Index")) ConsoleWrite("+textDBClick: " & $text & @CRLF) Case $idListview $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) ;~ ConsoleWrite("+Click: " & $index & @CRLF) $text = _GUICtrlListView_GetItemText($idListview, DllStructGetData($tInfo, "Index")) ConsoleWrite("+textDBClick: " & $text & @CRLF) EndSwitch Case $GUI_EVENT_CLOSE Quit() EndSwitch EndFunc ;==>WM_NOTIFY ; ******************************************************************************************************* ; ***************************************** FILTRA CODICI *********************************************** ; ******************************************************************************************************* Func _filtraCodici() $aTempArray = $TotaleEtichetteCodici ;$listaTotaleCodici Local $filtrato = 0 If _IsChecked($Radio1) Then $filtrare[1] = 1 Else $filtrare[1] = "A" $filtrato = 1 For $b=UBound($aTempArray) -1 to 0 step -1 Global $tmp_String = StringLeft($aTempArray[$b][0],3) If StringInStr($tmp_String,$filtrare[1]) Then _ArrayDelete($aTempArray, $b) EndIf Next EndIf If _IsChecked($Radio2) Then $filtrare[2] = 1 Else $filtrare[2] = "B" $filtrato = 1 For $b=UBound($aTempArray) -1 to 0 step -1 Global $tmp_String = StringLeft($aTempArray[$b][0],3) If StringInStr($tmp_String,$filtrare[2]) Then _ArrayDelete($aTempArray, $b) EndIf Next EndIf If _IsChecked($Radio3) Then $filtrare[3] = 1 Else $filtrare[3] = "C" $filtrato = 1 For $b=UBound($aTempArray) -1 to 0 step -1 Global $tmp_String = StringLeft($aTempArray[$b][0],3) If StringInStr($tmp_String,$filtrare[3]) Then _ArrayDelete($aTempArray, $b) EndIf Next EndIf If _IsChecked($Radio4) Then $filtrare[4] = 1 Else $filtrare[4] = "D" $filtrato = 1 For $b=UBound($aTempArray) -1 to 0 step -1 Global $tmp_String = StringLeft($aTempArray[$b][0],3) If StringInStr($tmp_String,$filtrare[4]) Then _ArrayDelete($aTempArray, $b) EndIf Next EndIf If _IsChecked($Radio5) Then $filtrare[5] = 1 Else $filtrare[5] = "E" $filtrato = 1 For $b=UBound($aTempArray) -1 to 0 step -1 Global $tmp_String = StringLeft($aTempArray[$b][0],3) If StringInStr($tmp_String,$filtrare[5]) Then _ArrayDelete($aTempArray, $b) EndIf Next EndIf If _IsChecked($Radio6) Then $filtrare[6] = 1 Else $filtrare[6] = "F" $filtrato = 1 For $b=UBound($aTempArray) -1 to 0 step -1 Global $tmp_String = StringLeft($aTempArray[$b][0],3) If StringInStr($tmp_String,$filtrare[6]) Then _ArrayDelete($aTempArray, $b) EndIf Next EndIf If _IsChecked($RadioTipo1) Then $filtrare[7] = 1 Else $filtrare[7] = "Tipo1" $filtrato = 1 For $b=UBound($aTempArray) -1 to 0 step -1 Global $tmp_String = $aTempArray[$b][0] If StringInStr($tmp_String,$filtrare[7]) Then _ArrayDelete($aTempArray, $b) EndIf Next EndIf If _IsChecked($RadioTipo2) Then $filtrare[8] = 1 Else $filtrare[8] = "Tipo2" $filtrato = 1 For $b=UBound($aTempArray) -1 to 0 step -1 $tmp_String = $aTempArray[$b][0] If StringInStr($tmp_String,$filtrare[8]) Then _ArrayDelete($aTempArray, $b) EndIf Next EndIf If _IsChecked($RadioTipo3) Then $filtrare[9] = 1 Else $filtrare[9] = "Tipo3" $filtrato = 1 For $b=UBound($aTempArray) -1 to 0 step -1 $tmp_String = $aTempArray[$b][0] If StringInStr($tmp_String,$filtrare[9]) Then _ArrayDelete($aTempArray, $b) EndIf Next EndIf If _IsChecked($RadioCodice1) Then $filtrare[10] = 1 Else $filtrare[10] = "CHECK1" $filtrato = 1 For $b=UBound($aTempArray) -1 to 0 step -1 Global $tmp_String = $aTempArray[$b][0] If StringInStr($tmp_String,$filtrare[10]) Then _ArrayDelete($aTempArray, $b) EndIf Next EndIf If _IsChecked($RadioCodice2) Then $filtrare[11] = 1 Else $filtrare[11] = "CHECK2" $filtrato = 1 For $b=UBound($aTempArray) -1 to 0 step -1 Global $tmp_String = $aTempArray[$b][0] ;~ ConsoleWrite(@CRLF & "$tmp_Stringgg= " & $tmp_String & @CRLF) If StringInStr($tmp_String,$filtrare[11]) Then _ArrayDelete($aTempArray, $b) EndIf Next EndIf If _IsChecked($RadioCodice3) Then $filtrare[12] = 1 Else $filtrare[12] = "CHECK3" $filtrato = 1 For $b=UBound($aTempArray) -1 to 0 step -1 Global $tmp_String = $aTempArray[$b][0] ;~ ConsoleWrite(@CRLF & "$tmp_Stringgg= " & $tmp_String & @CRLF) If StringInStr($tmp_String,$filtrare[12]) Then _ArrayDelete($aTempArray, $b) EndIf Next EndIf _ArrayDisplay($aTempArray,"fine ciclo") _GUICtrlListView_DeleteAllItems($idListview) ;~ $iLV_Codici = _GUIListViewEx_Close($idListview) ConsoleWrite("_GUICtrlListView_DeleteAllItems" & @CRLF) IF $filtrato = 0 Then For $a=0 to UBound($TotaleEtichetteCodici)-1 ; Loop through the array to display the individual values. Local $aList1[UBound($TotaleEtichetteCodici)], $sText If IsArray($TotaleEtichetteCodici) Then $sText = $TotaleEtichetteCodici[$a][0] ConsoleWrite("sText non filtrato = " & $sText & @CRLF) $aList1[$a] = $sText GUICtrlCreateListViewItem($sText, $idListview) EndIf Next EndIf if $filtrato = 1 Then For $a=0 to UBound($aTempArray)-1 ; Loop through the array to display the individual values. Global $aList1[UBound($aTempArray)], $sText If IsArray($aTempArray) Then $sText = $aTempArray[$a][0] ConsoleWrite("sText = " & $sText & @CRLF) $aList1[$a] = $sText GUICtrlCreateListViewItem($sText, $idListview) EndIf Next EndIf $iLV_Codici = _GUIListViewEx_Close($idListview) $iLV_Codici = _GUIListViewEx_Init($idListview, $aList1, 0, 0, True, 128 + 256); 0, 0, True, 1 + 2 + 8, "0;2") EndFunc ;==>_filtraCodici
×