|
General Talk And Support General talk and peer-to-peer support about BS.Player and other video and audio multimedia players. |
| LinkBack | Thread Tools | Search this Thread | Display Modes |
| |||
BSP_GetFileName and the OSD first of all great player! I'm currently trying to write a little BSPlayer2Mirc-thingie for myself and so far displaying movielength, current position and player-version is working but getting the filename still doesn't somehow. I've looked through the forum but didn't find a solution. I mainly used the code from the SDK: ---- HWND bsp_hand = FindWindow("BSPlayer",NULL); 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,0,(LPARAM)&cds); strcpy(data, buf); --- Problem is all I get in buf (and data) are strange I-like chars as if buf would still be uninitialized. The whole thing is a function within a DLL. Any ideas what could be wrong? :/ And there's something else: is it possible to message the OSD any text to display? I'd like to display lines from an IRC-chan in the player so watching in fullscreen wouldn't result in missing stuff. ;) I already did that with DScaler an got kinda used to it. ;) //Sebastian |
| |||
Sebastian, The command to get the filename is indeed : SendMessage(bsp_hand,WM_COPYDATA,appHWND,(LPARAM)& cds); Are you sure the handle to your application = 0 ? If you want to know how to write text to the OSD, take a look at the sampleplugin.c file in the SDK subdirectory. I'm sure you'll find all the info you need in there. Good luck, Rafke P. |
| |||
Thanks Rafke! Well I actually get the application handle from MIRC, in fact 2 , but whenever I try to use either of them in SendMessage the compiler says --- error C2664: 'SendMessageA' : cannot convert parameter 3 from 'struct HWND__ *' to 'unsigned int' --- The function gets HWND mWnd, HWND aWnd as parameters and --- SendMessage(bsp_hand,WM_COPYDATA,mWnd,(LPARAM)&cds ); --- ... and with aWnd, gives me that error. I was looking for a way to maybe get the handle of that DLL but I don't know if DLL's even got handles, I'm not used to those things yet. :/ All other SendMessage-calls without using WM_COPY don't seem to need any specific application handle, they're working. It's just that Filename-thingie... That sampleplugin.c looks interesting, thanks for the hint! //Sebastian |
| |||
To be honest : I'm new to this dll thing myself and I'm not so good a coder. Fortunately for me BSPlayer is well documented, so I managed to get my things working. I have the feeling that you are writing a plugin for Mirc. (unlike me : I wrote a plugin for BSplayer) So the answer will be in the Mirc documentation. I suppose both Mirc and your plugin will have a (different) handle. I'll explain you how I did mine, maybe that will help you in a way. Take another look at the sampleplugin. In the bspplg.h you will notice there is a structure called pluginInfo. In that structure there is a HWND called hwndParent and that is the one I need. So to get the name of the file I call : SendMessage(bsp_hand,WM_COPYDATA, pInfo->hwndParent,(LPARAM)&cds) Try and see if you find something similar in the Mirc SDK. |
| |||
Yeah it's a mirc-plugin, sorry I missed to mention it. Hmm seems like the right application handle would be really important. Confusing stuff... :roll: :lol: Thanks for your help Rafke. Maybe I find a solution then I'll post it here. If anybody else has any idea please post it, thanks. :) Sebastian |
| |||
Thanks Halle. Hmm yeah I tried that and as it didn't work "(WPARAM)(HWND) mWnd" as third parameter. SendMessage returns TRUE so it should be processed by BSPlayer but somehow the text in buf doesn't change at all. I wonder what the application handle as third parameter is good for anyway, it seems to me as if the function in the BSPlayer source dealing with the sent messages is only supposed to change stuff, like the content of buf, in the COPYDATASTRUCT using the pointer... |
Tags |
bspgetfilename, osd |
| |