zeffy Posted August 11, 2010 Posted August 11, 2010 Hi, I'm trying to use the Audiosurf API (see here) command ascommand registerlistenerwindow MyWindowTitle(see near the bottom of the top post for more info), so I can get the title and artist of the song that is being played, but I am totally confused as to how to receive WM_COPYDATA from another program. I have looked at several examples on the forum, but I need further explanation about how to use it, specifically for what I'm trying to do.Thanks
KaFu Posted August 11, 2010 Posted August 11, 2010 This should receive and display a string send via WM_COPYDATA. expandcollapse popup#include <windowsconstants.au3> HotKeySet("{ESC}", "_Exit") Global $sWM_COPYDATA_Received_String $hgui = GUICreate("Receiving hWnd") GUIRegisterMsg($WM_COPYDATA, "WM_COPYDATA") GUISetState() While 1 Sleep(10) If $sWM_COPYDATA_Received_String Then MsgBox(0, "Received String via WM_COPYDATA", $sWM_COPYDATA_Received_String) $sWM_COPYDATA_Received_String = "" EndIf WEnd Func WM_COPYDATA($hWnd, $MsgID, $wParam, $lParam) ; http://www.autoitscript.com/forum/index.php?showtopic=105861&view=findpost&p=747887 ; Melba23, based on code from Yashied Switch $hWnd Case $hgui Local $tCOPYDATA = DllStructCreate("dword;dword;ptr", $lParam) Local $tMsg = DllStructCreate("char[" & DllStructGetData($tCOPYDATA, 2) & "]", DllStructGetData($tCOPYDATA, 3)) $sWM_COPYDATA_Received_String = DllStructGetData($tMsg, 1) EndSwitch Return True EndFunc ;==>WM_COPYDATA Func _Exit() Exit EndFunc ;==>_Exit 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 (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
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