Hi!
I need some help to convert the following C++ code to autoit:
;~ / COPYDATASTRUCT cds;
;~ // char buf[MAX_PATH];
;~ // void *adr;
;~ //
;~ // adr=&buf;
;~ // cds.dwData=BSP_GetFileName;
;~ // cds.lpData=&adr;
;~ // cds.cbData=4;
;~ // SendMessage(bsp_hand,WM_COPYDATA,appHWND,(LPARAM)&cds);
;~ // available in BSPlayer version 0.84.484+
;~ //
;~ // appHWND is calling application window handle
;~ // File name will be copied to buf
;~ //
;~ // Get open file name
;~ #define BSP_GetFileName 0x1010B
What I got so far is:
#Include <SendMessage.au3>
$BS_FileName = BSP_GetFileName()
MsgBox(0, "BSPlayer File Name", $BS_FileName)
Func BSP_GetFileName()
$hWndHandle = WinGetHandle("[CLASS:BSPlayer]")
$WM_COPYDATA = 0x004A
$BSP_GetFileName = 0x1010B
$buf = DllStructCreate("CHAR[128]")
$cds = DllStructCreate ("int;ptr;int")
DllStructSetData ($cds, 1, $BSP_GetFileName)
DllStructSetData ($cds, 2, DllStructGetPtr($buf))
DllStructSetData ($cds, 3, 4)
_SendMessage($hWndHandle, $WM_COPYDATA, 0, $cds)
Return DllStructGetData($buf, 1)
EndFunc
but, of course, it doesn't work.
The function should return the file name currently playing in BSPlayer.
Thank You!