This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Public Sub QuickSortNaturalNum(strArray() As String, intBottom As Integer, intTop As Integer) | |
| Dim strPivot As String, strTemp As String | |
| Dim intBottomTemp As Integer, intTopTemp As Integer | |
| intBottomTemp = intBottom | |
| intTopTemp = intTop | |
| strPivot = strArray((intBottom + intTop) \ 2) | |
| Do While (intBottomTemp <= intTopTemp) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ' https://stackoverflow.com/a/152333 | |
| ' Example: QuickSort arr, LBound(arr), UBound(arr) | |
| Private Sub QuickSort(ByRef Field() As String, ByVal LB As Long, ByVal UB As Long) | |
| Dim P1 As Long, P2 As Long, Ref As String, TEMP As String | |
| P1 = LB | |
| P2 = UB | |
| Ref = Field((P1 + P2) / 2) | |
| Do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function Sort(strOrArray) | |
| Static doc | |
| Dim s$ | |
| If Not IsObject(doc) Then | |
| Set doc = CreateObject("htmlfile") | |
| doc.parentWindow.eval "function sort(s){ return s.split(',').sort() }" | |
| End If |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SetScreenReaderActiveStatus(isActive) | |
| { | |
| SPI_SETSCREENREADER := 0x0047 | |
| SPIF_SENDCHANGE := 0x0002 | |
| return DllCall( "SystemParametersInfo" | |
| , "uint", SPI_SETSCREENREADER | |
| , "uint", !!isActive | |
| , "ptr", 0 | |
| , "uint", SPIF_SENDCHANGE ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $xl = [Runtime.Interopservices.Marshal]::GetActiveObject('Excel.Application') | |
| $rng = $xl.Range("a1") | |
| $lastRowNumber = $rng.End(($xlDown = -4121)).Row | |
| $rngEntireColumn = $rng.Resize($lastRowNumber) | |
| $newData = $rngEntireColumn.value2 -replace '.{15}\B', "`$0`n" -split "`n" | |
| $safeArr = New-Object 'object[,]' $newData.Count, 1 | |
| $i = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $test = [Runtime.Interopservices.Marshal]::GetActiveObject('ahk.active_com.test') | |
| $test.hello() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Add-Type -TypeDefinition @' | |
| using System; | |
| using System.Runtime; | |
| using System.Runtime.InteropServices; | |
| public static class Marshal | |
| { | |
| internal const String OLEAUT32 = "oleaut32.dll"; | |
| public static Object GetActiveObject(Guid clsid) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MsgBox, % CmdRet("cmd /c code --list-extensions") | |
| CmdRet(sCmd, callBackFuncObj := "", encoding := "CP0") | |
| { | |
| static HANDLE_FLAG_INHERIT := 0x00000001, flags := HANDLE_FLAG_INHERIT | |
| , STARTF_USESTDHANDLES := 0x100, CREATE_NO_WINDOW := 0x08000000 | |
| DllCall("CreatePipe", "PtrP", hPipeRead, "PtrP", hPipeWrite, "Ptr", 0, "UInt", 0) | |
| DllCall("SetHandleInformation", "Ptr", hPipeWrite, "UInt", flags, "UInt", HANDLE_FLAG_INHERIT) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| url:= "https://cdn.ostrovok.ru/t/1024x768/second/fd/8b/fd8b26115b8cf4510b8bf02fe85084eecbbd32a8.jpeg" | |
| localFilePath:= "TestWhr.jpg" | |
| ;=================================================================================== | |
| FileDelete % localFilePath | |
| DownLoader := ComObjCreate("WMPlayer.OCX.7") | |
| DownLoader.url := url, moreDataAvailable:= 1 | |
| Whr := ComObjCreate("WinHttp.WinHttpRequest.5.1") | |
| Events := new IWinHttpRequestEvents(Whr, Func("ReceiveData").Bind(localFilePath, Stop := [false])) | |
| Whr.Open("GET", url, true) |
NewerOlder