WNDCLASS: cbWndExtra

Discussion in 'C++' started by Karel Bruneel, Aug 30, 2003.

  1. Hi,

    Is this right?

    1)if I register a WNDCLASS in witch set cbWndExtra to a value greater than
    0, this means that every time I create a window of that class there will be
    an extra amount of memory alocated.

    2)I can put something into that extra memory.

    If the two statements are correct:

    How can I write and read from that extra memory.

    Thank you
    Karel Bruneel
     
    Karel Bruneel, Aug 30, 2003
    #1
    1. Advertising

  2. On Sat, 30 Aug 2003 19:36:19 GMT, "Karel Bruneel" <> wrote:

    >Hi,
    >
    >Is this right?
    >
    >1)if I register a WNDCLASS in witch set cbWndExtra to a value greater than
    >0, this means that every time I create a window of that class there will be
    >an extra amount of memory alocated.


    Not necessarily, but there's an extra amount of memory _available_ for
    your use.



    >2)I can put something into that extra memory.


    Yes.

    But since every Win32 window has room for a user-defined pointer you
    generally don't need to specify more storage.

    It's a relic from 16-bit Windows.


    (Note that there are many other ways to associate data with a window,
    including (1) SetProp/GetProp, (2) dynamically generated window proc
    stub, and (3) static association table.)


    >If the two statements are correct:
    >
    >How can I write and read from that extra memory.


    GetWindowLong, SetWindowLong.
     
    Alf P. Steinbach, Aug 30, 2003
    #2
    1. Advertising

  3. On Sat, 30 Aug 2003 19:54:03 GMT, (Alf P. Steinbach) wrote:
    >


    I'm sorry, I didn't notice this was crossposted to [comp.lang.c++].

    Karel: DON'T DO THAT.

    Or else... ;-)
     
    Alf P. Steinbach, Aug 30, 2003
    #3
  4. I thank all of you.


    "Karel Bruneel" <> schreef in bericht
    news:T074b.9675$-ops.be...
    > Hi,
    >
    > Is this right?
    >
    > 1)if I register a WNDCLASS in witch set cbWndExtra to a value greater than
    > 0, this means that every time I create a window of that class there will

    be
    > an extra amount of memory alocated.
    >
    > 2)I can put something into that extra memory.
    >
    > If the two statements are correct:
    >
    > How can I write and read from that extra memory.
    >
    > Thank you
    > Karel Bruneel
    >
    >
    >
     
    Karel Bruneel, Aug 31, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page