Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/06/2020 in all areas

  1. #include <MsgBoxConstants.au3> #include <APILocaleConstants.au3> #include <WinAPILocale.au3> $iID = _WinAPI_GetSystemDefaultUILanguage() MsgBox($MB_SYSTEMMODAL, "", "The language of the OS is: " & _WinAPI_GetLocaleInfo($iID, $LOCALE_SLANGUAGE) & " (" & LCIDToLocaleName($iID) & ")") $iID = _WinAPI_GetSystemDefaultLCID() MsgBox($MB_SYSTEMMODAL, "", "The user language of the OS is: " & _WinAPI_GetLocaleInfo($iID, $LOCALE_SLANGUAGE) & " (" & LCIDToLocaleName($iID) & ")") Func LCIDToLocaleName($iLCID) Local $aRet = DllCall("kernel32.dll", "int", "LCIDToLocaleName", "int", $iLCID, "wstr", "", "int", 85, "dword", 0) Return $aRet[2] EndFunc ;==>LCIDToLocaleName
    2 points
  2. Au3toCmd --- Avoid false virus positives Since many virus scanners sometimes prevent a "compiled autoit EXE" from being executed as "false positive", the "*.A3X" format is a suitable format to avoid this problem. See here for more information. In order to simplify this procedure, I wrote the Au3toCmd script. Here a *.Cmd file is generated from a *.Au3 file. The necessary files Autoit3.exe and *.A3x are added to the "*.Cmd" file as "alternate data streams" "Base64" encoded data. Now the Autoit Script can be called by clicking on the cmd file and the anti-virus scanners do not recognize the "false positive". If the short-term flashing of the CMD window bothers you, you can click the desktop shutcut that runs in a minimized window. Unfortunately, because the "alternate data streams", this CMD file cannot be distributed via FTP or email. Only a USB sti ck or removable disk formatted with NTFS can be used. As the new version now uses Base64 data instead of ADS, this statement is out of date. For reasons of compatibility, the old version was sunk into the spoiler here. The script can be called with a file name of an AU3 script as a parameter. If no name is entered, a query is made. For more information, see the header of the script. Suggestions, improvements and bug reports are welcome. Here the versions using base64 data Version: 2022.05.12 (Support blanks in pathnames) Version: 2022.06.23 (Support release candidates. Changed @CrLf to @Lf. Annual cleaning. Optimized #AutoIt3Wrapper handling) Version: 2022.07.22 (Support scripts with the same name but different content in different directories) Version: 2022.07.27 (Support blanks in usernames) Au3toCmd.au3 Version: 2022.09.01 (Optimized annual cleaning) Au3toCmd.au3
    1 point
  3. _Vlad, Glad I could help. M23
    1 point
  4. I'm back, thank you all for the answers! The script I wrote it turns out to be complex and hard to understand as I didn't knew about some functions posted above. In the end, it seems that @Melba23 already have a script for that, better than the one that I was currently working at. Until I will be capable to post something ingenious I still have to study further :)) Thanks one more time everyone!
    1 point
  5. The UDF function does not modify what gets created by Outlook. So yes, this seems to be intended. If you need a signature you could either add the signature to the template or manually add the signature to the mail or wait until I have created a function to manually add a signature
    1 point
  6. _Vlad, You might find my Date_Time_Convert UDF (the link is in my sig) useful as it allows you to convert from and to any format you wish. M23
    1 point
  7. Please make any posts related to this UDF (issues, comments, concerns, kudos, feature requests, etc.) in the UDF's forum topic that is referenced above.
    1 point
  8. #include <APILocaleConstants.au3> #include <WinAPILocale.au3> Local $iID = _WinAPI_GetUserDefaultLCID() ConsoleWrite('Language => ' & _WinAPI_GetLocaleInfo($iID, $LOCALE_SLANGUAGE) & @CRLF) ConsoleWrite('Date format => ' & _WinAPI_GetLocaleInfo($iID, $LOCALE_SSHORTDATE) & @CRLF) ConsoleWrite('Time format => ' & _WinAPI_GetLocaleInfo($iID, $LOCALE_STIMEFORMAT) & @CRLF) ConsoleWrite('Currency name => ' & _WinAPI_GetLocaleInfo($iID, $LOCALE_SNATIVECURRNAME) & @CRLF) ConsoleWrite('Monetary symbol => ' & _WinAPI_GetLocaleInfo($iID, $LOCALE_SCURRENCY) & @CRLF) Post that information so that we can have a clue. Or maybe with the above it solved your need. And if it did, post the solution.
    1 point
  9. #include <Date.au3> $start = @MDAY & "." & @MON & "." & @YEAR $end = "31.10.2020" MsgBox ( 64,"",_calc_month(1,$start,$end) & " Days" & @CRLF & _calc_month(2,$start,$end) & " Months" & @CRLF & _calc_month(3,$start,$end) & " Years") Func _calc_month($return_mode = "1",$Startdate = "01.01.2000", $Enddate = "29.02.2000") $Startdatecache = GUICtrlRead($Startdate) If $Startdatecache = 0 Then Else $Startdate = $Startdatecache EndIf $Enddatecache = GUICtrlRead($Enddate) If $Enddatecache = 0 Then Else $Enddate = $Enddatecache EndIf Local $Days = StringTrimRight($Startdate, 8) Local $Month = StringTrimRight($Startdate, 5) $Month = StringTrimLeft($Month, 3) Local $year = StringTrimLeft($Startdate, 6) Local $Days2 = StringTrimRight($Enddate, 8) Local $Month2 = StringTrimRight($Enddate, 5) $Month2 = StringTrimLeft($Month2, 3) Local $year2 = StringTrimLeft($Enddate, 6) $DateCalc = _DateDiff('d', $year & "/" & $Month & "/" & $Days, $year2 & "/" & $Month2 & "/" & $Days2) Switch $return_mode Case 1 $DIFF = $DateCalc Case 2 $DIFF = Round($DateCalc / (365 / 12), 1) Case 3 $DIFF = Round ( $DateCalc / 365,3 ) EndSwitch Return $DIFF EndFunc ;==>_calc_month i wrote this a long time ago because i had problems with that formats too. all i wanted was to input a normal date format and a normal end format Actually the pc date is the current day date in scripts hope that helps didn't change that but maybe you ll do. i just started to code at this time where it was written. today i should rewrite it but i didn't need this again. better would be a Stringregexp() there i would say also you can work without the Switch and Round.. if you just adjust the _datediff('d') with other types just look into the helpfile of it greetings
    1 point
  10. In the previous pattern the pipes are mentioned because they were included by _ArrayToString in a txt file there are newlines . So in Notepad++ do that : - first "Edit > line operations > sort descending" (important, the regex won't work if the lines are unsorted) - then use this pattern (\w+)\R(?:\1\R*)+ and "replace all" But of course SD is a much more handy way
    1 point
  11. So I think @Jon have to contact his old friends from Microsoft as he works for a long time ago with them.
    1 point
  12. no problem I had the stealing problem,too. this is when the variable called in Winmove is 0 because it will move the current window then. could be the problem for other stealings, too. so you need another if statement before. Good luck for your script and maybe see ya tomorrow if necessary
    1 point
  13. 1803 it works fine. 1809 has those problems. Fresh installed both.
    1 point
  14. I guess you mean _DateDiff() instead. This function doesn't use what you call a "custom format". It processes the only computational format for string datetime (ISO). Convert the date strings to the ISO format and _DateDiff() will work for you. ; _DateDiff() works with yyyy/mm/dd as well as with yyyy-mm-dd dates ConsoleWrite(_DateDiff("D", "2020-03-26", _NowCalcDate()) & @LF)
    1 point
  15. I hate this Microsoft numbering scheme 🤬
    1 point
  16. That is a great finding, hope it will help to solve the issue. Thanks a lot. I don,t think it is necessary to find WHEN exactly it has started. Now the problem is to find out WHY ?
    1 point
  17. It is kind of odd that everyone sees the problem except you @argumentum. You must have unique setup. It would be great if you could change your setup to get the same result of us, and pinpoint the setup solution that makes you invincible...
    1 point
  18. #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <windowsConstants.au3> #include <array.au3> Global $b = 1 Dim $GUIPUTTY[$b] Dim $InsertFile[$b] Dim $PuTTY[$b] Global $g_hGUI2 = 9999, $g_idButton3 ; Predeclare the variables with dummy values to prevent firing the Case statements, only for GUI this time gui1() Func gui1() Local $hGUI1 = GUICreate("Gui 1", 200, 200, 100, 100) Local $idButton1 = GUICtrlCreateButton("Msgbox 1", 10, 10, 80, 30) Local $idButton2 = GUICtrlCreateButton("Show Gui 2", 10, 60, 80, 30) GUISetState() Local $aMsg While 1 $ubnd = UBound($GUIPUTTY) - 1 ;~ MsgBox ( 64,"",$ubnd ) $aMsg = GUIGetMsg(1) ; Use advanced parameter to get array Switch $aMsg[1] ; check which GUI sent the message Case $hGUI1 Switch $aMsg[0] ; Now check for the messages for $hGUI1 Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we exit <<<<<<<<<<<<<<< ExitLoop Case $idButton1 ;~ MsgBox($MB_OK, "MsgBox 1", "Test from Gui 1") _GUIPUTTY() Case $idButton2 GUICtrlSetState($idButton2, $GUI_DISABLE) gui2() EndSwitch Case $g_hGUI2 Switch $aMsg[0] ; Now check for the messages for $g_hGUI2 Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we just delete the GUI <<<<<<<<<<<<<<< GUIDelete($g_hGUI2) GUICtrlSetState($idButton2, $GUI_ENABLE) Case $g_idButton3 MsgBox($MB_OK, "MsgBox", "Test from Gui 2") EndSwitch EndSwitch For $i = 0 To $ubnd Switch $aMsg[1] Case $GUIPUTTY[$i] Switch $aMsg[0] Case $GUI_EVENT_PRIMARYDOWN MsgBox(64, "Putty Instance Handle", $aMsg[1]) Case $GUI_EVENT_DROPPED MsgBox(64, "", @GUI_DragFile) EndSwitch EndSwitch Next WEnd EndFunc ;==>gui1 Func gui2() $g_hGUI2 = GUICreate("Gui 2", 200, 200, 350, 350) Local $g_idButton3 = GUICtrlCreateButton("MsgBox 2", 10, 10, 80, 30) GUISetState() EndFunc ;==>gui2 Func _GUIPUTTY() $b += 1 ReDim $InsertFile[$b] ReDim $PuTTY[$b] ReDim $GUIPUTTY[$b] Local $aPutty = WinList("[CLASS:PuTTY]") If $aPutty[0][0] > 0 Then If $aPutty[0][0] > $b - 1 Then For $i = 1 To $b - 1 $PuTTY[$i] = $aPutty[$i][1] Next Else For $i = 1 To $aPutty[0][0] $PuTTY[$i] = $aPutty[$i][1] Next EndIf WinMove($PuTTY[$b - 1], "", 1 + ($b - 2) * 700, 1, 675, 408) $GUIPUTTY[$b - 2] = GUICreate("Connect Helper Session", 200, 430, Default, Default, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_ACCEPTFILES), $PuTTY[$b - 1]) ;~ _ChangeWindowMessageFilterEx($GUIPUTTY[$b], 0x233, 1) ; $WM_DROPFILES ;~ _ChangeWindowMessageFilterEx($GUIPUTTY[$b], $WM_COPYDATA, 1) ; redundant? ;~ _ChangeWindowMessageFilterEx($GUIPUTTY[$b], 0x0049, 1) ; $WM_COPYGLOBALDATA $InsertFile[$b - 2] = GUICtrlCreateLabel("", 60, 310, 100, 100, -1, $WS_EX_STATICEDGE) GUICtrlSetState($InsertFile, $GUI_DROPACCEPTED) GUICtrlSetTip($InsertFile, "Arraste arquivos aqui para enviar!" & @CRLF & @CRLF & "Clique direito para menu!") GUICtrlSetBkColor($InsertFile, 0xFFFFFF) GUISetState() WinSetTrans($GUIPUTTY[$b - 2], "", 40) ;~ GUISetControlsVisible($GUIPUTTY[$b-2]) WinMove($GUIPUTTY[$b - 2], "", 238 + ($b - 2) * 700, 1, 200, 430) EndIf EndFunc ;==>_GUIPUTTY Get started... Couldn't test the drag & drop because i was to lazy to insert the func x) Tested with 3 instances of PuTTy but like this you can use how much you want you just have to adjust the winmove then EDIT: The sad story on it is the For Next loop inside the GUI loop there is a way to get it with Case $GUIPUtty[0] To $GUIPUTTY[Ubound($GUIPUTTY)-1] but it didn't work for me for any reason btw so much time actually because corona and yes my scripts all time are bigger and complicated as thought before ... im on a huge project but i can't script on it for long time because my head burns after few hours and there is still so much to do on it i'm working slowly since 3 month on it. I always say it to myself: i learn so much from it and that's just a thing to make it worth even the script is worth on what it does later
    1 point
  19. hey again #include <Array.au3> Local $aarray = WinList ( "[CLASS:PuTTY]","" ) _ArrayDisplay ( $aarray ) you can use this to difference between the handles of putty i guess you didn't have declared the $GUIPutty on top as global if you didn't change it already, but if you declare it with a constant the error will appear again after (x declared instances) so you could use Dim Redim
    1 point
  20. For the fun only #include <Array.au3> ;Global $aArray[10] = ["a","a","b","c","c","d","e","c","e"] Global $aArray[7] = ['script', 'autoit', 'autoit', 'script', 'script', 'forum', 'autoit'] _ArraySort($aArray) $r = StringReplace(StringRegExpReplace(_ArrayToString($aArray), '^\||(\w+)\|(?:\1\|*)+', ""), "|", @crlf) msgbox(0,"", $r)
    1 point
  21. @seadoggie01 The bug should be fixed with version 1.5.0.0 of the UDF
    1 point
  22. Thanks for that solution! For anyone following this, I optimized it for multiple inputs by creating handles when the inputs were created: Global $hEdit1 = GUICtrlGetHandle($edit1) Global $hEdit2 = GUICtrlGetHandle($edit2) ; create handles for every input Global $hEdit3 = GUICtrlGetHandle($edit3) I then turned the processing around in the associated function to be more efficient: Func _WindowProc($hWnd, $Msg, $wParam, $lParam) Switch $Msg Case $WM_LBUTTONDBLCLK Switch $hWnd Case $hEdit1 $DoubleClick = $Edit1 Return 0 Case $hEdit2 $DoubleClick = $Edit2 Return 0 : : The function returns the control ID that was double-clicked and everything works as I need. I appreciate the help!
    1 point
×
×
  • Create New...