Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/11/2025 in all areas

  1. #include <WinHttp.au3> ; https://github.com/dragana-r/autoit-winhttp/tree/master ConsoleWrite("- ExpiryTime: " & _WinHttp_SSL_ExpiryTime("www.google.com") & @CRLF) Func _WinHttp_SSL_ExpiryTime($sSite, $iPort = 443, $sTimeType = "ExpiryTime") Local Const $tagINTERNET_CERTIFICATE_INFO = "dword ExpiryTime[2]; dword StartTime[2]; ptr SubjectInfo;" & _ "ptr IssuerInfo; ptr ProtocolName; ptr SignatureAlgName; ptr EncryptionAlgName; dword KeySize" Local $tINTERNET_CERTIFICATE_INFO, $hOpen = _WinHttpOpen() _WinHttpSetOption($hOpen, $WINHTTP_OPTION_SECURITY_FLAGS, 0x00003300) ; $SECURITY_FLAG_IGNORE_ALL Local $hConnect = _WinHttpConnect($hOpen, $sSite, $iPort) Local $hRequest = _WinHttpSimpleSendSSLRequest($hConnect, "GET", "/") Local $tBufferLength = DllStructCreate("dword") DllStructSetData($tBufferLength, 1, 2048) Local $sReturn, $tBuffer = DllStructCreate("byte[2048]") Local $iError, $aResult = DllCall($hWINHTTPDLL__WINHTTP, "bool", "WinHttpQueryOption", _ "handle", $hRequest, "dword", $WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT, _ "struct*", DllStructGetPtr($tBuffer), "dword*", DllStructGetPtr($tBufferLength)) $iError = @error If Not $iError And $aResult[0] Then $tINTERNET_CERTIFICATE_INFO = DllStructCreate($tagINTERNET_CERTIFICATE_INFO, DllStructGetPtr($tBuffer)) $sReturn = __WinHttp_INTERNET_CERTIFICATE_INFO_Time($tINTERNET_CERTIFICATE_INFO, $sTimeType) ; these are "ExpiryTime" and "StartTime" Else $iError = 99 $sReturn = "error" EndIf $tBufferLength = 0 $tBuffer = 0 $tINTERNET_CERTIFICATE_INFO = 0 _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) Return SetError($iError, 0, $sReturn) EndFunc ;==>_WinHttp_SSL_ExpiryTime Func __WinHttp_INTERNET_CERTIFICATE_INFO_Time($tStruct, $sTimeType = "ExpiryTime") Local $tSystTime = DllStructCreate("struct;word Year;word Month;word Dow;word Day;word Hour;word Minute;word Second;word MSeconds;endstruct") DllCall("kernel32.dll", "bool", "FileTimeToSystemTime", "struct*", DllStructGetPtr($tStruct, $sTimeType), "struct*", $tSystTime) Return StringFormat("%04d/%02d/%02d %02d:%02d:%02d", $tSystTime.Year, $tSystTime.Month, $tSystTime.Day, $tSystTime.Hour, $tSystTime.Minute, $tSystTime.Second) EndFunc ;==>__WinHttp_INTERNET_CERTIFICATE_INFO_Time Had to scrape the site to get this. Shared here so you don't have to go trough the same trouble. This function gets the date a SSL certificate expires on a web site. Edit: Added to "ExpiryTime" the possibility of getting "StartTime". Was already there, might as well give the opportunity to get that too. ..and this one has the rest of the info I could get. If anyone can get ProtocolName, SignatureAlgName and EncryptionAlgName, post it. TIA
    2 points
  2. I agree 100%. The deeper I get into it, I realize how messy theming in Windows can get. Those are nice themes. Personally, specifically for dark mode only, I use Rectify11 theme for Windows. Rectify11 actually fixes the problem with the ListView checkboxes. However, for the apps that I make, I end up having to target default Aero theme (dark and light) because that is what the majority of users would be using. I had never thought about that but I think you are right. You built upon @NoNameCode's UDF and made it significantly better and it helped me tremendously. So if I make some noteworthy changes, you are right, I probably should post it as well here and note that it was based on yours. For example, you had added the GuiDarkModeApply function at the bottom of the script which helped me get started when I didn't understand it at first. Eventually, I added onto that bottom part and added a GuiLightModeApply as well: #Region Enable GUI LIGHTMODE Func GuiLightmodeApply($hGUI) $bEnableDarkTheme = False _GUISetDarkTheme($hGUI, $bEnableDarkTheme) _GUICtrlAllSetDarkTheme($hGUI, $bEnableDarkTheme) ConsoleWrite(@CRLF & '+ _GUICtrlAllSetDarkTheme: ' & @error & ',' & @extended & @CRLF) EndFunc #EndRegion Enable GUI LIGHTMODE This way when the app first starts, it determines whether or not the system is using dark mode and will call either GuiDarkModeApply () or GuiLightModeApply (). The Light Mode that @NoNameCode built into this DarkMode UDF is actually very nice. It's much better than the default AutoIt light mode. Especially when working with ListViews because it formats it beautifully and easily. Thank you for your time and for your response. I appreciate it. I still have some more changes to make with the UDF and likely clean up some of my changes before I can post it. But I will definitely look into that as soon as I am done with messing around with it. Cheers!
    1 point
  3. Define an array that will hold all file names (before the GUI loop) : Global $aList[0] Replace the function with this : Func _AddSelectFolder($_sFolderPath) Local $aFolderList = _FileListToArrayRec($_sFolderPath, "*.exe", $FLTAR_FILES, $FLTAR_RECUR) If @error Then Return For $i = 1 To $aFolderList[0] $aFolderList[$i] = StringRegExpReplace($aFolderList[$i], "^.*\\", "") Next _ArrayConcatenate($aList, $aFolderList, 1) $aList = _ArrayUnique($aList, Default, Default, Default, $ARRAYUNIQUE_NOCOUNT) _ArraySort($aList) _GUICtrlListView_DeleteAllItems($hListView) For $i = 0 To UBound($aList) - 1 GUICtrlCreateListViewItem(String($i + 1) & "|" & $aList[$i], $hListView) Next EndFunc ;==>_AddSelectFolder
    1 point
  4. Understand, hence my question for a more complete script so we can assist.
    1 point
  5. Is there a way to do this? if not please recommend other editor for autoit that can do that thanks
    1 point
  6. Using clipboard (the smart/safe way ): _ControlSendEx("Title", "", "Edit1", "New Data") Func _ControlSendEx($hWnd, $sText, $iCtrlID, $sString) ControlFocus($hWnd, $sText, $iCtrlID) Local $sOldClip = ClipGet() ClipPut($sString) Send("+{Insert}") ClipPut($sOldClip) EndFunc Or you can use ControlSetText(), or if you need to append the text, then use ControlCommand() with EditPaste: ControlCommand("Title", "", "Edit1", "EditPaste", "New Data")
    1 point
×
×
  • Create New...