Broadcast message in application

forum.advanced.programming (1998-2005)
Pawel Streich

Broadcast message in application

Post by Pawel Streich » 11 Dec 2004, 20:21

 Posted by:  Pawel Streich 

Hi,

In documentaion from CTD 1.1.2 i found this description below to function
SalNumberToWindowHandle :

"...Converts a number to a window handle.
For example, you can broadcast a message by passing -1 to SalSendMsg as
follows:
Set hWndAll = SalNumberToWindowHandle ( -1 )
Call SalSendMsg ( hWndAll, nMsg, 0, 0 )....."

I will prepare broadcast message in window but this don't work.
See attachment

Thanks for answers.

Regards,
Pawel

Attachment: Broadcast.zip

FJ Herbers

Broadcast message in application

Post by FJ Herbers » 12 Dec 2004, 10:18

 Posted by:  FJ Herbers 

Hi Pawel,

some comments:

1. Don't use (-1). In the Win/API "HWND_BROADCAST" is defined as 0xffff.
IIRC (-1) used to work in 16bit, but in 32bit it didn't always work.

2. The message numbers you can broadcast are restricted. The number you
have choosen is out of that range
The range reserved for use with RegisterWindowMessage is 0xC000 to
0xFFFE.

3. You datafield df1 in frmBroadcast will hot receive your message, as it is
not a top-level window.

See modified app attached.

Kind regards

Franz Josef

BTW: You might want to look also at RegisterWindowMessage,
PostThreadMessage, GetCurrentThreadId in the PSDK for further info on
alternatives

Attachment: Broadcast1.zip

Pawel Streich

Broadcast message in application

Post by Pawel Streich » 12 Dec 2004, 12:39

 Posted by:  Pawel Streich 

Thanks Franz,

Regards,

Pawel

U¿ytkownik "FJ Herbers" napisa³ w wiadomo¶ci
news:ImQWXsC4EHA.2428@guptaweb...

Return to “advanced.programming”

Who is online

Users browsing this forum: [Ccbot] and 0 guests