1. PushButtons

Hi All,
Do PushButtons respond to Mouse events? I need to know when a PushButton is
    depressed and
when it is released. I want to be able to move it around the window, and I know
I can do this
with a child window. I'd rather not have to create custom buttons if I can avoid
it.

~Greg
g.haberek at comcast.net

new topic     » topic index » view message » categorize

2. Re: PushButtons

On Mon, 03 Feb 2003 00:45:19 -0500, Greg Haberek <g.haberek at comcast.net> 
wrote:

>
> Hi All,
> Do PushButtons respond to Mouse events? I need to know when a PushButton 
> is depressed and
> when it is released. I want to be able to move it around the window, and 
> I know I can do this
> with a child window. I'd rather not have to create custom buttons if I 
> can avoid it.

Yes they do. One gotcha though is that Left Button Up seems to be triggered 
only if the pointer is moved off the button.

-- 

cheers,
Derek Parnell

new topic     » goto parent     » topic index » view message » categorize

3. Re: PushButtons

----- Original Message -----
From: "Derek Parnell" <ddparnell at bigpond.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: PushButtons


>
> On Mon, 03 Feb 2003 00:45:19 -0500, Greg Haberek <g.haberek at comcast.net>
> wrote:
>
> >
> > Hi All,
> > Do PushButtons respond to Mouse events? I need to know when a PushButton
> > is depressed and
> > when it is released. I want to be able to move it around the window, and
> > I know I can do this
> > with a child window. I'd rather not have to create custom buttons if I
> > can avoid it.
>
> Yes they do. One gotcha though is that Left Button Up seems to be
triggered
> only if the pointer is moved off the button.

 To prevent this effect Derek mentions. u'll have to do global subclassing
of the button control.Doing this gives u full control to any button control
class in ur application ONLY.

Jordah
>
> --
>
> cheers,
> Derek Parnell
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>


---

new topic     » goto parent     » topic index » view message » categorize

4. Re: PushButtons

Sorry, its called super-classing

Jordah
----- Original Message -----
From: <jordah at btopenworld.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: PushButtons


>
>
> ----- Original Message -----
> From: "Derek Parnell" <ddparnell at bigpond.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Monday, February 03, 2003 6:00 AM
> Subject: Re: PushButtons
>
>
> > On Mon, 03 Feb 2003 00:45:19 -0500, Greg Haberek <g.haberek at comcast.net>
> > wrote:
> >
> > >
> > > Hi All,
> > > Do PushButtons respond to Mouse events? I need to know when a
PushButton
> > > is depressed and
> > > when it is released. I want to be able to move it around the window,
and
> > > I know I can do this
> > > with a child window. I'd rather not have to create custom buttons if I
> > > can avoid it.
> >
> > Yes they do. One gotcha though is that Left Button Up seems to be
> triggered
> > only if the pointer is moved off the button.
>
>  To prevent this effect Derek mentions. u'll have to do global subclassing
> of the button control.Doing this gives u full control to any button
control
> class in ur application ONLY.
>
> Jordah
> >
> > --
> >
> > cheers,
> > Derek Parnell
> >
> >
> > TOPICA - Start your own email discussion group. FREE!
> >
>
> ---
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>


---

new topic     » goto parent     » topic index » view message » categorize

5. Re: PushButtons

Ok... and how may I go about performing this 'super-classing'? Is it similar to
sub-classing, or
does it require use of the API?

----- Original Message -----
From: <jordah at btopenworld.com>
Subject: Re: PushButtons



Sorry, its called super-classing

Jordah
----- Original Message -----
From: <jordah at btopenworld.com>
To: "EUforum" <EUforum at topica.com>
Sent: Monday, February 03, 2003 6:14 AM
Subject: Re: PushButtons


>
>
> ----- Original Message -----
> From: "Derek Parnell" <ddparnell at bigpond.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Monday, February 03, 2003 6:00 AM
> Subject: Re: PushButtons
>
>
> > On Mon, 03 Feb 2003 00:45:19 -0500, Greg Haberek <g.haberek at comcast.net>
> > wrote:
> >
> > >
> > > Hi All,
> > > Do PushButtons respond to Mouse events? I need to know when a
PushButton
> > > is depressed and
> > > when it is released. I want to be able to move it around the window,
and
> > > I know I can do this
> > > with a child window. I'd rather not have to create custom buttons if I
> > > can avoid it.
> >
> > Yes they do. One gotcha though is that Left Button Up seems to be
> triggered
> > only if the pointer is moved off the button.
>
>  To prevent this effect Derek mentions. u'll have to do global subclassing
> of the button control.Doing this gives u full control to any button
control
> class in ur application ONLY.
>
> Jordah
> >
> > --
> >
> > cheers,
> > Derek Parnell
> >
> >
> > TOPICA - Start your own email discussion group. FREE!
> >
>
> ---
>
>
> TOPICA - Start your own email discussion group. FREE!
>


---



TOPICA - Start your own email discussion group. FREE!

new topic     » goto parent     » topic index » view message » categorize

6. Re: PushButtons

Window Procedure Superclassing
Superclassing is a technique that allows an application to create a new
window class with the basic functionality of the existing class, plus
enhancements provided by the application. A superclass is based on an
existing window class called the base class. Frequently, the base class is a
system global window class such as an edit control, but it can be any window
class.

A superclass has its own window procedure, called the superclass procedure.
The superclass procedure can take three actions upon receiving a message: It
can pass the message to the original window procedure, modify the message
and pass it to the original window procedure, or process the message and not
pass it to the original window procedure. If the superclass procedure
processes a message, it can do so before, after, or both before and after it
passes the message to the original window procedure.

Unlike a subclass procedure, a superclass procedure can process window
creation messages (WM_NCCREATE, WM_CREATE, and so on), but it must also pass
them to the original base-class window procedure so that the base-class
window procedure can perform its initialization procedure.

To superclass a window class, an application first calls the GetClassInfo
function to retrieve information about the base class. GetClassInfo fills a
WNDCLASS structure with the values from the WNDCLASS structure of the base
class. Next, the application copies its own instance handle into the
hInstance member of the WNDCLASS structure and copies the name of the
superclass into the lpszClassName member. If the base class has a menu, the
application must provide a new menu with the same menu identifiers and copy
the menu name into the lpszMenuName member. If the superclass procedure
processes the WM_COMMAND message and does not pass it to the window
procedure of the base class, the menu need not have corresponding
identifiers. GetClassInfo does not return the lpszMenuName, lpszClassName,
or hInstance member of the WNDCLASS structure.

An application must also set the lpfnWndProc member of the WNDCLASS
structure. The GetClassInfo function fills this member with the address of
the original window procedure for the class. The application must save this
address, to pass messages to the original window procedure, and then copy
the address of the superclass procedure into the lpfnWndProc member. The
application can, if necessary, modify any other members of the WNDCLASS
structure. After it fills the WNDCLASS structure, the application registers
the superclass by passing the address of the structure to the RegisterClass
function. The superclass can then be used to create windows.

Because superclassing registers a new window class, an application can add
to both the extra class bytes and the extra window bytes. The superclass
must not use the original extra bytes for the base class or the window for
the same reasons that an instance subclass or a global subclass should not
use them. Also, if the application adds extra bytes for its use to either
the class or the window instance, it must reference the extra bytes relative
to the number of extra bytes used by the original base class. Because the
number of bytes used by the base class may vary from one version of the base
class to the next, the starting offset for the superclass's own extra bytes
may also vary from one version of the base class to the next.


----------------------------------------------------------------------------
----

© 2002 Microsoft Corporation. All rights reserved.
----- Original Message -----
From: "Greg Haberek" <g.haberek at comcast.net>
To: "EUforum" <EUforum at topica.com>
Sent: Monday, February 03, 2003 7:05 PM
Subject: Re: PushButtons


>
> Ok... and how may I go about performing this 'super-classing'? Is it
similar to sub-classing, or
> does it require use of the API?
>
> ----- Original Message -----
> From: <jordah at btopenworld.com>
> To: EUforum <EUforum at topica.com>
> Sent: Monday, February 03, 2003 1:20 AM
> Subject: Re: PushButtons
>
>
> Sorry, its called super-classing
>
> Jordah
> ----- Original Message -----
> From: <jordah at btopenworld.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Monday, February 03, 2003 6:14 AM
> Subject: Re: PushButtons
>
>
> > ----- Original Message -----
> > From: "Derek Parnell" <ddparnell at bigpond.com>
> > To: "EUforum" <EUforum at topica.com>
> > Sent: Monday, February 03, 2003 6:00 AM
> > Subject: Re: PushButtons
> >
> >
> > > On Mon, 03 Feb 2003 00:45:19 -0500, Greg Haberek
<g.haberek at comcast.net>
> > > wrote:
> > >
> > > >
> > > > Hi All,
> > > > Do PushButtons respond to Mouse events? I need to know when a
> PushButton
> > > > is depressed and
> > > > when it is released. I want to be able to move it around the window,
> and
> > > > I know I can do this
> > > > with a child window. I'd rather not have to create custom buttons if
I
> > > > can avoid it.
> > >
> > > Yes they do. One gotcha though is that Left Button Up seems to be
> > triggered
> > > only if the pointer is moved off the button.
> >
> >  To prevent this effect Derek mentions. u'll have to do global
subclassing
> > of the button control.Doing this gives u full control to any button
> control
> > class in ur application ONLY.
> >
> > Jordah
> > >
> > > --
> > >
> > > cheers,
> > > Derek Parnell
> > >
> > >
> > > TOPICA - Start your own email discussion group. FREE!
> > >
> >
> > ---
> >
> >
> > TOPICA - Start your own email discussion group. FREE!
> >
>
> ---
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>


---

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu