Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/28/2022 in all areas

  1. @MarluyYour xpath needs to point to the desired Option element. Try this -- _WD_ElementOptionSelect($sSession, $_WD_LOCATOR_ByXPath, "//select[@name='country']//option[@value='BRAZIL']")
    3 points
  2. mike2003, No, at the moment it is fixed at 9pt. I think you are probably the first person to try and change the notification size - so it does not surprise me that it is not as easy as just changing the one variable. I will be looking into both of those reports over the weekend - unless my better half comes up with something more urgent for me to do! M23
    1 point
  3. [New Version] - 27 Jan 22 New: The GUIScrollbar_Ex UDF now recognises Win-D and taskbar desktop clearance commands and runs the correct minimize/restore code automatically. The previous UDF _Minimize and _Restore commands have been superceded by a single _EventMonitor function which runs in the script idle loop. This is a script-breaking change, but I hope that the additional functionality is worth the small effort it will take to alter your scripts. New UDFs and examples in the first post. M23
    1 point
  4. One thing that would greatly compact your code is to name your images the same as the value of $Mother0, so you could simply use : GUICtrlSetImage($Pic2, @ScriptDir & "\" & $Mother0 & ".jpg") And the same goes for $CPU1...
    1 point
  5. Try this: ;Coded by UEZ build 2021-05-14 beta #include <GDIPlus.au3> #include <WinAPIFiles.au3> Global $sImageFile = FileOpenDialog("Select an GDI+ supported image", "", "Images (*.jpg;*.bmp;*.png;*.gif;*.tif;*.tiff)") If @error Then Exit _GDIPlus_Startup() Global $hImage = _GDIPlus_ImageLoadFromFile($sImageFile) $sImageFile = StringMid($sImageFile, StringInStr($sImageFile, "\", 0, -1) + 1) $sImageFile = @ScriptDir & "\" & StringMid($sImageFile, 1, StringLen($sImageFile) - 4) & ".cur" _GDIPlus_CreateCursorFileFromImage($hImage, $sImageFile, 32, 32) If @error Then MsgBox($MB_ICONERROR, "Error", "Something went wrong!", 10) Else MsgBox($MB_ICONINFORMATION, "Information", "Cursor file has been created. Check out: " & $sImageFile, 10) EndIf _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_CreateCursorFileFromImage ; Version .......: v0.15 build 2021-05-14 beta ; Description ...: Converts a GDI+ support image to a windows cursor format and saves it to disk. ; Syntax ........: _GDIPlus_CreateCursorFileFromImage($hImage[, $sFilename = ""[, $iWidth = 32[, $iHeight = 32]]]) ; Parameters ....: $hImage - a handle value. ; $sFilename - [optional] a string value. Default is "". ; $iWidth - [optional] an integer value. Default is 32. ; $iHeight - [optional] an integer value. Default is 32. ; $iSpotX - [optional] an integer value. Default is 0. ; $iSpotY - [optional] an integer value. Default is 0. ; Return values .: True if file has been created ; Author ........: UEZ ; Modified ......: ; Remarks .......: If $sFilename is empty then the handle of the cursor will be returned instead. No animated cursor possible yet! ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_CreateCursorFileFromImage($hImage, $sFilename = "", $iWidth = 32, $iHeight = 32, $iSpotX = 0, $iSpotY = 0) If $hImage = 0 Then Return SetError(1, 0, 0) Local $aDim = _GDIPlus_ImageGetDimension($hImage) If @error Then Return SetError(2, 0, 0) ;create image with scaled size $iWidth = $iWidth > 255 ? 255 : $iWidth < 1 ? 1 : $iWidth $iHeight = $iHeight > 255 ? 255 : $iHeight < 1 ? 1 : $iHeight Local Const $hImage_scaled = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight, $GDIP_PXF32ARGB) Local Const $hCanvas = _GDIPlus_ImageGetGraphicsContext($hImage_scaled) _GDIPlus_GraphicsSetInterpolationMode($hCanvas, $GDIP_INTERPOLATIONMODE_HIGHQUALITYBICUBIC) _GDIPlus_GraphicsDrawImageRect($hCanvas, $hImage, 0, 0, $iWidth, $iHeight) Local Const $hIcon = _GDIPlus_HICONCreateFromBitmap($hImage_scaled) _GDIPlus_GraphicsDispose($hCanvas) _GDIPlus_ImageDispose($hImage_scaled) If $hIcon = 0 Then Return SetError(3, 0, 0) Local $iErr = 0 If $sFilename <> "" Then If _WinAPI_SaveHICONToFile($sFilename, $hIcon) = 0 Then $iErr += 1 _WinAPI_DestroyIcon($hIcon) If $iErr Then Return SetError(4, $iErr, 0) Else Local $aIcon = _WinAPI_GetIconInfo($hIcon) Local $hCursor = _WinAPI_CreateIconIndirect($aIcon[5], $aIcon[4], $iSpotX, $iSpotY, False) If $hCursor = 0 Then $iErr += 1 _WinAPI_DestroyIcon($hIcon) If $iErr Then Return SetError(5, $iErr, 0) Return $hCursor EndIf Local $tagCur = "align 1;word;word ImageType;word NumberOfImgs;", $tagImgHeader = "byte Width;byte Height;byte PaletteColors;byte;word Format1;word Format2;dword Size;dword OffsetImg;" Local $tHeader = DllStructCreate($tagCur & $tagImgHeader), $iSize = DllStructGetSize($tHeader) ;read the header to the struct Local $nBytes Local $hFile = _WinAPI_CreateFile($sFilename, 2, 2) _WinAPI_ReadFile($hFile, $tHeader, $iSize, $nBytes) _WinAPI_CloseHandle($hFile) If $nBytes <> $iSize Then Return SetError(6, 0, 0) ;generate the file $nBytes = 0 $tHeader.ImageType = 2 $tHeader.Format1 = $iSpotX $tHeader.Format2 = $iSpotY $hFile = _WinAPI_CreateFile($sFilename, 2, 4) _WinAPI_SetFilePointer($hFile, 0) _WinAPI_WriteFile($hFile, $tHeader, $iSize, $nBytes) _WinAPI_CloseHandle($hFile) If $nBytes <> $iSize Then Return SetError(7, 0, 0) Return 1 EndFunc ;==>_GDIPlus_CreateCursorFileFromImage Almost, you must change 1 entry within the header of the cursor struct to become a cursor file.
    1 point
  6. Func _ChangeDestopWallpaper($bmp, $style = 0) ;=============================================================================== ; ; Function Name: _ChangeDesktopWallPaper ; Description: Update WallPaper Settings ;Usage: _ChangeDesktopWallPaper(@WindowsDir & '\' & 'zapotec.bmp',1) ; Parameter(s): $bmp - Full Path to BitMap File (*.bmp) ; [$style] - 0 = Centered, 1 = Tiled, 2 = Stretched ; Requirement(s): None. ; Return Value(s): On Success - Returns 0 ; On Failure - -1 ; Author(s): FlyingBoz ;Thanks: Larry - DllCall Example - Tested and Working under XPHome and W2K Pro ; Excalibur - Reawakening my interest in Getting This done. ; ;=============================================================================== If Not FileExists($bmp) Then Return -1 ;The $SPI* values could be defined elsewhere via #include - if you conflict, ; remove these, or add if Not IsDeclared "SPI_SETDESKWALLPAPER" Logic Local $SPI_SETDESKWALLPAPER = 20 Local $SPIF_UPDATEINIFILE = 1 Local $SPIF_SENDCHANGE = 2 Local $REG_DESKTOP= "HKEY_CURRENT_USER\Control Panel\Desktop" if $style = 1 then RegWrite($REG_DESKTOP, "TileWallPaper", "REG_SZ", 1) RegWrite($REG_DESKTOP, "WallpaperStyle", "REG_SZ", 0) Else RegWrite($REG_DESKTOP, "TileWallPaper", "REG_SZ", 0) RegWrite($REG_DESKTOP, "WallpaperStyle", "REG_SZ", $style) EndIf DllCall("user32.dll", "int", "SystemParametersInfo", _ "int", $SPI_SETDESKWALLPAPER, _ "int", 0, _ "str", $bmp, _ "int", BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDCHANGE)) Return 0 EndFunc ;==>_ChangeDestopWallpaper
    1 point
×
×
  • Create New...