Leaderboard
Popular Content
Showing content with the highest reputation on 02/01/2024 in all areas
-
autoit error - (Moved)
SOLVE-SMART reacted to Jos for a topic
Yes ... and again forgot to think before posting! It was already moved so do not create a new topic but stick to it !!! Merged. Also cleaned up the garbage in your post, so from here on please keep them clean and readable or else your topics will simply be locked.1 point -
autoit error - (Moved)
Musashi reacted to SOLVE-SMART for a topic
To be honest @serena_knight, your question is more than weak. Sorry but please notice that your attachment isn't valid and your code snippet does not provide helpful information. I suggest: Try to rephrase your question, add additional information and you will might see a helpful community. Best regards Sven1 point -
queensoft, I think I have it working properly now. You have to redeclare the user-defined function when you reload the ListView as the "function as object" cannot be stored in the text format file used to store the ListView data. So you need to do this: Case $b05 $f01 = FileOpenDialog('Load tasks list', @ScriptDir, 'Text files (*.txt)', 1+2) if $f01<>'' Then _GUIListViewEx_LoadListView($iLV_Left_Index, $f01) _GUIListViewEx_SetEditStatus($iLV_Left_Index, '2', 9, $mousefunc) _GUIListViewEx_SetEditStatus($iLV_Left_Index, '3', 9, $mousefunc) EndIf And use this Beta of the UDF: GUIListViewEx_Combined.au3 Please let me know if it works for you too. M231 point
-
queensoft, The problem is caused because there are 2 columns calling a user-defined function. When the ListView is saved they do not store correctly and corrupt the data file and its subsequent loading. This happens because when I wrote the load/save functions editing by using a user-defined function was not an option - I will look into how to get the load/save functions to play nicely now that it is. M231 point
-
queensoft, 1. There is no way to "pre-check" an input - you have to look at the new value in the return from the _EventMonitor function and if it is not to your liking reset the previous value (which is also in the return) using the _ChangeItem function. And you should be able to set a combo to be read only: ; Name...........: _GUIListViewEx_SetEditStatus ; Description ...: Sets edit on doubleclick mode for specified column(s) ; Syntax.........: _GUIListViewEx_SetEditStatus($iLV_Index, $vCol [, $iMode = 1 , $vParam1 = Default [, $vParam2 = Default]]]) ; Parameters ....: [...] ; $iMode - 2 = Editable using combo ; $vParam1 = Content of combo - either delimited string or 0-based array ; $vParam2 = 0: editable combo (default); 1: readonly ; + 2 - Combo list automatically drops down on edit Please let me know if that is not working. 2. The UDF does not support icons, sorry. M231 point
-
Try this workaround: #include <Word.au3> #include "WordConstants.au3" #include <GDIPlus.au3> #include <Clipboard.au3> _GDIPlus_Startup() Global $hBitmapGDI = _GDIPlus_BitmapCreateFromMemory(_Base64String()) Global $bPNG = _GDIPlus_StreamImage2BinaryString($hBitmapGDI) $iFormat_PNG = _ClipBoard_RegisterFormat("PNG") _ClipBoard_Open(0) _ClipBoard_Empty() $iSize = BinaryLen($bPNG) $hMemory = _MemGlobalAlloc($iSize, $GHND) $hLock = _MemGlobalLock($hMemory) $tData = DllStructCreate("byte png[" & $iSize & "]", $hLock) $tData.png = Binary($bPNG) _MemGlobalUnlock($hMemory) MsgBox(0, "Copy Image as PNG to clipboard", _ "Clipboard handle: " & _ClipBoard_SetDataEx($hMemory, $iFormat_PNG)) _MemGlobalFree($hMemory) _GDIPlus_ImageDispose($hBitmapGDI) _GDIPlus_Shutdown() Exit Func _GDIPlus_StreamImage2BinaryString($hBitmap, $sFormat = "PNG", $iQuality = 80, $bSave = False, $sFilename = @ScriptDir & "\Converted.jpg") ;coded by UEZ 2013 build 2014-01-25 Local $sImgCLSID, $tGUID, $tParams Switch $sFormat Case "JPG" $sImgCLSID = _GDIPlus_EncodersGetCLSID($sFormat) $tGUID = _WinAPI_GUIDFromString($sImgCLSID) Local $tData = DllStructCreate("int Quality") DllStructSetData($tData, "Quality", $iQuality) ;quality 0-100 Local $pData = DllStructGetPtr($tData) $tParams = _GDIPlus_ParamInit(1) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) Case "PNG", "BMP", "GIF", "TIF" $sImgCLSID = _GDIPlus_EncodersGetCLSID($sFormat) $tGUID = _WinAPI_GUIDFromString($sImgCLSID) Case Else Return SetError(1, 0, 0) EndSwitch Local $hStream = _WinAPI_CreateStreamOnHGlobal() ;http://msdn.microsoft.com/en-us/library/ms864401.aspx If @error Then Return SetError(2, 0, 0) _GDIPlus_ImageSaveToStream($hBitmap, $hStream, DllStructGetPtr($tGUID), DllStructGetPtr($tParams)) If @error Then Return SetError(3, 0, 0) Local $hMemory = _WinAPI_GetHGlobalFromStream($hStream) ;http://msdn.microsoft.com/en-us/library/aa911736.aspx If @error Then Return SetError(4, 0, 0) Local $iMemSize = _MemGlobalSize($hMemory) If Not $iMemSize Then Return SetError(5, 0, 0) Local $pMem = _MemGlobalLock($hMemory) $tData = DllStructCreate("byte[" & $iMemSize & "]", $pMem) Local $bData = DllStructGetData($tData, 1) _WinAPI_ReleaseStream($hStream) ;http://msdn.microsoft.com/en-us/library/windows/desktop/ms221473(v=vs.85).aspx _MemGlobalFree($hMemory) If $bSave Then Local $hFile = FileOpen($sFilename, 18) If @error Then Return SetError(6, 0, $bData) FileWrite($hFile, $bData) FileClose($hFile) EndIf Return $bData EndFunc ;==>_GDIPlus_StreamImage2BinaryString Func _Base64String($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Base64String $Base64String &= 'm7MAiVBORw0KGgoAAAAADUlIRFIlAHBkARgIBgAocOIElVQAGAlwSFlzEAAACxIBDAHS3QB+/AAAA3RJRABBVHgB7ZsxbwDTUBSFDWKq1ACVSmwMwNof0ACNhQXGDsxIlQC6UcHGPwC1WwAlpM79AbCwsADxA7oCAxsSWQCROnM+iFOSWgCJRJN3bsq50gBVHDt59/g79gDzs/PSdYkQCAKBQgJ1JnCjvPgAvcMhidta+UAAeUe5Of7AT70Afld+Vp6N13UA3duDyeI6LKwAiyEbgvlU+UQA+VDJ+3lxro0AH5XvlKdK3g8ARzHD/IYMnwEAPbzbWnip3FcALjKh/87sK2YAHCtfK0ezG6sAnUE3Lwmss+IAuaR8U75Q/qsAGewN36UN2qIAzdJR0RDOCroAGi4eVzFiFjwAbdEmbVOjZFQAM4SL9Sfl4xUA0qJtalCrXFQAMgRAH5T3GlAAoga1yplS5aIAThfCUdvCDJUAmcRXLe0oR5MANf2CafRV5QwAORGH1maAnpoA1C4TFQxh5LMAymvGItjULjMA+mrfZU3fd9AAVTEcXeZoapEAAUPbz7XyrvIAouv6T7ssbvoA3GZgEBrQYg8AZ5cFhH07gQsAAWhBkzWchvBAbMoO4C/6BAagALBa2DU5DeGpAG21sGtyGcIdAHKl7qo/MNBkAL17dxnCj0tVAOO+U5jLEH7pAKsaVm0uQzarCLohXQECCvvhlQDmMoQJCVXDqgDNZQizQ6qGVQCbyxCm6lSNLwBOYS5DzrTTPABhrRZoQpstXACGsMPMm6oWdgBNTkOY/VEt7ACanIbMn1HY3gAquis0WcNpCAAAjq17P10cLQBosobTEHac6QCddghjDWixxwCt5gqmf6sedQB7h6+kgRmFzgBAw8gpoK/tPgBD0HGkfN8LMgC8UhsNJaKCIQCAeKZk0lrroAAmtctE+y5reADX6S52lUzv3AAa/sjS1/5QiwC7+jtCia6q3wC7' $Base64String &= 'KmcIerhDfgCkbHGmUINa1gC7ctW/FJUMQQAcgHaUq7ym0AA2NcqZIU1dNQBD0EQXwuyPAwDlMofEtEWbtABdqpuSnklUNACkF8fIh+mdbwCUVzGG79IGbQCVGU1Jy2C0nwDbOyhjzso/cwCBN/QJJrFxdABf6z99VhllzQBx5PcmjvKTcQCyYlt5Lf8WzSDOJUIgBLkA/AQAfgGdGnQnr6IELMkA5QBJRU5EAK5CYII=' $Base64String = _WinAPI_Base64Decode($Base64String) If @error Then Return SetError(1, 0, 0) Local $tSource = DllStructCreate('byte[' & BinaryLen($Base64String) & ']') DllStructSetData($tSource, 1, $Base64String) Local $tDecompress _WinAPI_LZNTDecompress($tSource, $tDecompress, 962) If @error Then Return SetError(3, 0, 0) $tSource = 0 Local Const $bString = Binary(DllStructGetData($tDecompress, 1)) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Test.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Base64String Func _WinAPI_Base64Decode($sB64String) Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "") Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]") $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "") Return DllStructGetData($bBuffer, 1) EndFunc ;==>_WinAPI_Base64Decode Func _WinAPI_LZNTDecompress(ByRef $tInput, ByRef $tOutput, $iBufferSize) $tOutput = DllStructCreate("byte[" & $iBufferSize & "]") If @error Then Return SetError(1, 0, 0) Local $aRet = DllCall("ntdll.dll", "uint", "RtlDecompressBuffer", "ushort", 0x0002, "struct*", $tOutput, "ulong", $iBufferSize, "struct*", $tInput, "ulong", DllStructGetSize($tInput), "ulong*", 0) If @error Then Return SetError(2, 0, 0) If $aRet[0] Then Return SetError(3, $aRet[0], 0) Return $aRet[6] EndFunc ;==>_WinAPI_LZNTDecompress It converts the image to a PNG image in the memory to put it to the clipboard afterwards. I tested it with MS Word and it worked properly.1 point
-
autoit error - (Moved)
SOLVE-SMART reacted to serena_knight for a topic
i really dont know what else to say this code is a vbscript converted to autoit script in order to obtain the varable $nothing which can be used in the body of whole script this part of the listed script fails for some users but not others i.e. there is nothing wrong with the coding there has to be some kind of missing componet on the computer of those users getting the error. i had thought maybe someone may have experienced this specifc error before. one user had the problem then reinstalled autoit and now that user had no problem. Global $oVbs = ObjCreate('MSScriptControl.ScriptControl') ;Local $oVBS = ObjCreate("ScriptControl") $oVBS.language = "VBScript" Global Const $Nothing = $oVBS.eval("Nothing") $oVBS = $Nothing0 points