Jump to content

UEZ

MVPs
  • Posts

    7,322
  • Joined

  • Last visited

  • Days Won

    77

UEZ last won the day on June 1

UEZ had the most liked content!

About UEZ

  • Birthday 12/03/2007

Profile Information

  • Member Title
    Never say never
  • Location
    Germany
  • Interests
    Computer, watching movies, football (soccer), being lazy :-)

Recent Profile Visitors

9,211 profile views

UEZ's Achievements

  1. Update to: WebP v0.3.3 build 2025-06-04 beta Updated WebP x64 dll to latest version Added decoding code for animated WebP files for boths DLLs -> see Example6 and Example7 See first post for download link.
  2. Try: #include <WinAPISys.au3> $t = _WinAPI_GetStartupInfo() $tP = DllStructCreate("wchar title[255]", $t.Title) ConsoleWrite($tP.title & @CRLF) I was too slow...
  3. @KaFu what do you want to achieve?
  4. You are right. What about: Local $tBuffer = DllStructCreate("handle buffer") ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms682485(v=vs.85).aspx Local $a_hCall = DllCall("kernel32.dll", "bool", "CreateTimerQueueTimer", _ "struct*", $tBuffer, _ "handle", 0, _ "ptr", DllCallbackGetPtr($hCallback), _ "ptr", Null, _ "dword", 100, _ "dword", 150, _ "ulong", 0) ... Local $a_hCall = DllCall("kernel32.dll", "bool", "DeleteTimerQueueTimer", _ "handle", 0, _ "handle", $tBuffer.buffer, _ "handle", 0) Forget: it still doesn't seem to be stable.
  5. No issues with Freebasic: #include "windows.bi" #include "win/winbase.bi" Sub WoTCallback(LPARAM As LPARAM, TimerOrWaitFired As BOOL) ? LPARAM, TimerOrWaitFired End Sub Dim As PHANDLE phNewTimer Dim As HANDLE hTQ = CreateTimerQueue() CreateTimerQueueTimer(@phNewTimer, hTQ, Cast(WAITORTIMERCALLBACK, @WoTCallback), 0, 100, 100, WT_EXECUTEDEFAULT) Dim As Double t = Timer While 1 If Timer - t > 5 Then ? !"Exit loop" DeleteTimerQueueTimer(hTQ, phNewTimer, 0) CloseHandle(phNewTimer) Exit While End If Sleep(10) Wend Sleep Seems to be an issue with Autoit. Edit: Local $a_hCall = DllCall("kernel32.dll", "bool", "CreateTimerQueueTimer", _ "struct*", $tBuffer, _ "handle", $a_h_CreateTimerQueue[0], _ "ptr", DllCallbackGetPtr($hCallback), _ "ptr", Null, _ "dword", 5000, _ "dword", $i_TimerQueue_Repeat_after, _ "ulong", 0) This seems to be stable.
  6. Same issue on my Win11 system when running it as x86. With x64 it works. Edit: confirm
  7. Is there a way to check if visible GUI is in dark mode? Edit: this seems to work: ;Coded by UEZ build 2025-05-14 #include <AutoItConstants.au3> #include <StringConstants.au3> #include <WinAPISysWin.au3> Const $DWMWA_USE_IMMERSIVE_DARK_MODE = @OSBuild < 18362 ? 19 : 20 Func _WinAPI_IsWindowDarkMode($hWnd) Local $value = DllStructCreate("int dm") Local $ret = DllCall("dwmapi.dll", "long", "DwmGetWindowAttribute","hwnd", $hWnd, "uint", $DWMWA_USE_IMMERSIVE_DARK_MODE, "struct*", $value, "uint", DllStructGetSize($value)) If @error Or $ret[0] <> 0 Then Return 0 Return $value.dm <> 0 EndFunc Global $aWinList = WinList(), $i, $iStatus For $i = 1 To $aWinList[0][0] If _WinAPI_IsWindowVisible($aWinList[$i][1]) Then If IsHWnd($aWinList[$i][1]) Then $iStatus = _WinAPI_IsWindowDarkMode($aWinList[$i][1]) ConsoleWrite($aWinList[$i][1] & ": " & $iStatus & " -> " & StringRegExpReplace($aWinList[$i][0], "[\r\n]+", "") & @CRLF) EndIf EndIf Next
  8. Nice work. It crashes for x64 just after displaying GUI : (609,0) IsObj($oIMFMediaEngineNotify) = 1 (648,0) Fact.CreateInstance(), hr = 0x00000000 (650,0) IMFEngine Created = True Test a few notifications.... Event: 22 >, Volume Change, Vol: 1.000000, Muted: True Event: 22 >, Volume Change, Vol: 1.000000, Muted: False Event: 1001 > Purge Queued Events Event: 1 > P1: 0, P2 0 (663,0) $oIMFEngine.SetSource hresult = 0x00000000 Event: 1001 > Purge Queued Events Event: 4 > P1: 0, P2 0 Event: 6 > Emptied Event: 1 > P1: 0, P2 0 (665,0) $oIMFEngine.Load hresult = 0x00000000 Event: 8 > Play Event: 12 > Waiting (667,0) $oIMFEngine.Play hresult = 0x00000000 Event: 21 > P1: 0, P2 0 Event: 10 > P1: 0, P2 0 Event: 11 > P1: 0, P2 0 Event: 14 > CanPlay Event: 15 > P1: 0, P2 0 Event: 18 > Time Update Event: 1000 > P1: 0, P2 0 Event: 1009 > P1: 0, P2 0 Event: 18 > Time Update Event: 18 > Time Update Event: 13 > Playing Event: 18 > Time Update !>09:52:06 AutoIt3.exe ended.rc:-1073741819 -1073741819 / 0xC0000005: An Access Violation is a type of Exception caused when an application Reads, Writes or Executes an invalid Memory Address. x86: it starts but get frozen after 1 sec and crashes with same error as for x64.
  9. Something like this here: #include <Array.au3> #include <Constants.au3> #include <WindowsConstants.au3> #include <SendMessage.au3> #include <WinAPISysWin.au3> #include <WinAPIGdi.au3> #include <WinAPIShellEx.au3> Global Const $WM_NOTIFYICON = $WM_USER + 1 Global Const $sWinTitle = "TrayExample" AutoItWinSetTitle($sWinTitle) Opt("TrayMenuMode", 3) Global $hHWND = WinGetHandle($sWinTitle) Global $hTaskbar = WinGetHandle("[CLASS:Shell_TrayWnd]") Global $hTray Example() Func Example() Local $idAbout = TrayCreateItem("About") TrayCreateItem("") Local $idExit = TrayCreateItem("Exit") HotKeySet("{F9}", ShowTrayMenu) $a = _WinAPI_EnumChildWindows($hTaskbar) $iPos = _ArraySearch($a, "TrayNotifyWnd", 0, 0, 0, 0, 1, 1) If Not @error Then $hTray = $a[$iPos][0] EndIf While True Switch TrayGetMsg() Case $idExit ExitLoop Case $idAbout MsgBox($MB_SYSTEMMODAL, "About", "AutoIt tray menu example." & @CRLF & @CRLF & _ "Version: " & @AutoItVersion & @CRLF & _ "Install Path: " & StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1) - 1)) EndSwitch If CheckMouseOverTrayIcon() = 1 And WinExists("[CLASS:#32768]") = 0 Then ShowTrayMenu() WEnd EndFunc ;==>Example Func ShowTrayMenu() _SendMessage($hHWND, $WM_NOTIFYICON, 0, $WM_LBUTTONDOWN) EndFunc ;==>ShowTrayMenu Func CheckMouseOverTrayIcon() Local $tNID = DllStructCreate("dword cbSize;hwnd hWnd;uint uID;uint uFlags") Local $hTrayWnd = _WinAPI_GetShellWindow() If $hTrayWnd = 0 Then Return -1 DllStructSetData($tNID, "cbSize", DllStructGetSize($tNID)) DllStructSetData($tNID, "hWnd", $hTray) DllStructSetData($tNID, "uID", 1) Local $tRECT = _WinAPI_ShellNotifyIconGetRect(WinGetHandle(AutoItWinGetTitle()), 1) If @error Then Return -2 Local $aPos = _WinAPI_GetPosFromRect($tRECT) Local $aMousePos = MouseGetPos() If $aMousePos[0] >= $aPos[0] And $aMousePos[0] <= $aPos[0] + $aPos[2] And $aMousePos[1] >= $aPos[1] And $aMousePos[1] <= $aPos[1] + $aPos[3] Then Return 1 EndIf Return 0 EndFunc ;==>CheckMouseOverTrayIcon Will work properly when icon is visible on the taskbar. Tested on Win11 24H2.
  10. Maybe you can test singleton using Atom.
  11. Just wondering why API call is different when using Freebasic: 'Coded by UEZ build 2025-03-29 #include "windows.bi" 'https://learn.microsoft.com/de-de/windows/win32/api/winbase/nf-winbase-createsemaphorea Function _WinAPI_CreateSemaphore(sOccurrenceName As String, InitCount As Long = 0, MaxCount As Long = 1) As HANDLE Dim As HANDLE hSemaphore = CreateSemaphore(NULL, InitCount, MaxCount, sOccurrenceName) If GetLastError() = ERROR_ALREADY_EXISTS Then Return 0 If hSemaphore = 0 Then Return -1 Return hSemaphore End Function Dim As HANDLE hSemaphore = _WinAPI_CreateSemaphore("1a2b3c4d5e6f") If hSemaphore = 0 Then End MessageBox(0, "An occurrence of this app (x64 or x86) is already running! Exiting...", "ERROR", MB_OK Or MB_ICONSTOP Or MB_TOPMOST) MessageBox(0, "Started", "Information", MB_OK Or MB_TOPMOST Or MB_ICONINFORMATION) If hSemaphore > 0 Then ReleaseSemaphore(hSemaphore, 1, NULL) CloseHandle(hSemaphore) End If In FB I call the CreateSemaphore with the key whereas in Autoit the first call is empty. Any other call with the compiled exe regardless if it is x86 or x64 it will show the MsgBox.
  12. Hi KaFu, I now have a new notebook and have not looked into the problem since then because it works with ioa747's suggestion. Maybe I will make some tests. Btw, I have no problems with the CreateSemaphore code from post#1. Edit: still same problem with x86. #AutoIt3Wrapper_UseX64=n ShellExecute("C:\Users\Public\Desktop\Adobe Acrobat.lnk")
  13. Skinning the cat makes it ugly. 😉 _WinAPI_SetLayeredWindowAttributes($hGUI_Child, 0x123456, 0x60) makes the child GUI transparent, too.
  14. Use child GUI: ... Global Const $SC_DRAGMOVE = 0xF012 Global $iW = 300, $iH = 100, $hHBitmap Global $hGUI = GUICreate("Parent", $iW, $iH, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)), _ $hGUI_Child = GUICreate("", 30, 20, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hGUI) Global $hButton = GUICtrlCreateButton("Test", 0, 0, 30, 20) GUICtrlSetBkColor($hButton, 0x000000) GUICtrlSetColor($hButton, 0x00FF00) GUISetBkColor(0x123456, $hGUI_Child) _WinAPI_SetLayeredWindowAttributes($hGUI_Child, 0x123456) GUISetState(@SW_SHOW, $hGUI_Child) GUISetState(@SW_SHOW, $hGUI) ...
×
×
  • Create New...