atanas.bakalov Posted October 2, 2008 Share Posted October 2, 2008 Hello guys, Could you please tell me which is the proper way to change a channel using SendMessage? I do the following : struct channelstruct { DWORD channelnr; DWORD channelptr; }; main() { .... channelstruct chnr; chnr.channelnr = 33; chnr.channelptr = NULL; ::SendMessage(hwnd1,0xB2C2,0x2204,(LPARAM)&chnr); ... } and expect the DVBViewer to switch to channel number 33, however it always switches to channel number 0. I'm using the method proposed by Lars_MQ here http://www.DVBViewer.info/forum/index.php?...t=0#entry199650 Thanks in advance. Quote Link to comment
Lars_MQ Posted October 2, 2008 Share Posted October 2, 2008 DWORD channelnr; Should be an integer not dword. Channel[0] means the channelnumber you send is not valid. Quote Link to comment
atanas.bakalov Posted October 2, 2008 Author Share Posted October 2, 2008 (edited) Hmm. In C/C++ DWORD is unsigned int which is 4 bytes. I guess the same is for Delhi's Integer. However when I define the struct as follows : struct channelstruct { int channelnr; int channelptr; }; , the same happens. Probably this is something related to the way C/C++ "packs structs" and Delphi "depacks records". But who knows. Maybe someone who have the source code of DVBViewer Edited October 2, 2008 by atanas.bakalov Quote Link to comment
Lars_MQ Posted October 2, 2008 Share Posted October 2, 2008 #pragma pack(1) struct channelstruct { int channelnr; int channelptr; }; #pragma pack() Seems to be the equivalent to packed record... Quote Link to comment
atanas.bakalov Posted October 2, 2008 Author Share Posted October 2, 2008 This doesn't help too. Probably I do something fundamentally wrong here. I'm wrting my own application (a standalone .exe process) which sends MSG_SETCHANNEL = 0x2204 to the DVBViewer process. However I suspect the only possible message that could be send between process boundaries is MSG_REMOTE, and MSG_SETCHANNEL is only possible when called from a plugin dll. Is that the reason ? Just the SDK is not very clear about that topic. Quote Link to comment
Lars_MQ Posted October 2, 2008 Share Posted October 2, 2008 Oh yeah, of course. This only works inprocess. Sorry I assumed you where working on a plugin-dll. Quote Link to comment
Isch003 Posted October 2, 2008 Share Posted October 2, 2008 (edited) You can try the following. (quick & dirty) If you want switch to a specific channel no. (e.g. 23). Simply send the following messages to DVBViewer 1. PostMessage(hwnd, 0xB2C2, 0x0815, 0x08E) // send the "Channel2" command 2. PostMessage(hwnd, 0xB2C2, 0x0815, 0x08F) // send the "Channel3" command The LPARAM is the channel no. (see actions.ini). Edited October 2, 2008 by Isch003 Quote Link to comment
atanas.bakalov Posted October 3, 2008 Author Share Posted October 3, 2008 Thanks guys The "quick and dirty" method of Isch003, saves my a lot of time, because I won't write a plugin. Thanks again Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.