knowledge-database (beta)

Current group: dbase.dde-ole-dll-winapi

sendmessage - which is right?

sendmessage - which is right?  
Jan Hoelterling
 Re: sendmessage - which is right?  
Bowen Moursund [DataTech]
 Re: sendmessage - which is right?  
Jan Hoelterling
 Re: sendmessage - which is right?  
Jan Hoelterling
 Re: sendmessage - which is right?  
news.alldbase.com
From:Jan Hoelterling
Subject:sendmessage - which is right?
Date:Tue, 4 Jan 2005 08:08:25 -0600
Hi Folks,

sendmessage is described on MSDN as
LRESULT SendMessage( HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);I have two different EXTERNs in different pieces of code, varying only in
how the second to last param (WPARAM) is declared (CLONG/CUINT). Which one
is correct? extern clong SendMessage(chandle, cuint, clong, clong)
user32 from "SendMessageA"extern CLONG
SendMessage(CHANDLE,CUINT,CUINT,CLONG) USER32 from "SendMessageA"Thanks in
advance,Jan
From:Bowen Moursund [DataTech]
Subject:Re: sendmessage - which is right?
Date:Tue, 4 Jan 2005 10:13:40 -0600
> );I have two different EXTERNs in different pieces of code, varying only
in
> how the second to last param (WPARAM) is declared (CLONG/CUINT). Which one
> is correct?

It's #defined as UINT in WinDef.h:

// Types use for passing & returning polymorphic values
#define WPARAM UINT

which if correct would make the dBASE type CUINT. But as Rich suggests ,
CUINT and CULONG are both 32 bit unsigned integers, so it probably doesn't
make any difference.

--
Bowen Moursund
DataTech
Consulting & Development
http://www.bmmnet.us
From:Jan Hoelterling
Subject:Re: sendmessage - which is right?
Date:Tue, 4 Jan 2005 10:41:21 -0600
Thanks, Rich and Bowen, for your explanations.

Jan
From:Jan Hoelterling
Subject:Re: sendmessage - which is right?
Date:Tue, 4 Jan 2005 08:09:56 -0600
Hi Folks,

re-posting since my newsreader messed that last one up.

sendmessage is described on MSDN as:

LRESULT SendMessage( HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);

I have two different EXTERNs in different pieces of code, varying only in
how the second to last param (WPARAM) is declared (CLONG/CUINT). Which one
is correct?

extern clong SendMessage(chandle, cuint, clong, clong) user32 from
"SendMessageA"extern CLONG
SendMessage(CHANDLE,CUINT,CUINT,CLONG) USER32 from "SendMessageA"

Thanks in advance,

Jan
From:news.alldbase.com
Subject:Re: sendmessage - which is right?
Date:Tue, 4 Jan 2005 09:46:21 -0500
Right or wrong - this is the one I use...
extern CLONG SendMessage(CHANDLE,CUINT,CUINT,CLONG) USER32 from
"SendMessageA"

I've also seen it defined having it return a logical which looks like may be
correct because of the LRESULT
I believe the last 2 parameters are defined differently depending on the
parameters you need to send. So both CLONG and CUINT may be correct.
Although I don't really know the difference.

Passing the handle to a pushbutton to
SendMessage(this.hWnd,htoi("0406"),16,0) will flatten the pushbutton, and
SendMessage(this.hWnd,htoi("0406"),16,2) will put it back to normal. By
changing the last parameter, you can change the button type and I believe
also change borders. As you can see, it is a long we are passing, so in this
context, I believe defining it using a CLONG is correct. Although we are
also passing longs to all 4 parameters, so maybe it doesn't make a lot of
difference.


--
Rich...
www.autotraker.com
AutoTraker Inc.

"Jan Hoelterling" wrote in message
news:ShY7hfm8EHA.2304@news-server...
> Hi Folks,
>
> re-posting since my newsreader messed that last one up.
>
> sendmessage is described on MSDN as:
>
> LRESULT SendMessage( HWND hWnd,
> UINT Msg,
> WPARAM wParam,
> LPARAM lParam
> );
>
> I have two different EXTERNs in different pieces of code, varying only in
> how the second to last param (WPARAM) is declared (CLONG/CUINT). Which one
> is correct?
>
> extern clong SendMessage(chandle, cuint, clong, clong) user32 from
> "SendMessageA"extern CLONG
> SendMessage(CHANDLE,CUINT,CUINT,CLONG) USER32 from "SendMessageA"
>
> Thanks in advance,
>
> Jan
>
>
   

Copyright © 2006 knowledge-database   -   All rights reserved