Jump to content

KaFu

MVPs
  • Posts

    3,958
  • Joined

  • Last visited

  • Days Won

    15

KaFu last won the day on October 26 2024

KaFu had the most liked content!

About KaFu

  • Birthday 09/06/1974

Profile Information

  • Member Title
    Hey, it's just me, KhaFoo...
  • Location
    Germany, Hamburg
  • WWW
    https://funk.eu

Recent Profile Visitors

8,013 profile views

KaFu's Achievements

  1. This opens a new tab in a running FireFox instance for me. ShellExecute(@ProgramFilesDir & '\Mozilla Firefox\firefox.exe', 'https://www.google.com/search?q=AutoIt', '', 'open')
  2. This is what I posted in MVP. Helpfile for Iniwrite() says this: If you want to use an ini file with Unicode encoding, first create an .ini file by using the FileOpen() function with the mode parameter set to a Unicode parameter. Fyi, here's my standard approach to this: If Not FileExists(@ScriptDir & "\_cache\") Then DirCreate(@ScriptDir & "\_cache\") Func _Ini_Initialization($sFile, $sSectioName)     If FileExists($sFile) Then Return     Local $h_file = FileOpen($sFile, 2 + 32) ; 32 = Use Unicode UTF16 Little Endian reading and writing mode.     FileWrite($h_file, $sSectioName & @CRLF) ; you need to write something     FileClose($h_file) EndFunc   ;==>_Ini_Initialization _Ini_Initialization(@ScriptDir & "\_cache\_MPV-Enhancer.ini", "[Settings]")
  3. Can't see an issue (like in: it crashes for me too, but I don't no why either). Maybe it's related to the InitRegionCapture() function itself? Maybe Freebasic captures something AutoIt doesn't, like freeing resources?
  4. Their seems to be an error in ASM_DecompressLZMAT(), script crashes at that point and I can't create the dll.
  5. The result of calling ShellExecute() with only the URL as a parameter depends on which default browser you have installed. This works fine for me with FireFox installed on an x64 system. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** $sFile = FileRead(@ScriptDir & "\URL_Links.txt") $aLines = StringSplit($sFile, @CRLF, 1) For $i = 1 To $aLines[0] ShellExecute(@ProgramFilesDir & '\Mozilla Firefox\firefox.exe', $aLines[$i], '', 'open') Next
  6. Maybe something like this? https://learn.microsoft.com/en-us/windows/win32/shell/context-menu-handlers Edit: And in SMF I use something like this for optional shell integration. RegWrite("HKEY_CURRENT_USER\Software\Classes\Directory\shell\Search with SMF", "Icon", "REG_EXPAND_SZ", """" & @ScriptFullPath & """") RegWrite("HKEY_CURRENT_USER\Software\Classes\Directory\shell\Search with SMF\command", "", "REG_SZ", """" & @ScriptFullPath & """ ""%l""") RegWrite("HKEY_CURRENT_USER\Software\Classes\Drive\shell\Search with SMF", "Icon", "REG_EXPAND_SZ", """" & @ScriptFullPath & """") RegWrite("HKEY_CURRENT_USER\Software\Classes\Drive\shell\Search with SMF\command", "", "REG_SZ", """" & @ScriptFullPath & """ ""%l""") RegWrite("HKEY_CURRENT_USER\Software\Classes\Directory\shell\Search with SMF for duplicate files", "Icon", "REG_EXPAND_SZ", """" & @ScriptFullPath & """") RegWrite("HKEY_CURRENT_USER\Software\Classes\Directory\shell\Search with SMF for duplicate files\command", "", "REG_SZ", """" & @ScriptFullPath & """ ""%l -duplicates""") RegWrite("HKEY_CURRENT_USER\Software\Classes\Drive\shell\Search with SMF for duplicate files", "Icon", "REG_EXPAND_SZ", """" & @ScriptFullPath & """") RegWrite("HKEY_CURRENT_USER\Software\Classes\Drive\shell\Search with SMF for duplicate files\command", "", "REG_SZ", """" & @ScriptFullPath & """ ""%l -duplicates""") and this in ICU for integration into desktop context menu RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\shell\ICU_ContextMenu_Anchor", "MUIVerb", "REG_SZ", "ICU") RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\shell\ICU_ContextMenu_Anchor", "Position", "REG_SZ", "Bottom") RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\shell\ICU_ContextMenu_Anchor", "Icon", "REG_EXPAND_SZ", @ScriptFullPath & ",0") RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\shell\ICU_ContextMenu_Anchor", "ExtendedSubCommandsKey", "REG_SZ", "DesktopBackground\ContextMenus\ICU") RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\ContextMenus\ICU\Shell\001_ICU", "Icon", "REG_EXPAND_SZ", "shell32.dll,-22") RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\ContextMenus\ICU\Shell\001_ICU", "MUIVerb", "REG_SZ", "Open ICU Settings") RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\ContextMenus\ICU\Shell\001_ICU\command", "", "REG_EXPAND_SZ", @ScriptFullPath) RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\ContextMenus\ICU\Shell\002_ICU", "Icon", "REG_EXPAND_SZ", "shell32.dll,-7") RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\ContextMenus\ICU\Shell\002_ICU", "MUIVerb", "REG_SZ", "Save Desktop Layout") RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\ContextMenus\ICU\Shell\002_ICU", "CommandFlags", "REG_DWORD", 0x040) ; ECF_SEPARATORAFTER RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\ContextMenus\ICU\Shell\002_ICU\command", "", "REG_EXPAND_SZ", @ScriptFullPath & " save")
  7. Excellent, does not crash for me too 👍.
  8. This call is crashing the script for me: Local $oObj = ObjCreateInterface($pObj, $sIID_IAccessible, $tagIAccessible)
  9. I think that's the goal, but anyone using _WinAPI_SetWinEventHook() in the first place would prefer a more complex and thorough example (at least I would). Your example above detects the popup on my Win10, but when I go over the popup the script hard-crashes.
  10. The code I posted above makes the GUI a child of the desktop (sticky) and even allows a click-through on the Icons (tested on Win10 and Win11). Maybe make it 99% transparent and additionally use a wall paper for the background design?
  11. This works on my Win10 machine. #include <GUIConstantsEx.au3> #include <WinApi.au3> #include <WindowsConstants.au3> Global $hDeskWin = _WinGetDesktopHandle() Global $h_Desktop_SysListView32 = HWnd(@extended) Main() Func Main() Local $this = GUICreate("", 400, 400, @DesktopWidth - (400) - 20, 100, $WS_POPUP, $WS_EX_NOACTIVATE + $WS_EX_TRANSPARENT) _WinAPI_SetParent($this, $h_Desktop_SysListView32) Local $iPic = GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg", 0, 0, 400, 400) ;GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) WinSetTrans($this, "", 200) _GuiRoundCorners($this, 16, 16) _WinAPI_SetWindowLong($this, $GWL_HWNDPARENT, ControlGetHandle("[CLASS:Progman]", "", "SysListView321")) ;hide in taskbar GUISetState(@SW_SHOWNOACTIVATE, $this) ;_WinAPI_SetWindowPos($this, $HWND_BOTTOM, Default, Default, Default, Default, BitOR($SWP_NOACTIVATE, $SWP_SHOWWINDOW, $SWP_NOMOVE, $SWP_NOSIZE )) ;not worked While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($this) EndFunc ;==>Main Func _GuiRoundCorners($h_win, $ixR, $iyR) Local $aPos = WinGetPos($h_win) If @error Then Return 0 Local $iW = $aPos[2] Local $iH = $aPos[3] Local $hRgn = _WinAPI_CreateRoundRectRgn(0, 0, $iW, $iH, $ixR, $iyR) _WinAPI_SetWindowRgn($h_win, $hRgn) EndFunc ;==>_GuiRoundCorners ; http://www.autoitscript.com/forum/topic/119783-desktop-class-workerw/page__view__findpost__p__903081 ; =============================================================================================================================== ; <_WinGetDesktopHandle.au3> ; ; Function to get the Windows' Desktop Handle. ; Since this is no longer a simple '[CLASS:Progman]' on Aero-enabled desktops, this method uses a slightly ; more involved method to find the correct Desktop Handle. ; ; Author: Ascend4nt, credits to Valik for pointing out the Parent->Child relationship: Desktop->'SHELLDLL_DefView' ; =============================================================================================================================== ; Example use: #cs #include <GuiListView.au3> $iTimer = TimerInit() $hDeskWin = _WinGetDesktopHandle() $hListView = HWnd(@extended) ConsoleWrite("Time elapsed:" & TimerDiff($iTimer) & " ms" & @CRLF) $iDeskItems = _GUICtrlListView_GetItemCount($hListView) ConsoleWrite("Handle to desktop: " & $hDeskWin & ", Title: '" & WinGetTitle($hDeskWin) & "', Handle to Listview: " & $hListView & ", # Items:" & $iDeskItems & ", Title: " & WinGetTitle($hListView) & @CRLF) MsgBox(0, "Desktop handle (with ListView) found", "Handle to desktop: " & $hDeskWin & ", Title: '" & WinGetTitle($hDeskWin) & "'," & @CRLF & "Handle to Listview: " & $hListView & @CRLF & "# Desktop Items:" & $iDeskItems) #ce Func _WinGetDesktopHandle() Local $i, $hDeskWin, $hSHELLDLL_DefView, $hListView ; The traditional Windows Classname for the Desktop, not always so on newer O/S's $hDeskWin = WinGetHandle("[CLASS:Progman]") ; Parent->Child relationship: Desktop->SHELLDLL_DefView $hSHELLDLL_DefView = ControlGetHandle($hDeskWin, '', '[CLASS:SHELLDLL_DefView; INSTANCE:1]') ; No luck with finding the Desktop and/or child? If $hDeskWin = '' Or $hSHELLDLL_DefView = '' Then ; Look through a list of WorkerW windows - one will be the Desktop on Windows 7+ O/S's $aWinList = WinList("[CLASS:WorkerW]") For $i = 1 To $aWinList[0][0] $hSHELLDLL_DefView = ControlGetHandle($aWinList[$i][1], '', '[CLASS:SHELLDLL_DefView; INSTANCE:1]') If $hSHELLDLL_DefView <> '' Then $hDeskWin = $aWinList[$i][1] ExitLoop EndIf Next EndIf ; Parent->Child relationship: Desktop->SHELDLL_DefView->SysListView32 $hListView = ControlGetHandle($hSHELLDLL_DefView, '', '[CLASS:SysListView32; INSTANCE:1]') If $hListView = '' Then Return SetError(-1, 0, '') Return SetExtended($hListView, $hDeskWin) EndFunc ;==>_WinGetDesktopHandle
  12. Upsa, that was not about the flicker at all 🙂. For that I learned that input controls do not flicker as labels do, maybe the update of these is slower? #include <GUIConstantsEx.au3> #include <GuiEdit.au3> #include <WindowsConstants.au3> HotKeySet("{ESC}","_Exit") GUICreate("Example") $c_Label = GUICtrlCreateLabel("",10,10,100,20) $c_Input = GUICtrlCreateInput("",10,40,100,20, $ES_READONLY, $WS_EX_TRANSPARENT) GUISetState(@SW_SHOW) While Sleep(10) $iTimer = TimerInit() GUICtrlSetData($c_Label,$iTimer) GUICtrlSetData($c_Input,$iTimer) WEnd Func _Exit() Exit EndFunc
  13. Create a simple GUI like this and let it run. GUICreate("Debugger_Output_GUI", 400, 200) GUICtrlCreateEdit("", 10, 10, 380, 180) GUISetState() While 1 Switch GUIGetMsg() Case -3 ; $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd In the script to debug add trace lines in SciTE via "Tools > Trace: Add Trace Lines". Search and replace ConsoleWrite('>Error code: ' & @error & @CRLF & @CRLF & '@@ Trace( with ControlSetText('Debugger_Output_GUI', '', 'Edit1', '>Error code: ' & @error & @CRLF & @CRLF & '@@ Trace( in your code and then run it.
  14. Hi Jos, a feature request for SciTE from my side. When I run code in SciTE, all entries under "Tools" except the last 5 are greyed out. Would it be possible to leave those enabled, which do not interfere with the current code execution? Especially for running "AU3Info" I don't know how many times I had to abort the current execution, start AU3Info and then run the code again 🙂, because I forgot to start AU3Info early. Maybe it makes sense to leave some others enabled too, e.g. Open Explorer in Scriptdir, Codewizard and Koda? Best Regards
  15. For x64: There's a conversion error, is the Int datatype hardcoded in the x64 opcode? The best template from the AHK guys for variable parameters in the opcode seems to be in this post: https://www.autohotkey.com/boards/viewtopic.php?p=594011#p594011 Edit: Would it be a quick (and dirty) solution to set both parameters as ptr in the opcode? By default 4-byte in x86 and 8-byte in x64?
×
×
  • Create New...