Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/05/2023 in all areas

  1. Life's full of compromises, but I am planning to leave this in for now as it also helps me making the Click-and-Hit-rate better.
    2 points
  2. I've written a couple of functions that I use everywhere, saved them as "CustomDebugging.au3" in my includes folder, and included them in every script. The basic idea was: ; Calls Debug with a custom message. Uses '!' as a prefix to make the text red in the debugger. ; I set mine up to let SciTE jump to the right line... like you see with a compile error Func ErrMsg($sMsg = "", $iError = @error, $iExtended = @extended, $iScriptLineNum = @ScriptLineNumber) ; If there is an error, then write the error message If $iError Then ; I also added this later to simplify the function call If IsFunc($sMsg) Then $sMsg = FuncName($sMsg) Local $sText = '"' & @ScriptFullPath & '" (' & $iScriptLineNum & ',5) : (See below for message)' & @CRLF $sText &= "! Error: " & $iError & " - " If $iExtended <> 0 Then $sText &= "Extended: " & $iExtended & " - " Debug($sText & $sMsg, "") EndIf ; Preserve the error Return SetError($iError, $iExtended, $iError) EndFunc ; a wrapper around ConsoleWrite... mostly because I always forget to add a newline Func Debug($sMsg, $sPrefix = "+") If $sPrefix <> "" Then $sPrefix &= " " ConsoleWrite($sPrefix & $sMsg & @CRLF) EndFunc Func Examples() Local $aFiles = _FileListToArray(@UserProfileDir) If ErrMsg(_FileListToArray) Then Exit Debug("Found " & $aFiles[0] & " files") EndFunc I (even) later added options to write messages to a log file (the name of the log and if it should write). I did a few things right and more than a couple wrong and it's a bit of a mess now because of my refusal to fix all my old scripts. I'd suggest writing your own and making it work for you. One thing I wish I'd done differently would be to use best practices in naming my functions: _<name of include>_<function name> I'd be much easier for me to fix some of my mistakes if I'd done that. So I would've named the include Debug.au3 and renamed the functions _Debug_Debug and _Debug_ErrMsg, but with the time I saved from not writing _Debug_ so many times, I wrote this post
    2 points
  3. And a extra code pack will not help you? i usual install the mega pack from https://www.codecguide.com/download_kl.htm Of course , I don't have win11
    1 point
  4. @ioa747 It looks like you need some specific codecs to work or it's again Win 11 messed up. I use MP Classic on a daily basis to play all kinds of video files and works well but I can't play a single file with zPlayer because it complains about missing codecs.
    1 point
  5. GUICtrlCreatePic() supported types are BMP, JPG, GIF but no PNG. If you really want to use png files, you can do it like here: #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> Local $idWindow = GUICreate("Image", 400, 200) Local $cPic = GUICtrlCreatePic('', 0, 0, 400, 200) ImageToCtrl("C:\temp\image.png", $cPic) GUICtrlSetState($cPic, $GUI_DISABLE) Local $idButton_Close = GUICtrlCreateButton("Close",360,120) GUISetState(@SW_SHOW, $idWindow) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idButton_Close ExitLoop EndSwitch WEnd Func ImageToCtrl($sImage, $cCtrl) _GDIPlus_Startup() Local $hImage = _GDIPlus_ImageLoadFromFile($sImage) Local $iWidth = _GDIPlus_ImageGetWidth($hImage) Local $iHeight = _GDIPlus_ImageGetHeight($hImage) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight) Local $hGraphics = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage, 0, 0, $iWidth, $iHeight) Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _WinAPI_DeleteObject(GUICtrlSendMsg($cCtrl, 0x0172, 0, $hHBITMAP)) _WinAPI_DeleteObject($hHBITMAP) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() EndFunc
    1 point
  6. This is about UCTMan.au3 (SciTE User CallTip Manager) I installed a Portable version of Autoit alongside the installed one. I updated the system variable from SCITE_USERHOME = “% LOCALAPPDATA%\AutoIt v3\SciTE” to SCITE_HOME = “E:\AutoIt-v3D\SciTE” . I'm running the SciTE from Portable version, I press Ctrl+1 to go to configuration. In Field Auto ID 3 Folder shows folder correctly “E:\AutoIt-v3D” and in the User Include Folder field I give the location of portable included “E:\AutoIt-v3D\SciTE\SciTE_PlusBar\SciTE\CMD\.Include” . Close and reopen SciTE when I call the SciTE User CallTip Manager, In Field Include Folder shows “E:\AutoIt-v3D\SciTE\SciTE_PlusBar\SciTE\CMD\.Include” (that is OK) and “C:\Program Files (x86)\AutoIt3\Include\” Instead of “E:\AutoIt-v3D\Include\” Even though I run the Autoit from the E:\AutoIt-v3D\ folder, UCTMan looks at what is written in the windows registry while SciTE knows the correct locations as shown in the SciTEUser.properties openpath.$(au3)=$(SciteDefaultHome)\..\include;E:\AutoIt-v3D\SciTE\SciTE_PlusBar\SciTE\CMD\.Include To get it to work properly i had to replace the line Local $sAutoIt_Path = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AutoIt3.exe", "") To Local $sAutoIt_Path = @AutoItExe ;RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AutoIt3.exe", "") ; <- in the file E:\AutoIt-v3D\SciTE\SciTEConfig\UCTMan.au3 on line 57
    1 point
  7. I see what you have done working around the losing Multi Sel by saving the positions, then replacing each and then adding them back into the multi selections set. Have to have a look at that in more detail, but thanks for the idea. It all still feels strange that AutoComplete isn't working with MultiSelect in the base functionality either.
    1 point
  8. Danyfirex

    Getref [vbscript type]

    Hello, I don't have to much time to check deeply but I think your __GetRef is returning IDispatch callback but IDownload callback are IUnknown. Saludos
    1 point
×
×
  • Create New...