hello

well im a lil confused here. i cant get the BN_PUSHED
hooked up.

BEGIN_MSG_MAP(CBarreWindow)
MESSAGE_HANDLER(WM_COMMAND, OnCommand)
END_MSG_MAP()

LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
WORD hi = HIWORD(wParam);
WORD lo = LOWORD(wParam);

if( hi == BN_PUSHED)
if( lo == IDC_BUTTON_LEFT )
//do something with pushed button

return 0;
}

thanks for your help if any!

Re: BN_PUSHED !! by Victor

Victor
Wed May 11 16:06:15 CDT 2005

andré m.a wrote:
> well im a lil confused here. i cant get the BN_PUSHED
> hooked up.

Why are you trying to use a deprecated notification? If you need to
be notified when the button is pressed (and released), use BN_CLICKED.

> BEGIN_MSG_MAP(CBarreWindow)
> MESSAGE_HANDLER(WM_COMMAND, OnCommand)
> END_MSG_MAP()
>
> LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
> {
> WORD hi = HIWORD(wParam);
> WORD lo = LOWORD(wParam);
>
> if( hi == BN_PUSHED)
> if( lo == IDC_BUTTON_LEFT )
> //do something with pushed button
>
> return 0;
> }
>
> thanks for your help if any!

Does your button have BS_OWNERDRAW style? RTFM, please.

V

Re: BN_PUSHED !! by andré

andré
Wed May 11 19:31:12 CDT 2005



>
> Why are you trying to use a deprecated notification? If you need to
> be notified when the button is pressed (and released), use BN_CLICKED.
>

well i need to know when the button is pressed, not clicked.
Reason ? because im making a custom scroll control.
So i need the Pushed/UnPushed scheme etc...


>
> Does your button have BS_OWNERDRAW style? RTFM, please.
>
> V

nah, its a standard button i layed on a dialog resource in VC6.

I read at MSDN how to do this but its not working. I guess its
cause im using XP and this ol' BN_BUSHED is not supported...

So i guess i could figure out a way to get a WM_LBUTTONDOWN
from the Button right?

thanks =]




Re: BN_PUSHED !! by Norman

Norman
Wed May 11 22:16:21 CDT 2005

andré m.a wrote:

>>Why are you trying to use a deprecated notification? If you need to
>>be notified when the button is pressed (and released), use BN_CLICKED.
>>
>
>
> well i need to know when the button is pressed, not clicked.
> Reason ? because im making a custom scroll control.
> So i need the Pushed/UnPushed scheme etc...
>
>
>
>>Does your button have BS_OWNERDRAW style? RTFM, please.
>>
>>V
>
>
> nah, its a standard button i layed on a dialog resource in VC6.
>
> I read at MSDN how to do this but its not working. I guess its
> cause im using XP and this ol' BN_BUSHED is not supported...
>
> So i guess i could figure out a way to get a WM_LBUTTONDOWN
> from the Button right?
>
> thanks =]
>
>
>
What Victor's trying to say is this: instead of BN_PUSHED give your
button the BS_OWNERDRAW style and you will get WM_DRAWITEM messages when
the button changes state between up and down.

Norm

--
--
To reply, change domain to an adult feline.


Re: BN_PUSHED !! by andré

andré
Thu May 12 03:43:56 CDT 2005



>>
> What Victor's trying to say is this: instead of BN_PUSHED give your button
> the BS_OWNERDRAW style and you will get WM_DRAWITEM messages when the
> button changes state between up and down.
>
> Norm

yop, i knew what he meant, thats why i anwered "nah".
I also tried "BS_OWNERDRAW" but the application crashed
the first time i ran it.

So ill just figure out a way to get a WM_LBUTTONDOWN from
the button, After all its a Window.



Re: BN_PUSHED !! by David

David
Thu May 12 04:10:55 CDT 2005


"andré m.a" <a.m.a@videotron.ca> wrote in message
news:fHEge.7530$L31.12140@wagner.videotron.net...

> yop, i knew what he meant, thats why i anwered "nah".
> I also tried "BS_OWNERDRAW" but the application crashed
> the first time i ran it.

Did you handle the WM_DRAWITEM message? I vaguely remember that
it falls foul of an ASSERT somewhere if you give it that style and
forget.

Owner draw buttons are used very commonly, and should not pose a
problem.

Dave
--
David Webber
Author MOZART the music processor for Windows -
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm