Jump to content

Chaning channels with SendMessage


atanas.bakalov

Recommended Posts

Posted

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.

Posted
DWORD channelnr;

Should be an integer not dword.

 

Channel[0] means the channelnumber you send is not valid.

Posted (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 :blush:

Edited by atanas.bakalov
Posted

#pragma pack(1)

struct channelstruct
{
int channelnr;
int channelptr;
};

#pragma pack()

Seems to be the equivalent to packed record...

Posted

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.

Posted

Oh yeah, of course. This only works inprocess. Sorry I assumed you where working on a plugin-dll.

Posted (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 by Isch003
Posted

Thanks guys ;)

 

The "quick and dirty" method of Isch003, saves my a lot of time, because I won't write a plugin.

 

Thanks again

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...