Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/19/2020 in all areas

  1. TheXman

    StringRight Problem

    $getYear = StringRight($arr[$1], 4) Shouldn't this be: $getYear = StringRight($arr[$i], 4)
    1 point
  2. still not that combfortable to zoom and keep replying, but i will did that anyway while I could be misunderstood
    1 point
  3. This works for me although it is not a failsafe approach. #include <Constants.au3> Local $filePath = @DesktopDir &'\_wrong.lnk' Local $fileHandle = FileOpen($filePath, $FO_ANSI) If Not @error Then Local $contents = StringRegExpReplace(FileRead($fileHandle), "\x00", "") Local $matches = StringRegExp($contents, "https?[\w:/.]*", $STR_REGEXPARRAYMATCH) msgbox($MB_SYSTEMMODAL, "", $matches[0]) FileClose($fileHandle) Else ConsoleWrite('Could not open file "' & $filePath & '".') Exit 1 EndIf
    1 point
  4. Nine

    get shortcut lnk details

    Try this : Local $hFileOpen = FileOpen($sFilePath & '_wrong.lnk', $FO_BINARY) If $hFileOpen Then Local $sFileRead = FileRead($hFileOpen) FileClose($hFileOpen) MsgBox ($MB_SYSTEMMODAL,"",BinaryToString(BinaryMid($sFileRead,107,80),2)) For $i = 1 to BinaryLen ($sFileRead) ConsoleWrite ($i & " = " & BinaryMid($sFileRead,$i,1) & @CRLF) Next EndIf
    1 point
  5. @Jahar, Please be patient and stop begging for an answer from specific people as that is quite impolite. Jos
    1 point
  6. Danp2

    get shortcut lnk details

    Have you tried supplying the optional count parameter?
    1 point
  7. Melba23

    Autosize label ?

    AlienStar, This is how you can get the maximum font size to fit in a label: #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <FontConstants.au3> #include "StringSize.au3" #include <Array.au3> $hGUI = GUICreate("Example", 1072, 330) $cLabel = GUICtrlCreateLabel("", 15, 15, 1072 - 30, 330 - 30, $SS_CENTER + $SS_SUNKEN) GUICtrlSetBkColor($cLabel, 0xC4C4C4) GUISetState(@SW_SHOW, $hGUI) ; Create the text to size $sText = "A. Font Size = " $iFontSize = "100" ; Pass all the data to the function which will find the max size to fit in the label $iFontSize = _FindMaxSize($sText & $iFontSize, 1072 - 30, 330 - 30, $FW_BOLD, $GUI_FONTNORMAL, "Arial") ; Put the text into the label and set the font size GUICtrlSetData($cLabel, $sText & $iFontSize) GUICtrlSetFont($cLabel, $iFontSize, $FW_BOLD, $GUI_FONTNORMAL, "Arial") Sleep(1000) $sText = "Text fit the lable size. Font Size = " $iFontSize = "100" $iFontSize = _FindMaxSize($sText & $iFontSize, 1072 - 30, 330 - 30, $FW_BOLD, $GUI_FONTNORMAL, "Arial") GUICtrlSetData($cLabel, $sText & $iFontSize) GUICtrlSetFont($cLabel, $iFontSize, $FW_BOLD, $GUI_FONTNORMAL, "Arial") Sleep(1000) $sText = "Text2 fit the lable size, Text here is longer.... Font Size =" $iFontSize = "100" $iFontSize = _FindMaxSize($sText & $iFontSize, 1072 - 30, 330 - 30, $FW_BOLD, $GUI_FONTNORMAL, "Arial") GUICtrlSetData($cLabel, $sText & $iFontSize) GUICtrlSetFont($cLabel, $iFontSize, $FW_BOLD, $GUI_FONTNORMAL, "Arial") Sleep(1000) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func _FindMaxSize($sTxt, $iWidth, $iHeight, $iWeight, $iAttribute, $sFontName) ; Set an initial font size $iFontSize = 120 While 1 ; Size the label needed to fit the string into a label of the correct width $aRet = _StringSize($sTxt, $iFontSize, $iWeight, $iAttribute, $sFontName, $iWidth) ; Now check if the height will fit If $aRet[3] < $iHeight Then ; If it does return the font size ExitLoop Else ; If not then reduce the font size and try again $iFontSize -= 1 EndIf WEnd Return $iFontSize EndFunc Please ask if you have any questions. M23
    1 point
  8. mLipok

    get shortcut lnk details

    It was not elegant, to say the least
    1 point
  9. @Danyfirex has identified that the issue originates in the BinaryCall UDF, which gets called by the JSON UDF. It registers an OnAutoITExitRegister function, that is freeing resources before the main OnAutoITExitRegister function gets executed. @TheXman Your example works because it registers the BinaryCall exit routine before the main OnAutoITExitRegister routine is registered, so exit events now occur in the desired order. You can also accomplish this by adding the following before calling OnAutoITExitRegister Json_Decode("") Will release an update to the UDF once we come up with a more permanent fix.
    1 point
  10. Ca you try this one ? $_lv_sRslt = StringRegExpReplace($_lv_sData, "(?m)^(?:.+:=[^;]+\K\/\/\V+|[^:]+\K\/\/\V+)", "")
    1 point
  11. HackerZer0

    Disable ctrl+alt+del

    yes you can disable Ctrl+Alt+Del, just edit winlogon, using reshacker, or some other 32bit win app editor... but thats not wut this forum is about so, here's my version, for easier script use... HotKeySet("{F9}", "End") While 1 Sleep(1) If ProcessExists("Taskmgr.exe") Then ProcessClose("Taskmgr.exe") EndIf Wend Func End() Exit EndFunc
    1 point
  12. @JLogan3o13 Could you please help me.
    0 points
  13. @Dan_555 So, could you please guide me how to correct that issue?
    0 points
×
×
  • Create New...