21 posts in this topic
[Solved] Calculate/Compare Functions speed ?
I've these two functions to do a base64 conversation , Is there any way to compare the exact speed of both of them ?
Func _Base64Encode($input) $input = Binary($input) Local $struct = DllStructCreate("byte[" & BinaryLen($input) & "]") DllStructSetData($struct, 1, $input) Local $strc = DllStructCreate("int") Local $a_Call = DllCall("Crypt32.dll", "int", "CryptBinaryToString", _ "ptr", DllStructGetPtr($struct), _ "int", DllStructGetSize($struct), _ "int", 1, _ "ptr", 0, _ "ptr", DllStructGetPtr($strc)) If @error Or Not $a_Call Then Return SetError(1, 0, "") ; error calculating the length of the buffer needed EndIf Local $a = DllStructCreate("char[" & DllStructGetData($strc, 1) & "]") $a_Call = DllCall("Crypt32.dll", "int", "CryptBinaryToString", _ "ptr", DllStructGetPtr($struct), _ "int", DllStructGetSize($struct), _ "int", 1, _ "ptr", DllStructGetPtr($a), _ "ptr", DllStructGetPtr($strc)) If @error Or Not $a_Call Then Return SetError(2, 0, ""); error encoding EndIf Return DllStructGetData($a, 1) EndFunc ;==>_Base64Encode
Func _Base64Encode($sData) Local $oXml = ObjCreate("Msxml2.DOMDocument") If Not IsObj($oXml) Then SetError(1, 1, 0) EndIf Local $oElement = $oXml.createElement("b64") If Not IsObj($oElement) Then SetError(2, 2, 0) EndIf $oElement.dataType = "bin.base64" $oElement.nodeTypedValue = Binary($sData) Local $sReturn = $oElement.Text If StringLen($sReturn) = 0 Then SetError(3, 3, 0) EndIf Return $sReturn EndFunc ;==>_Base64Encode
List of HotKeySets
I have written a programm offering me a lot of hotkeys to work with windows. All in all there are 40 hotkeys defined now.
Now I made a portable version of it. But in this there are a lot of hotkeys useless. So I had to change some things. But that's not my point.
Because of all these many hotkeys I sometimes know I made a hotkey but what were the keys I have to press.
So I want to make a little help GUI or html or whatever. Now I'm interested to automate my own list of hotkeys.
How can I collect all my hotkeys and necessary keys for this in a list?
How to enable a window?
Hello all I am trying to use this function to detect if a specific window is running. Then for it to activate it and send an ALT+F command to close the window. But I cannot seem to get it to detect the window and subsequently the rest of the code does not work.
#include <MsgBoxConstants.au3> Handleit() Func Handleit() If WinExists("[CLASS:MsiDialogCloseClass]","InstallShield") Then WinActivate("[CLASS:MsiDialogCloseClass]","Installshield") Send("!f") Else MsgBox($MB_SYSTEMMODAL, "", "Uhhh... something didn't work. Fix it!") EndIf EndFunc Is there anything that I can substitute for the CLASS?
Thank you for taking the time to read my question!
Check if recycle bin has files inside?
Hello reader, I would like to know if and/or how it is possible to check if recycle bin has files or folders in it.
So my code would eventually be like this (if these were the commands)
if fileshere then FileRecycleEmpty() ;empties recylce bin endif
(SOLVED)Calling Function That Calls Original Function
How would I get this code to work? If not possible/If there is a better way... How would I do it? I can't seem to get it to work properly...
Func Go() ;Do stuff Re-Go() EndFunc Func Re-Go() Go() EndFunc