1. win32lib ??

David:
    What is the reason that you register the main window every time
    createWindow procedure is called ?
Bernie

new topic     » topic index » view message » categorize

2. Re: win32lib ??

Bernie Ryan wondered:

> What is the reason that you register the main
> window every time createWindow procedure
> is called ?

I was under the impression that you had to register all the windows. Am I
mistaken?

The class name for each window is "Win32Lib%d", where %d uses the control
id. Each window gets a new control id, so each window should be registered
as a new class.

-- David Cuny

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

3. Re: win32lib ??

Bernie Ryan wondered:

>> What is the reason that you register the main
>> window every time createWindow procedure
>> is called ?


David Cuny replied:

>I was under the impression that you had to
>register all the windows. Am I
>mistaken?

Yes.
You only need to register for new window types.
Therefore, in most cases, it is only neccesary to register
the first window you create(i.e register as win32lib1 as
you do for your first window). The others can all then be
created with win32lib1 as the lpClassName element of
CreateWindow.

I think you must have forgotten, David, that we had this
discussion a few months ago, because I had to rewrite several
portions of your main create() function for this exact reason.
Also, registering every window in this way makes it impossible
to use other, preregistered, window types, i.e syslistview, except
for the ones you specifically allow, i.e. button, group, edit etc.

At that time I sent you code that overcomes this problem, and you
said that you would use it in future versions of win32lib. If you
would like another copy let me know.

All the best

Terry

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

4. Re: win32lib ??

On Sun, 5 Sep 1999 10:31:49 -0700, David Cuny <dcuny at LANSET.COM> wrote:

>The class name for each window is "Win32Lib%d", where %d uses the control
>id. Each window gets a new control id, so each window should be registered
>as a new class.
>
>-- David Cuny

First you create and initialize wndProcFunc variable pointer to zero.

My undestanding is that main window is the application it self. The
windclass structure describes the template for creating the main window.
This template is registered to let windows know about this application
window and how it should look. Then you have to create this application
window ( which is pointing WndProcFunc NULL for the forward reference )
after the WndProc is defined. But the mainwindow class is only registered
once.


A control that is to be used must have a unique IDC_XXXXXXX assigned to it
( IDentificationControl mylistbox ) like this

constant IDC_MYLISTBOX = 1001 -- this can be any UNIQUE number

When the control is created, it is a child window of the main window
therefore the parentwindowhandle is set to the MAIN window handle.
The window menu (handle can be the menu or ) can be set to the
IDC_MYLISTBOX to tell windows when something happens to this control
we use this IDC_XXXXX as a reference when responding to the parent's
message switching WM_COMMAND

Maybe I'am wrong ?

Bernie

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

5. Re: win32lib ??

Terry wrote:

> I think you must have forgotten, David, that
> we had this discussion a few months ago ...
> ... If you would like another copy let me know.

Yes, please.

-- David Cuny

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

Search



Quick Links

User menu

Not signed in.

Misc Menu