Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/28/2015 in all areas

  1. This function is based on _WinAPI_UniqueHardwareID() in WinAPIDiag.au3. The flags which can be used in this function are exactly the same flags as in _WinAPI_UniqueHardwareID(). Any problems please post below. Thanks. Function: ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GetHardwareID ; Description ...: Generates a unique hardware identifier (ID) for the local computer. ; Syntax ........: _GetHardwareID([$iFlags = Default]) ; Parameters ....: $iFlags - [optional] The flags that specifies what information would be used to generate ID. ; This parameter can be one or more of the following values. ; ; $UHID_MB (0) ; Uses information about your motherboard. This flag is used by default regardless of whether specified or not. ; ; $UHID_BIOS (1) ; Uses information about the BIOS. ; ; $UHID_CPU (2) ; Uses information about the processor(s). ; ; $UHID_HDD (4) ; Uses information about the installed hard drives. Any change in the configuration disks will change ID ; returned by this function. Taken into account only non-removable disks. ; ; $UHID_All (7) ; The sum of all the previous flags. Default is $UHID_MB (0). ; ; $bIs64Bit - [optional] Search the 64-bit section of the registry. Default is dependant on AutoIt bit version. ; Note: 64-bit can't be searched when running the 32-bit version of AutoIt. ; Return values..: Success - The string representation of the ID. @extended returns the value that contains a combination of flags ; specified in the $iFlags parameter. If flag is set, appropriate information is received successfully, ; otherwise fails. The function checks only flags that were specified in the $iFlags parameter. ; Failure - Null and sets @error to non-zero. ; Author.........: guinness with the idea by Yashied (_WinAPI_UniqueHardwareID() - WinAPIDiag.au3) ; Modified ......: Additional suggestions by SmOke_N. ; Remarks .......: The constants above can be found in APIDiagConstant.au3. It also requires StringConstants.au3 and Crypt.au3 to be included. ; Example........: Yes ; =============================================================================================================================== Func _GetHardwareID($iFlags = Default, $bIs64Bit = Default) Local $sBit = @AutoItX64 ? '64' : '' If IsBool($bIs64Bit) Then ; Use 64-bit if $bIs64Bit is true and AutoIt is a 64-bit process; otherwise 32-bit $sBit = $bIs64Bit And @AutoItX64 ? '64' : '' EndIf If $iFlags == Default Then $iFlags = $UHID_MB EndIf Local $aSystem = ['Identifier', 'VideoBiosDate', 'VideoBiosVersion'], _ $iResult = 0, _ $sHKLM = 'HKEY_LOCAL_MACHINE' & $sBit, $sOutput = '', $sText = '' For $i = 0 To UBound($aSystem) - 1 $sOutput &= RegRead($sHKLM & '\HARDWARE\DESCRIPTION\System\', $aSystem[$i]) Next $sOutput &= @CPUArch $sOutput = StringStripWS($sOutput, $STR_STRIPALL) If BitAND($iFlags, $UHID_BIOS) Then Local $aBIOS = ['BaseBoardManufacturer', 'BaseBoardProduct', 'BaseBoardVersion', 'BIOSVendor', 'BIOSReleaseDate'] $sText = '' For $i = 0 To UBound($aBIOS) - 1 $sText &= RegRead($sHKLM & '\HARDWARE\DESCRIPTION\System\BIOS\', $aBIOS[$i]) Next $sText = StringStripWS($sText, $STR_STRIPALL) If $sText Then $iResult += $UHID_BIOS $sOutput &= $sText EndIf EndIf If BitAND($iFlags, $UHID_CPU) Then Local $aProcessor = ['ProcessorNameString', '~MHz', 'Identifier', 'VendorIdentifier'] $sText = '' For $i = 0 To UBound($aProcessor) - 1 $sText &= RegRead($sHKLM & '\HARDWARE\DESCRIPTION\System\CentralProcessor\0\', $aProcessor[$i]) Next For $i = 0 To UBound($aProcessor) - 1 $sText &= RegRead($sHKLM & '\HARDWARE\DESCRIPTION\System\CentralProcessor\1\', $aProcessor[$i]) Next $sText = StringStripWS($sText, $STR_STRIPALL) If $sText Then $iResult += $UHID_CPU $sOutput &= $sText EndIf EndIf If BitAND($iFlags, $UHID_HDD) Then Local $aDrives = DriveGetDrive('FIXED') $sText = '' For $i = 1 To UBound($aDrives) - 1 $sText &= DriveGetSerial($aDrives[$i]) Next $sText = StringStripWS($sText, $STR_STRIPALL) If $sText Then $iResult += $UHID_HDD $sOutput &= $sText EndIf EndIf Local $sHash = StringTrimLeft(_Crypt_HashData($sOutput, $CALG_MD5), StringLen('0x')) If Not $sHash Then Return SetError(1, 0, Null) EndIf Return SetExtended($iResult, StringRegExpReplace($sHash, '([[:xdigit:]]{8})([[:xdigit:]]{4})([[:xdigit:]]{4})([[:xdigit:]]{4})([[:xdigit:]]{12})', '{\1-\2-\3-\4-\5}')) EndFunc ;==>_GetHardwareID Example use of Function: #include <APIDiagConstants.au3> #include <Crypt.au3> #include <StringConstants.au3> Local $sUniqueID = _GetHardwareID($UHID_All) ConsoleWrite('UniqueID: ' & $sUniqueID & @CRLF & _ 'Flags used: ' & @extended & @CRLF)
    1 point
  2. In your documentation // Close input file     fclose( pFileIn );     // Close output file     fclose( pFileOut );     // Write the VBR Tag     beWriteVBRHeader( strFileOut );MP3 file should be closed before you use the "_beWriteVBRHeader" function. and you write the header on the wav file instead of the mp3 output file ! It should be _WinAPI_CloseHandle($rf) _WinAPI_CloseHandle($hWriteOut) _beWriteVBRHeader("m.mp3") But there must be another mistake because it doesn't resolve the problem...
    1 point
  3. Project to search for binary data in three different ways using assembly language Three ways - Search for a binary - Search for a binary using the callback function - Search for a binary using the data structure Find very fast .. Greetings Project Files ASM_BinarySearch.zip ASM_BinarySearch.au3 #include <WinAPI.au3> Global $MsvcrtDll = _WinAPI_LoadLibrary( "msvcrt.dll" ) Global $Mmove = _WinAPI_GetProcAddress($MsvcrtDll,"memmove") Global $Malloc = _WinAPI_GetProcAddress($MsvcrtDll,"malloc") Global $FreeMemy = _WinAPI_GetProcAddress($MsvcrtDll,"free") Global $DwordSize=DllStructGetSize(DllStructCreate("DWORD")) Global $PointerSize=DllStructGetSize(DllStructCreate("PTR")) Global $AddressBinarySearch = LoadBinarySearch() Global $AddressBinarySearchPtr = DllStructGetPtr($AddressBinarySearch) Global $AddressCallbackBinarySearch = LoadCallbackBinarySearch() Global $AddressCallbackBinarySearchPtr = DllStructGetPtr($AddressCallbackBinarySearch) Global $AddressXBinarySearch = LoadXBinarySearch() Global $AddressXBinarySearchPtr = DllStructGetPtr($AddressXBinarySearch) Func BinarySearch($DataPtr,$SubDataPtr,$DataPtrSize,$SubDataPtrSize,$Step = 1) ; $Step Loop Step if ($SubDataPtrSize < 1) Or ($DataPtrSize < 1) Or ($SubDataPtrSize > $DataPtrSize) Then Return SetError(1,0,0) Local $MaxPosition = ($DataPtrSize - $SubDataPtrSize) $Return = DllCallAddress("DWORD",$AddressBinarySearchPtr,"DWORD",$MaxPosition, _ "DWORD",$DataPtrSize,"DWORD",$SubDataPtrSize,"PTR",$DataPtr,"PTR",$SubDataPtr,"DWORD",$Step) if @error Then Return SetError(2,0,0) Return $Return[0] ; Return FindPosition // OffSetPosition = FindPosition - 1 EndFunc Func CallbackBinarySearch($DataPtr,$SubDataPtr,$CbFuncName,$DataPtrSize,$SubDataPtrSize,$Step = 1) ; $Step Loop Step ;$CbFuncName ;Func CallbackFunc($FindPosition,$OffSetPosition,$DataPtr,$SubDataPtr,$DataPtrSize,$SubDataPtrSize) ;MsgBox(0,"OffSetPosition = " & $OffSetPosition ,"FindPosition = " & $FindPosition) ;Return 1 ;return ;0 ; Stop ;Other Ways : Continue ;EndFunc if ($SubDataPtrSize < 1) Or ($DataPtrSize < 1) Or ($SubDataPtrSize > $DataPtrSize) Then Return SetError(1,0,False) Local $RegCallbackFunc = DllCallbackRegister($CbFuncName,"DWORD","DWORD;DWORD;PTR;PTR;DWORD;DWORD") if @error Then Return SetError(2,0,False) Local $CkFuncPtr = DllCallbackGetPtr($RegCallbackFunc) Local $MaxPosition = ($DataPtrSize - $SubDataPtrSize) Local $StepTest = $Step >= $SubDataPtrSize $Return = DllCallAddress("DWORD",$AddressCallbackBinarySearchPtr,"DWORD",$MaxPosition,"DWORD", _ $DataPtrSize,"DWORD",$SubDataPtrSize,"PTR",$DataPtr,"PTR",$SubDataPtr,"PTR",$CkFuncPtr,"DWORD",$Step,"DWORD",$StepTest) if @error Then DllCallbackFree($RegCallbackFunc) Return SetError(3,0,False) EndIf DllCallbackFree($RegCallbackFunc) Return True ; Return BOOL EndFunc Func XBinarySearch($DataPtr,$SubDataPtr,$DataPtrSize,$SubDataPtrSize,$Step = 1) ; $Step Loop Step if ($SubDataPtrSize < 1) Or ($DataPtrSize < 1) Or ($SubDataPtrSize > $DataPtrSize) Then Return SetError(1,0,False) Local $tagReturnStruct = "DWORD ArrayCount;PTR PositionArray" Local $ReturnStruct = DllStructCreate($tagReturnStruct) Local $RtStructPtr = DllStructGetPtr($ReturnStruct) Local $MaxPosition = ($DataPtrSize - $SubDataPtrSize) Local $StepTest = $Step >= $SubDataPtrSize Local $Return = DllCallAddress("DWORD",$AddressXBinarySearchPtr,"DWORD",$MaxPosition,"DWORD",$DataPtrSize, _ "DWORD",$SubDataPtrSize,"PTR",$DataPtr,"PTR",$SubDataPtr,"PTR",$RtStructPtr,"DWORD",$Step,"DWORD",$StepTest) if @error Then Return SetError(2,0,0) Local $ArrayCount = DllStructGetData($ReturnStruct,1) Local $PosonArray = DllStructGetData($ReturnStruct,2) if ($ArrayCount = 0) Then Return SetError(3,0,0) Local $tagReturnStruct = "DWORD ArrayCount;DWORD PositionArray[" & $ArrayCount & "]" Local $ReturnStruct = DllStructCreate($tagReturnStruct) Local $NewPosonArray = DllStructGetPtr($ReturnStruct,2) DllStructSetData($ReturnStruct,1,$ArrayCount) DllCallAddress("ptr:cdecl",$Mmove,"ptr",$NewPosonArray,"ptr",$PosonArray,"int",($ArrayCount * $DwordSize)) DllCallAddress("none:cdecl",$FreeMemy,"ptr",$PosonArray) Return $ReturnStruct ; Return Struct of FindPosition // tagStruct = "DWORD ArrayCount;DWORD PositionArray[" & ArrayCount & "]" EndFunc Func LoadBinarySearch() Local $TA,$TB,$TC,$Start,$JGEnd,$JZTC,$TBJNZ,$JMPTA,$JMPStart,$End Local $OffSetMaxPosition = $PointerSize Local $OffSetDataPtrSize = ($OffSetMaxPosition + $DwordSize) Local $OffSetSubDataPtrSize = ($OffSetDataPtrSize + $DwordSize) Local $OffSetDataPtr = ($OffSetSubDataPtrSize + $DwordSize) Local $OffSetSubDataPtr = ($OffSetDataPtr + $PointerSize) Local $OffSetStep = ($OffSetSubDataPtr + $PointerSize) For $i = 1 To 2 $_ASMCode = "0x" $_ASMCode &= "BF" & HexBinary(0) ;mov edi,0 $_ASMCode &= "8B7424" & Hex($OffSetSubDataPtrSize,2) ;mov esi,[esp + $OffSetSubDataPtrSize] $_ASMCode &= "8B5C24" & Hex($OffSetDataPtr,2) ;mov ebx,[esp + $OffSetDataPtr] $_ASMCode &= "8B4424" & Hex($OffSetSubDataPtr,2) ;mov eax,[esp + $OffSetSubDataPtr] ; $Start: // $Start = BinaryLen($_ASMCode) $_ASMCode &= "BA" & HexBinary(0) ;mov edx,0 ; TA: // $TA = BinaryLen($_ASMCode) $_ASMCode &= "3BF2";CMP esi,edx $_ASMCode &= "74" & Hex(($TC - $JZTC),2) ;JZ $TC; $JZTC = BinaryLen($_ASMCode) $_ASMCode &= "8A2C10" ;mov CH,[eax + edx]; $_ASMCode &= "3A2C13" ;CMP CH,[ebx + edx] $_ASMCode &= "75" & Hex(($TB - $TBJNZ),2) ;JNZ TB $TBJNZ = BinaryLen($_ASMCode) $_ASMCode &= "83C2" & Hex(1,2) ;add edx,1 $JMPTA = BinaryLen($_ASMCode) $_ASMCode &= "E9" & HexBinary(-(($JMPTA - $TA) + 5)) ;JMP TA ; TB: // $TB = BinaryLen($_ASMCode) $_ASMCode &= "037C24" & Hex($OffSetStep,2) ;add edi,[esp + $OffSetStep] $_ASMCode &= "3B7C24" & Hex($OffSetMaxPosition,2) ;CMP edi,[esp + $OffSetMaxPosition] $_ASMCode &= "7F" & Hex(($End - $JGEnd),2) ;JG End $JGEnd = BinaryLen($_ASMCode) $_ASMCode &= "035C24" & Hex($OffSetStep,2) ;add ebx,[esp + $OffSetStep] $JMPStart = BinaryLen($_ASMCode) $_ASMCode &= "E9" & HexBinary(-(($JMPStart - $Start) + 5)) ;JMP Start ; TC: // $TC = BinaryLen($_ASMCode) $_ASMCode &= "83C7" & Hex(1,2) ;add edi,1 $_ASMCode &= "8BC7" ;mov eax,edi $_ASMCode &= "C2" & Hex((($PointerSize * 2) + ($DwordSize * 4)),2) & Hex(0,2) ;ret (($PointerSize * 2) + ($DwordSize * 3)) & "00" // Args Size ; End: // $End = BinaryLen($_ASMCode) $_ASMCode &= "B8" & HexBinary(0) ;mov eax,0 $_ASMCode &= "C2" & Hex((($PointerSize * 2) + ($DwordSize * 4)),2) & Hex(0,2) ;ret (($PointerSize * 2) + ($DwordSize * 3)) & "00" // Args Size Next $Address = DllStructCreate("byte[" & BinaryLen($_ASMCode) & "]") DllStructSetData($Address,1,$_ASMCode) Return $Address EndFunc Func LoadCallbackBinarySearch() Local $TA,$TB,$TC,$Start,$JGEnd,$JZTC,$TBJNZ,$JMPTA,$JMPStartA,$JMPStartB,$End,$JZEnd,$JGEnd2,$JZTD,$TD,$JGEnd3,$JMPStartC Local $OffSetMaxPosition = $PointerSize Local $OffSetDataPtrSize = ($OffSetMaxPosition + $DwordSize) Local $OffSetSubDataPtrSize = ($OffSetDataPtrSize + $DwordSize) Local $OffSetDataPtr = ($OffSetSubDataPtrSize + $DwordSize) Local $OffSetSubDataPtr = ($OffSetDataPtr + $PointerSize) Local $OffSetCkFuncPtr = ($OffSetSubDataPtr + $PointerSize) Local $OffSetStep = ($OffSetCkFuncPtr + $PointerSize) Local $OffSetStepTest = ($OffSetStep + $DwordSize) For $i = 1 To 2 $_ASMCode = "0x" $_ASMCode &= "BF" & HexBinary(0) ;mov edi,0 $_ASMCode &= "8B7424" & Hex($OffSetMaxPosition,2) ;mov esi,[esp + $OffSetMaxPosition] $_ASMCode &= "8B5C24" & Hex($OffSetDataPtr,2) ;mov ebx,[esp + $OffSetDataPtr] $_ASMCode &= "8B4C24" & Hex($OffSetSubDataPtr,2) ;mov ecx,[esp + $OffSetSubDataPtr] ; $Start: // $Start = BinaryLen($_ASMCode) $_ASMCode &= "BA" & HexBinary(0) ;mov edx,0 ; TA: // $TA = BinaryLen($_ASMCode) $_ASMCode &= "3B5424" & Hex($OffSetSubDataPtrSize,2) ;CMP edx,[esp + $OffSetSubDataPtrSize] $_ASMCode &= "74" & Hex(($TC - $JZTC),2) ;JZ $TC; $JZTC = BinaryLen($_ASMCode) $_ASMCode &= "8A2413" ;mov AH,[ebx + edx] $_ASMCode &= "3A2411" ;CMP AH,[ecx + edx] $_ASMCode &= "75" & Hex(($TB - $TBJNZ),2) ;JNZ TB $TBJNZ = BinaryLen($_ASMCode) $_ASMCode &= "83C2" & Hex(1,2) ;add edx,1 $JMPTA = BinaryLen($_ASMCode) $_ASMCode &= "E9" & HexBinary(-(($JMPTA - $TA) + 5)) ;JMP TA ; TB: // $TB = BinaryLen($_ASMCode) $_ASMCode &= "037C24" & Hex($OffSetStep,2) ;add edi,[esp + $OffSetStep] $_ASMCode &= "3BFE" ;CMP edi,esi $_ASMCode &= "7F" & Hex(($End - $JGEnd),2) ;JG End $JGEnd = BinaryLen($_ASMCode) $_ASMCode &= "035C24" & Hex($OffSetStep,2) ;add ebx,[esp + $OffSetStep] $JMPStartA = BinaryLen($_ASMCode) $_ASMCode &= "E9" & HexBinary(-(($JMPStartA - $Start) + 5)) ;JMP Start ; TC: // $TC = BinaryLen($_ASMCode) $_ASMCode &= "8B4424" & Hex($OffSetCkFuncPtr,2) ;mov eax,[esp + $OffSetCkFuncPtr] $_ASMCode &= "FF7424" & Hex($OffSetSubDataPtrSize,2) ;push [esp + $OffSetSubDataPtrSize] $_ASMCode &= "FF7424" & Hex($OffSetDataPtrSize,2) ;push [esp + $OffSetDataPtrSize] $_ASMCode &= "FF7424" & Hex($OffSetSubDataPtr,2) ;push [esp + $OffSetSubDataPtr] $_ASMCode &= "FF7424" & Hex($OffSetDataPtr,2) ;push [esp + $OffSetDataPtr] $_ASMCode &= "57" ;push edi; $_ASMCode &= "83C7" & Hex(1,2) ;add edi,1 $_ASMCode &= "57" ;push edi; $_ASMCode &= "83EF" & Hex(1,2) ;sub edi,1 $_ASMCode &= "FFD0" ;call eax $_ASMCode &= "83F8" & Hex(0,2);CMP eax,0 $_ASMCode &= "74" & Hex(($End - $JZEnd),2) ;JZ $End; $JZEnd = BinaryLen($_ASMCode) $_ASMCode &= "8B4424" & Hex($OffSetStepTest,2) ;mov eax,[esp + $OffSetStepTest] $_ASMCode &= "83F8" & Hex(1,2);CMP eax,1 $_ASMCode &= "74" & Hex(($TD - $JZTD),2) ;JZ $TD; $JZTD = BinaryLen($_ASMCode) $_ASMCode &= "037C24" & Hex($OffSetSubDataPtrSize,2) ;add edi,[esp + $OffSetSubDataPtrSize] $_ASMCode &= "3BFE" ;CMP edi,esi $_ASMCode &= "7F" & Hex(($End - $JGEnd3),2) ;JG End $JGEnd3 = BinaryLen($_ASMCode) $_ASMCode &= "035C24" & Hex($OffSetSubDataPtrSize,2) ;add ebx,[esp + $OffSetSubDataPtrSize] $_ASMCode &= "8B4C24" & Hex($OffSetSubDataPtr,2) ;mov ecx,[esp + $OffSetSubDataPtr] $JMPStartC = BinaryLen($_ASMCode) $_ASMCode &= "E9" & HexBinary(-(($JMPStartC - $Start) + 5)) ;JMP Start ; TD: // $TD = BinaryLen($_ASMCode) $_ASMCode &= "037C24" & Hex($OffSetStep,2) ;add edi,[esp + $OffSetStep] $_ASMCode &= "3BFE" ;CMP edi,esi $_ASMCode &= "7F" & Hex(($End - $JGEnd2),2) ;JG End $JGEnd2 = BinaryLen($_ASMCode) $_ASMCode &= "035C24" & Hex($OffSetStep,2) ;add ebx,[esp + $OffSetStep] $_ASMCode &= "8B4C24" & Hex($OffSetSubDataPtr,2) ;mov ecx,[esp + $OffSetSubDataPtr] $JMPStartB = BinaryLen($_ASMCode) $_ASMCode &= "E9" & HexBinary(-(($JMPStartB - $Start) + 5)) ;JMP Start ; End: // $End = BinaryLen($_ASMCode) $_ASMCode &= "B8" & HexBinary(0) ;mov eax,0 $_ASMCode &= "C2" & Hex((($PointerSize * 3) + ($DwordSize * 5)),2) & Hex(0,2) ;ret (($PointerSize * 3) + ($DwordSize * 5)) & "00" // Args Size Next $Address = DllStructCreate("byte[" & BinaryLen($_ASMCode) & "]") DllStructSetData($Address,1,$_ASMCode) Return $Address EndFunc Func LoadXBinarySearch() Local $TA,$TB,$TC,$TD,$Start,$JGEnd,$JZTC,$TBJNZ,$JMPTA,$JMPStartA,$JMPStartB Local $JMPStartC ,$End,$JZEnd,$JZTD,$TE,$JZTE,$JMPStartD,$TF,$JZTF,$JMPStartE Local $OffSetMaxPosition = $PointerSize Local $OffSetDataPtrSize = ($OffSetMaxPosition + $DwordSize) Local $OffSetSubDataPtrSize = ($OffSetDataPtrSize + $DwordSize) Local $OffSetDataPtr = ($OffSetSubDataPtrSize + $DwordSize) Local $OffSetSubDataPtr = ($OffSetDataPtr + $PointerSize) Local $OffSetRtStPtr = ($OffSetSubDataPtr + $PointerSize) Local $OffSetStep = ($OffSetRtStPtr + $PointerSize) Local $OffSetStepTest = ($OffSetStep + $DwordSize) For $i = 1 To 2 $_ASMCode = "0x" $_ASMCode &= "BF" & HexBinary(0) ;mov edi,0 ;$Start: // $Start = BinaryLen($_ASMCode) $_ASMCode &= "8B4424" & Hex($OffSetMaxPosition,2) ;mov eax,[esp + $OffSetMaxPosition] $_ASMCode &= "3BF8" ;CMP edi,eax $_ASMCode &= "0F8F" & HexBinary(($End - $JGEnd)) ;JG End $JGEnd = BinaryLen($_ASMCode) $_ASMCode &= "BE" & HexBinary(0) ;mov esi,0 ; TA: // $TA = BinaryLen($_ASMCode) $_ASMCode &= "8B4424" & Hex($OffSetSubDataPtrSize,2) ;mov eax,[esp + $OffSetSubDataPtrSize] $_ASMCode &= "3BF0" ;CMP esi,eax $_ASMCode &= "74" & Hex(($TC - $JZTC),2) ;JZ $TC; $JZTC = BinaryLen($_ASMCode) $_ASMCode &= "8B5C24" & Hex($OffSetDataPtr,2) ;mov ebx,[esp + $OffSetDataPtr] $_ASMCode &= "03DF" ;add ebx,edi $_ASMCode &= "03DE" ;add ebx,esi $_ASMCode &= "8A0B" ;mov CL,[ebx]; $_ASMCode &= "8B5C24" & Hex($OffSetSubDataPtr,2) ;mov ebx,[esp + $OffSetSubDataPtr] $_ASMCode &= "03DE" ;add ebx,esi $_ASMCode &= "8A2B" ;mov CH,[ebx]; $_ASMCode &= "3ACD" ;CMP CL,CH $_ASMCode &= "75" & Hex(($TB - $TBJNZ),2) ;JNZ TE $TBJNZ = BinaryLen($_ASMCode) $_ASMCode &= "83C6" & Hex(1,2) ;add esi,1 $JMPTA = BinaryLen($_ASMCode) $_ASMCode &= "E9" & HexBinary(-(($JMPTA - $TA) + 5)) ;JMP TA ; TB: // $TB = BinaryLen($_ASMCode) $_ASMCode &= "037C24" & Hex($OffSetStep,2) ;add edi,[esp + $OffSetStep] $JMPStartA = BinaryLen($_ASMCode) $_ASMCode &= "E9" & HexBinary(-(($JMPStartA - $Start) + 5)) ;JMP Start ; TC: // $TC = BinaryLen($_ASMCode) $_ASMCode &= "8B4424" & Hex($OffSetRtStPtr,2) ;mov eax,[esp + $OffSetRtStPtr] $_ASMCode &= "8B00" ;mov eax,[eax] $_ASMCode &= "83F8" & Hex(0,2);CMP eax,0 $_ASMCode &= "74" & Hex(($TD - $JZTD),2) ;JZ $TD $JZTG = BinaryLen($_ASMCode) $_ASMCode &= "83C7" & Hex(1,2) ;add edi,1 $_ASMCode &= "8B4424" & Hex($OffSetRtStPtr,2) ;mov eax,[esp + $OffSetRtStPtr] $_ASMCode &= "8B00" ;mov eax,[eax] $_ASMCode &= "83C0" & Hex(1,2) ;add eax,1 $_ASMCode &= "B9" & HexBinary($DwordSize) ;mov ecx,$DwordSize $_ASMCode &= "F7E1" ;MUL ecx; $_ASMCode &= "50" ;push eax $_ASMCode &= "B8" & HexBinary($Malloc) ;mov eax,$Malloc $_ASMCode &= "FFD0" ;call eax $_ASMCode &= "83C4" & Hex($DwordSize,2) ;add esp,$DwordSize $_ASMCode &= "8BD8" ;mov ebx,eax $_ASMCode &= "8B4424" & Hex($OffSetRtStPtr,2) ;mov eax,[esp + $OffSetRtStPtr] $_ASMCode &= "8B00" ;mov eax,[eax] $_ASMCode &= "B9" & HexBinary($DwordSize) ;mov ecx,$DwordSize $_ASMCode &= "F7E1" ;MUL ecx; $_ASMCode &= "50" ;push eax $_ASMCode &= "8B4424" & Hex(($OffSetRtStPtr + $DwordSize),2) ;mov eax,[esp + ($OffSetRtStPtr + $DwordSize)] $_ASMCode &= "83C0" & Hex($DwordSize,2) ;add eax,$DwordSize $_ASMCode &= "8B00" ;mov eax,[eax] $_ASMCode &= "50" ;push eax $_ASMCode &= "53" ;push ebx $_ASMCode &= "B8" & HexBinary($Mmove) ;mov eax,$Mmove $_ASMCode &= "FFD0" ;call eax $_ASMCode &= "83C4" & Hex((($PointerSize * 2) + $DwordSize),2) ;add esp,(($PointerSize * 2) + $DwordSize) $_ASMCode &= "8B4424" & Hex($OffSetRtStPtr,2) ;mov eax,[esp + $OffSetRtStPtr] $_ASMCode &= "83C0" & Hex($DwordSize,2) ;add eax,$DwordSize $_ASMCode &= "8B00" ;mov eax,[eax] $_ASMCode &= "50" ;push eax $_ASMCode &= "B8" & HexBinary($FreeMemy) ;mov eax,$FreeMemy $_ASMCode &= "FFD0" ;call eax $_ASMCode &= "83C4" & Hex($PointerSize,2) ;add esp,$PointerSize $_ASMCode &= "8B4424" & Hex($OffSetRtStPtr,2) ;mov eax,[esp + $OffSetRtStPtr] $_ASMCode &= "8B00" ;mov eax,[eax] $_ASMCode &= "B9" & HexBinary($DwordSize) ;mov ecx,$DwordSize $_ASMCode &= "F7E1" ;MUL ecx; $_ASMCode &= "893C03" ;mov [ebx + eax],edi $_ASMCode &= "8B4424" & Hex($OffSetRtStPtr,2) ;mov eax,[esp + $OffSetRtStPtr] $_ASMCode &= "8000" & Hex(1,2) ;add [eax],1 $_ASMCode &= "83C0" & Hex($DwordSize,2) ;add eax,$DwordSize $_ASMCode &= "8918" ;mov [eax],ebx $_ASMCode &= "83EF" & Hex(1,2) ;sub edi,1 $_ASMCode &= "8B4424" & Hex($OffSetStepTest,2) ;mov eax,[esp + $OffSetStepTest] $_ASMCode &= "83F8" & Hex(1,2);CMP eax,1 $_ASMCode &= "74" & Hex(($TF - $JZTF),2) ;JZ $TF; $JZTF = BinaryLen($_ASMCode) $_ASMCode &= "037C24" & Hex($OffSetSubDataPtrSize,2) ;add edi,[esp + $OffSetSubDataPtrSize] $JMPStartE = BinaryLen($_ASMCode) $_ASMCode &= "E9" & HexBinary(-(($JMPStartE - $Start) + 5)) ;JMP Start ; TF: // $TF = BinaryLen($_ASMCode) $_ASMCode &= "037C24" & Hex($OffSetStep,2) ;add edi,[esp + $OffSetStep] $JMPStartB = BinaryLen($_ASMCode) $_ASMCode &= "E9" & HexBinary(-(($JMPStartB - $Start) + 5)) ;JMP Start ; $TD: // $TD = BinaryLen($_ASMCode) $_ASMCode &= "83C7" & Hex(1,2) ;add edi,1 $_ASMCode &= "BB" & HexBinary($DwordSize) ;mov ebx,$DwordSize $_ASMCode &= "53" ;push ebx $_ASMCode &= "B8" & HexBinary($Malloc) ;mov eax,$Malloc $_ASMCode &= "FFD0" ;call eax $_ASMCode &= "83C4" & Hex($DwordSize,2) ;add esp,$DwordSize $_ASMCode &= "8938" ;mov [eax],edi $_ASMCode &= "8B5C24" & Hex($OffSetRtStPtr,2) ;mov ebx,[esp + $OffSetRtStPtr] $_ASMCode &= "C603" & Hex(1,2) ;mov [ebx],1 $_ASMCode &= "83C3" & Hex($DwordSize,2) ;add ebx,$DwordSize $_ASMCode &= "8903" ;mov [ebx],eax $_ASMCode &= "83EF" & Hex(1,2) ;sub edi,1 $_ASMCode &= "8B4424" & Hex($OffSetStepTest,2) ;mov eax,[esp + $OffSetStepTest] $_ASMCode &= "83F8" & Hex(1,2);CMP eax,1 $_ASMCode &= "74" & Hex(($TE - $JZTE),2) ;JZ $TE; $JZTE = BinaryLen($_ASMCode) $_ASMCode &= "037C24" & Hex($OffSetSubDataPtrSize,2) ;add edi,[esp + $OffSetSubDataPtrSize] $JMPStartD = BinaryLen($_ASMCode) $_ASMCode &= "E9" & HexBinary(-(($JMPStartD - $Start) + 5)) ;JMP Start ; $TE: // $TE = BinaryLen($_ASMCode) $_ASMCode &= "037C24" & Hex($OffSetStep,2) ;add edi,[esp + $OffSetStep] $JMPStartC = BinaryLen($_ASMCode) $_ASMCode &= "E9" & HexBinary(-(($JMPStartC - $Start) + 5)) ;JMP Start ; End: // $End = BinaryLen($_ASMCode) $_ASMCode &= "B8" & HexBinary(0) ;mov eax,0 $_ASMCode &= "C2" & Hex((($PointerSize * 3) + ($DwordSize * 5)),2) & Hex(0,2) ;ret (($PointerSize * 3) + ($DwordSize * 3)) & "00" // Args Size Next $Address = DllStructCreate("byte[" & BinaryLen($_ASMCode) & "]") DllStructSetData($Address,1,$_ASMCode) Return $Address EndFunc Func HexBinary($Value) Return Hex(Binary($Value)) EndFunc ColorSearch.au3 #include <WinAPI.au3> #include <Memory.au3> #include <Color.au3> #include <ScreenCapture.au3> #include "ASM_BinarySearch.au3" Global $itagRGBQUAD = "BYTE rgbBlue;BYTE rgbGreen;BYTE rgbRed;BYTE rgbReserved" Global $RgbSize = DllStructGetSize(DllStructCreate($itagRGBQUAD)) $hGUI = GUICreate("Color Gui",20,20,@DesktopWidth - 20,@DesktopHeight - 100) GUISetBkColor(0xFF80FF, $hGUI) GUISetState(@SW_SHOW, $hGUI) MsgBox(0,"PixelSearch","PixelSearch") $hTimer = TimerInit() $Pos1 = PixelSearch(0 , 0, @DesktopWidth, @DesktopHeight,0xFF80FF) ;0xFFFFFF $iDiff1 = TimerDiff($hTimer) MsgBox(0,"nPixelSearch","nPixelSearch") $hTimer = TimerInit() $Pos2 = nPixelSearch(0, 0, @DesktopWidth, @DesktopHeight,0xFF80FF) ;0xFFFFFF $iDiff2 = TimerDiff($hTimer) if IsArray($Pos1) And IsArray($Pos2) Then $Text1 = String($Pos1[0] & " " & $Pos1[1] & " PixelSearch Time ==> " & $iDiff1) $Text2 = String($Pos2[0] & " " & $Pos2[1] & " nPixelSearch Time ==> " & $iDiff2) MsgBox(0,"PixelSearch",$Text1 & @CRLF & $Text2) EndIf MsgBox(0,"nPixelSearch","nPixelSearch") $hTimer = TimerInit() $Pos2 = nPixelSearch(0, 0, @DesktopWidth, @DesktopHeight,0xFF80FF) ;0xFFFFFF $iDiff2 = TimerDiff($hTimer) MsgBox(0,"PixelSearch","PixelSearch") $hTimer = TimerInit() $Pos1 = PixelSearch(0 , 0, @DesktopWidth, @DesktopHeight,0xFF80FF) ;0xFFFFFF $iDiff1 = TimerDiff($hTimer) if IsArray($Pos1) And IsArray($Pos2) Then $Text1 = String($Pos1[0] & " " & $Pos1[1] & " PixelSearch Time ==> " & $iDiff1) $Text2 = String($Pos2[0] & " " & $Pos2[1] & " nPixelSearch Time ==> " & $iDiff2) MsgBox(0,"PixelSearch",$Text1 & @CRLF & $Text2) EndIf Func nPixelSearch($left = 0,$top = 0,$right = -1,$bottom = -1,$Color = 0,$bCursor = False) Local $hBmp = _ScreenCapture_Capture("",$left,$top,$right,$bottom,$bCursor) if Not($hBmp) Then Return SetError(1,0,0) Local $aCoord = BmpSearchColor($hBmp,$Color) _WinAPI_DeleteObject($hBmp) if Not IsArray($aCoord) Then Return SetError(2,0,0) Return $aCoord EndFunc Func BmpSearchColor($hBmp,$Color) Local $BitsStruct = GetBitsStruct($hBmp) if @error Then Return SetError(1,0,0) Local $BitsStringPtr = DllStructGetPtr($BitsStruct,"RGBQUAD") Local $BitsSize = DllStructGetData($BitsStruct,"SIZE") Local $biWidth = DllStructGetData($BitsStruct,"WIDTH") Local $biHeight = DllStructGetData($BitsStruct,"HEIGHT") Local $iColor = DllStructCreate("BYTE RGB[3]") DllStructSetData($iColor,1,$Color) $iColorPtr = DllStructGetPtr($iColor) $FindPosition = BinarySearch($BitsStringPtr,$iColorPtr,$BitsSize,3,4) ;$SubDataPtrSize = 3 // $Step = $RgbSize = 4 // ; $Step Is Loop Step if @error Then Return SetError(2,0,0) Local $OffSetPosition = $FindPosition - 1 $OffSetPosition /= $RgbSize ; $RgbSize = 4 /// 4byte = 1pixel $X = Mod($OffSetPosition,$biWidth) ; Get left $Y = (($OffSetPosition - $X) / $biWidth) ; Get top Local $aCoord[2] $aCoord[0] = $X $aCoord[1] = $Y Return $aCoord EndFunc Func GetBitsStruct( $hBmp , $L = -1 , $T = -1 , $W = -1 , $H = -1 ) Local $SizeArray = GetImageSize($hBmp) if @error Then Return SetError(1,0,0) Local $biWidth = $SizeArray[0] Local $biHeight = $SizeArray[1] if ($L < 0) Then $L = 0 if ($T < 0) Then $T = 0 if ($W < 0) Then $W = ($biWidth - $L) if ($H < 0) Then $H = ($biHeight - $T) if ($L >= $biWidth Or (($L + $W) > $biWidth)) Then $L = 0 if ($T >= $biHeight Or (($T + $H) > $biHeight)) Then $T = 0 Local $vRgbSize = ($RgbSize * ($biWidth * $biHeight)) Local $vStBits = DllStructCreate("INT WIDTH;INT HEIGHT;INT SIZE;BYTE RGBQUAD[" & ($vRgbSize) & "]") DllStructSetData($vStBits ,"WIDTH",$biWidth) DllStructSetData($vStBits,"HEIGHT",$biHeight) DllStructSetData($vStBits,"SIZE",$vRgbSize) GetBitmapBits($hBmp,DllStructGetPtr($vStBits,"RGBQUAD"),$vRgbSize) if @error Then Return SetError(2,0,0) if ($L = 0 And $T = 0 And $W = $biWidth And $H = $biHeight) Then Return $vStBits Local $nRgbSize = ($RgbSize * ($W * $H)) , $ColusCount = $W Local $nStBits = DllStructCreate("INT WIDTH;INT HEIGHT;INT SIZE;BYTE RGBQUAD[" & ($nRgbSize) & "]") DllStructSetData($nStBits ,"WIDTH",$W) DllStructSetData($nStBits,"HEIGHT",$H) DllStructSetData($nStBits,"SIZE",$nRgbSize) For $RowIndex = 0 To ($H - 1) Local $nStBPtr = GetPointerAtRowPos($nStBits,$RowIndex) ; Move Ptr To First BYTE Of Row => $RowIndex Local $vStBPtr = GetPointerAtRowPos($vStBits,($RowIndex + $T)) + ($L * $RgbSize) ; Move Ptr To First BYTE Of Row => ($RowIndex + $T) ; + ($L * $RgbSize) Move PointerAtRowPos From left to right + ($L * $RgbSize) _MemMoveMemory($vStBPtr,$nStBPtr,($RgbSize * ($ColusCount - 1))) ;Size Of One Row In $nStBPtr Next Return $nStBits EndFunc Func GetBitmapBits($hbmp,$lpvBits,$cbBuffer) $BytesNu = DllCall("Gdi32.dll","LONG","GetBitmapBits","ptr" _ ,$hbmp,"LONG",$cbBuffer,"ptr",$lpvBits) if @error Or Not($BytesNu[0]) Then SetError(1,0,0) Return SetError(0,0,$BytesNu[0]) EndFunc Func GetPointerAtRowPos($StBits,$RowIndex) if Not IsDllStruct($StBits) Then Return SetError(1,0,0) Local $ColusCount = DllStructGetData($StBits,"WIDTH") Local $RowsCount = DllStructGetData($StBits,"HEIGHT") If ($RowIndex < 0 Or $RowIndex > ($RowsCount -1)) Then Return SetError(2,0,0) Local $StBitsPtr = DllStructGetPtr($StBits,"RGBQUAD") Local $PointerAtRowPos = ($StBitsPtr + (($RowIndex * $ColusCount) * $RgbSize)) Return $PointerAtRowPos EndFunc Func GetImageSize($hBmp) Local $ntagBITMAPINFO = "DWORD biSize;LONG biWidth;LONG biHeight;USHORT biPlanes;" & _ "USHORT biBitCount;DWORD biCompression;DWORD biSizeImage;LONG biXPelsPerMeter;" & _ "LONG biYPelsPerMeter;DWORD biClrUsed;DWORD biClrImportant;BYTE RGBQUAD[4]" Local $vBITMAPINFO = DllStructCreate($ntagBITMAPINFO) DllStructSetData($vBITMAPINFO,"biSize",(DllStructGetSize($vBITMAPINFO) - $RgbSize)) Local $hDC = _WinAPI_CreateCompatibleDC(0) if Not($hDC) Then _WinAPI_DeleteDC($hDC) Return SetError(1,0,0) EndIf $Return = _WinAPI_GetDIBits($hDC,$hBmp,0,0,0,DllStructGetPtr($vBITMAPINFO),0) if Not($Return) Then _WinAPI_DeleteDC($hDC) Return SetError(2,0,0) EndIf _WinAPI_DeleteDC($hDC) Local $biWidth = DllStructGetData($vBITMAPINFO,"biWidth") Local $biHeight = DllStructGetData($vBITMAPINFO,"biHeight") Local $SizeArray[2] $SizeArray[0] = $biWidth $SizeArray[1] = $biHeight Return $SizeArray EndFunc CallbackBinarySearch.au3 #include <WinAPI.au3> #include <Memory.au3> #include <Color.au3> #include <ScreenCapture.au3> #include "ASM_BinarySearch.au3" $Text = "" $SubText = "Autoit" For $i = 1 To 10000 $Text &= "1" Next $Text &= "Autoit" & "Autoit" & "Autoit" $Len1 = StringLen($Text) $Len2 = StringLen($SubText) $St1 = DllStructCreate("CHAR[" & $Len1 & "]") DllStructSetData($St1,1,$Text) $Ptr1 = DllStructGetPtr($St1) $St2 = DllStructCreate("CHAR[" & $Len2 & "]") DllStructSetData($St2,1,$SubText) $Ptr2 = DllStructGetPtr($St2) $Return = CallbackBinarySearch($Ptr1,$Ptr2,"CallbackFunc",$Len1,$Len2) MsgBox(0,"Return",$Return) Func CallbackFunc($FindPosition,$OffSetPosition,$DataPtr,$SubDataPtr,$DataPtrSize,$SubDataPtrSize) MsgBox(0,"OffSetPosition = " & $OffSetPosition ,"FindPosition = " & $FindPosition) Return 1 ;return ;0 ; Stop ;Other Ways : Continue EndFunc XBinarySearch.au3 #include <WinAPI.au3> #include <Memory.au3> #include <Color.au3> #include <ScreenCapture.au3> #include "ASM_BinarySearch.au3" $Text = "" $SubText = "Autoit" For $i = 1 To 10000 $Text &= "1" Next $Text &= "Autoit" & "Autoit" & "Autoit" $Len1 = StringLen($Text) $Len2 = StringLen($SubText) $St1 = DllStructCreate("CHAR[" & $Len1 & "]") DllStructSetData($St1,1,$Text) $Ptr1 = DllStructGetPtr($St1) $St2 = DllStructCreate("CHAR[" & $Len2 & "]") DllStructSetData($St2,1,$SubText) $Ptr2 = DllStructGetPtr($St2) $ReturnStruct = XBinarySearch($Ptr1,$Ptr2,$Len1,$Len2) For $i = 1 To DllStructGetData($ReturnStruct,"ArrayCount") $FindPosition = DllStructGetData($ReturnStruct,"PositionArray",$i) MsgBox(0,"Msg","FindPosition = " & $FindPosition) Next
    1 point
  4. That's what i feared. Looks like you missed to read the forum rules on your way in. I suggest to do it now. Game automation of any kind is not permitted on this forum. So you won't get help on this subject. Hope to see you soon with a legitimate question
    1 point
  5. SciTE 3.5.5.101 has been updated (build 1.3.4).
    1 point
  6. As a workaround I have found this function from trancexx that gets the control handle of the embedded object, so I can hide the window until everything is zoomed and then show it on screen again: ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ; Get control handle Global $hHandle = _GetObjectWinHandle($oIE) ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ; Focus it $oIE.document.focus ControlSend($hHandle, 0, 0, "^{+}") ControlSend($hHandle, 0, 0, "^{+}") ControlSend($hHandle, 0, 0, "^{+}") ControlSend($hHandle, 0, 0, "^{+}") GUISetState(@SW_SHOW, $GUIhora) Func _GetObjectWinHandle($oObject) Local $aCall = DllCall("oleacc.dll", "int", "WindowFromAccessibleObject", _ "idispatch", $oObject, _ "hwnd*", 0) If @error Or $aCall[0] Then Return SetError(1, 0, 0) EndIf Return $aCall[2] EndFunc ;==>_GetObjectWinHandleNow I can show the IE zoomed while I try to figure how to modify the JQuery to have the size that I need directly without zooming. Greets from Barcelona
    1 point
  7. Guy, PCRE \R by default translates into this atomic group: (?>\r\n|\n|\x0b|\f|\r|\x85|\x{2028}|\x{2029})Hence, if \R finds \r\n first, it will find a match. But it was decided to compile AutoIt PCRE with the option PCRE_BSR_ANYCRLF, which changes \R into the equivalent of: (?>\r\n|\n|\r)The default behavior (matching 0x0B, \f and 0x85 and the two other codepoints) can be restored in a pattern by placing (*BSR_UNICODE) at its head. But anyway, \R{2,} will definitely match all combinations of two or more line terminations using CR and/or LF. Note that "abc" & @CR & @LF counts for only one line termination (this is @CRLF). $text = "a" & @CRLF & @CRLF & @CRLF & "b" & @CR & @CR & @CR & "c" & @LF & @LF & @LF & "d" & @CRLF & @LF & @CRLF & "e" & @LF & @CRLF & @CRLF & "f" & @LF & @CR & "g" & @CR & @CRLF $result = StringRegExp($text, '(.*)(\R{2,})', 3) For $i = 0 To UBound($result) - 1 Step 2 ConsoleWrite($result[$i] & ' -> ' & Binary($result[$i + 1]) & @LF) Next
    1 point
  8. [.?…!;,:+=&*"“”„''‘’>] should be sufficient
    1 point
  9. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Left = 100 $gui = GUICreate("Test GUI", @DesktopWidth, @DesktopHeight, 0, 0, BitOr($WS_CAPTION, $WS_SYSMENU, $WS_POPUP, $WS_MAXIMIZE)) GUISetState (@SW_LOCK) GUISetBkColor(0xFFFFFF) ;Labels $mainlabel_line1 = GUICtrlCreateLabel("This is a test,", $Left, @DesktopHeight/2-250, 310, 35) $mainlabel_line2 = GUICtrlCreateLabel("I want this label to stay in the same position on multiple resolutions",$Left, @DesktopHeight/2-180, 675, 100) $font = "Arial" GUICtrlSetFont ($mainlabel_line1,22,1000,"",$font) GUICtrlSetFont ($mainlabel_line2,22,1000,"",$font) GUISetState(@SW_ENABLE) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEndEDIT: Or maybe you mean something like... $Left = Mod(@DesktopWidth / 4, @DesktopWidth)
    1 point
  10. Uops!!! I have to take a look at this closer. I use to burn DVD-Audio to hear improved rips of some of my CD's in the Playstation 3 with my 5.1 system. Thanks for sharing it with us
    1 point
  11. Here is a way : #include <Array.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $arr = [] ; NOTE this creates an array of size 1 with an empty string Global $Start, $End #Region ### START Koda GUI section ### Global $CharmROG_Form = GUICreate("Charm City ROG Automation", 566, 302, -1, -1) Global $Label1 = GUICtrlCreateLabel("Receipt No", 8, 16, 58, 17) Global $Label2 = GUICtrlCreateLabel("PO No", 208, 16, 36, 17) Global $Label3 = GUICtrlCreateLabel("Inv No", 384, 16, 36, 17) Global $ML_ReceiptNo = GUICtrlCreateInput("Receipt Number", 72, 16, 121, 21) Global $ML_PONo = GUICtrlCreateInput("Purchase Order", 256, 16, 121, 21) GUICtrlSetState(-1, $GUI_DISABLE) Global $ML_InvNo = GUICtrlCreateInput("Invoice Number", 424, 16, 121, 21) GUICtrlSetState(-1, $GUI_DISABLE) Global $Label4 = GUICtrlCreateLabel("Start Line", 8, 48, 49, 17) Global $Label5 = GUICtrlCreateLabel("End Line", 200, 48, 46, 17) Global $ML_StartLine = GUICtrlCreateInput("Starting Detail Dist Line", 72, 48, 121, 21) GUICtrlSetState(-1, $GUI_DISABLE) Global $ML_EndLine = GUICtrlCreateInput("Ending Detail Dist Line", 256, 48, 121, 21) GUICtrlSetState(-1, $GUI_DISABLE) Global $Checkbox1 = GUICtrlCreateCheckbox("Existing ROG", 384, 48, 161, 25, BitOR($GUI_SS_DEFAULT_CHECKBOX, $BS_RIGHTBUTTON)) GUICtrlSetState(-1, $GUI_DISABLE) Global $Input1 = GUICtrlCreateInput("Lot Date", 72, 80, 121, 21) GUICtrlSetState(-1, $GUI_DISABLE) Global $List1 = GUICtrlCreateList("", 201, 80, 183, 175) GUICtrlSetData(-1, "Lot Dates") GUICtrlSetState(-1, $GUI_DISABLE) Global $Label6 = GUICtrlCreateLabel("Lot Date", 12, 80, 49, 17) Global $Button1 = GUICtrlCreateButton("Process", 456, 264, 89, 25) GUICtrlSetState(-1, $GUI_DISABLE) $dummy = GUICtrlCreateDummy() Local $aAccelKeys[1][2] = [ ["{TAB}", $dummy] ] GUISetAccelerators($aAccelKeys) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ML_StartLine Validate_StartEnd () Case $ML_EndLine Validate_StartEnd() Case $dummy If ControlGetHandle($CharmROG_Form, "", ControlGetFocus($CharmROG_Form) ) = GUICtrlGetHandle($ML_ReceiptNo) Then GUISetAccelerators("") GUICtrlSetData($ML_PONo, GUICtrlRead($ML_ReceiptNo)) GUICtrlSetData($ML_InvNo, GUICtrlRead($ML_ReceiptNo)) EnableForm() GUICtrlSetState($ML_EndLine, $GUI_FOCUS) GUISetState(@SW_SHOW) EndIf EndSwitch WEnd Func EnableForm() GUICtrlSetState($ML_PONo, $GUI_ENABLE) GUICtrlSetState($ML_InvNo, $GUI_ENABLE) GUICtrlSetData($ML_StartLine, 1) GUICtrlSetState($ML_StartLine, $GUI_ENABLE) GUICtrlSetData($ML_EndLine, 1) GUICtrlSetState($ML_EndLine, $GUI_ENABLE) GUICtrlSetState($Checkbox1, $GUI_ENABLE) GUICtrlSetState($Input1, $GUI_ENABLE) ;GUICtrlSetState($List1, $GUI_ENABLE) GUICtrlSetState($Button1, $GUI_ENABLE) GUISetState(@SW_SHOW) EndFunc ;==>EnableForm Func Validate_StartEnd() Get_StartEnd() If $End < $Start Then GUICtrlSetData($ML_EndLine, $Start) GUISetState(@SW_SHOW) EndIf EndFunc ;==>Validate_StartEnd Func Get_StartEnd() $Start = GUICtrlRead($ML_StartLine) $End = GUICtrlRead($ML_EndLine) EndFunc ;==>Get_StartEnd
    1 point
  12. Ok, for those who would like to play, here's an early release of JPG-toM2V. I still need to add direct access to many options on the incomplete Options window. I also still need to add support for adding images and keeping them proportional by embedding on a right size background image. At the moment, the program will convert to the largest PAL size if not already, or leave as is (not recommended if intending for DVD and the like). NOTE - Your image should look a bit squashed at the correct PAL size, as it gets stretched when seen (16:9) on your Widescreen TV or Monitor. Unfortunately, you cannot just use widescreen images as is, as MuxMan etc won't accept them. And I need to add NTSC as an option, as currently only PAL is coded for. Aside from all that, it works well. To remove an image, hold down your CTRL key while clicking that item, and a removal prompt will appear. There are some other CTRL features too, like select or deselect ALL items, etc. You can, if you want, put other Frequencies in, by manually editing the Settings.ini file. Just be sure to use a pipe '|' character between each and a space between number and secs. JPG-to-M2V v1.3.zip 449.23 kB (1,014 downloads) Requirements M2V Creation - MJPEG Tools ( http://sourceforge.net/projects/mjpeg ) M2V Joining - mpgtx ( http://prdownloads.sourceforge.net/mpgtx/mpgtx.zip?download ) M2V Recoding - ffmpeg ( http://ffmpeg.zeranoe.com/builds/ ) M2V Shrinking - Requant ( http://forum.doom9.org/showthread.php?p=383217#post383217 ) Post #14 ) File Information (time & size) - MediaInfo (CLI) ( http://mediaarea.net/EN/MediaInfo ) Additional Software (for muxing) Muxing Audio & Video to DVD folder (VOB) - Muxman 0.16.8 ( http://www.videohelp.com/tools/Muxman ) Muxing Audio & Video to MKV file - MKVMerge (MKVtoolnix) ( http://www.videohelp.com/software/MKVtoolnix ) Muxing Audio & Video to M2TS file - tsMuxer ( http://www.videohelp.com/software/tsMuxeR ) P.S. Please NOTE, that this is an unfinished update, so some things are not working and some information etc is wrong. It doesn't check for remaining drive space or if the Image location might be non-writable for resized images (CD or DVD), so it can fail without advising properly ... much of that should be down to the 3rd Party programs anyway. MediaInfo Test.au3
    1 point
  13. That code you wrote works perfectly with both the mouse and touchscreen. Thanks a lot Beta! -Kenny I'm checking out the UDF too, I know I used it long ago but it used to interfere with some apps here and there. But I'm sure they worked out the kinks.
    1 point
  14. MattyD

    Connect to a WiFi SSID

    hey man, Just to clarify things: An @error value of 2 only indicates the function failed because of an API error - nothing more. The actual API error code lives in @extended - this case it will be 87 (The parameter is incorrect.) As far as notifications go, XP uses them horribly. You've probably found the only codes it supports are $WLAN_NOTIFICATION_ACM_CONNECTION_COMPLETE and $WLAN_NOTIFICATION_ACM_DISCONNECTED. This is all well and good - except in XP "connection complete" does not always men the connection is complete. After calling the connect function the "connection complete" notification will appear three times. First time it will mean "the connection has started", second time associated (i assume), and finally connected. Of course if a disconnected notification appears in the middle somewhere the next connected notification will mean "the connection has started"... It is also worth noting the disconnected notification also appears a few times when disconnecting. If you don't want to deal with all that mess - just use the wait flag when calling _Wlan_Connect() and let the UDF deal with it. #include "NativeWifi.au3" $fDebugWifi = True _Wlan_StartSession() _Wlan_StartNotificationModule() Local $oProfile, $sReason $oProfile = _Wlan_CreateProfileObject() With $oProfile .Name = "Test" .SSID.Add($oProfile.Name) .Type = "Infrastructure" .Auth = "Shared Key" .Encr = "WEP" .Key.Protected = False .Key.Type = "Network Key" .Key.Material = "MyKey" EndWith If Not _Wlan_SetProfile($oProfile, $sReason) Then MsgBox(0, "Wifi", "Failed to create profile " & $oProfile.Name & ". @error=" & @error & @CRLF & "Because: " & $sReason) Exit EndIf If _Wlan_Connect($oProfile.Name, True) Then ;the True means _Wlan_Connect will wait for the connection to either complete or fail before continuing MsgBox(0, "Wifi", "Connected to " & $oProfile.Name & ".") Else MsgBox(0, "Wifi", "Connection failed to " & $oProfile.Name & ". @error=" & @error) EndIf Hope this helps, Matt
    1 point
×
×
  • Create New...