fraizor Posted August 31, 2023 Share Posted August 31, 2023 Hello i have this code that monitors the clipboard but it needs an GUI ... $gui = GUICreate("Clip Hook",400,400,-1,-1) $calldata= DLLCall("user32.dll","int","AddClipboardFormatListener","hwnd", $hHandle) GUIRegisterMsg(0x031D,"OnClipBoardChange") i am trying to monitor the clipboard without creating a GUI, However i am facing issues with DllCallbackRegister to replace (GUIRegisterMsg) this is what i tried , but ti is not working... ; Create callback function. Local $hHandle = DllCallbackRegister("_EnumWindowsProc", "int", "hwnd;lparam") ; Call dll. DllCall("user32.dll", "int", "AddClipboardFormatListener", "ptr", $hHandle) While 1 sleep(100) WEnd ; Callback Procedure Func _EnumWindowsProc($hWnd, $lParam) ConsoleWrite(ClipGet())) EndFunc what i am doing wrong ? AutoFox, A Modern, Simple, No dependency, Noob friendly yet powerful Firefox UDF ! Link to comment Share on other sites More sharing options...
Solution Nine Posted August 31, 2023 Solution Share Posted August 31, 2023 (edited) You need to provide a window handle. No big deal. Some messages were designed by Windows to use only a window handle. This is the case. But I suppose your first code does not work also. $hHandle is unassigned. Edited August 31, 2023 by Nine fraizor 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
KaFu Posted September 1, 2023 Share Posted September 1, 2023 There's a good example in the help-file for the function _WinAPI_AddClipboardFormatListener. Though you have to create a GUI, you don't have to show it, remove or comment the GUISetState line. Mobius and fraizor 2 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now