I'm trying to break my habit of always using dialogs, and starting to code using 'real' windows instead. I've run into a problem though, and I'm sure I'm overlooking something. I've got two (possibly another one too, haven't decided yet) windows--the main window and an about-type window (a regular window not ShellAbout) that I'd like to create when the 'about' menu item gets clicked.

So I'm trying to subclassing the about window and it's got it's own wndproc. I've tried assigning this wndproc in it's WNDCLASSEX struct as well as later on using SetWindowLong. Neither method worked, so I tested the return of the CreateWindowEx (for the about win) call and it was 0. I used the GetErrDescription function in the masmlib (pity it can't retrieve more 'useful' info) and it spit out something along the lines of 'error 87: Incorrect parameters', but everything looks alright to my glazed over (from staring at qeditor all day) eyes.

Does anyone know where I can check an example of a single masm program which uses more than one (regular, non mdi) windows with their own wndprocs?

I can post my code if it's needed to answer my question, but right now it's big (for me at least), around 600+ lines at last count and I've got a monumental headache so if I don't have to read through it cutting out only the code in question it'll make my day! :)

Incidentally does one of those new fangled asm IDE's have some sort of feature which (like the hll IDE's) gives you a list on the side of your procs or whatever and let you instantly jump to that section of your code? That'd be wonderful.
Posted on 2001-12-04 16:00:06 by Will
have u tested it without subclasing yet? also i wouldnt mind seeing some source code.
Posted on 2001-12-04 17:50:05 by smurf
I believe that ketilO's RADasm has the jump-to-function feature that were asking about.

With your About window, are you assigning it a parent when you create it?
Posted on 2001-12-04 18:10:35 by sluggy
Hi 4oh4,

If I understand you right you want to call 'about' window for example instead of 'about' dialog box. If this is so you click on 'about' menu item in your main window and register new class of window. point to your about proc and register and create window. when your done with it to close call destroy window and unregisterClass. (I don't know if this last is necessary but I always do it).

hope this is helpful,
best regards,

czDrillard
Posted on 2001-12-05 01:22:15 by czDrillard
smurf:
At first I wrote the code for both windows in two separate files until I got the control placement the way that I wanted them and everything was working. Now I'm just trying to sort of combine both of them into one program. I've tried it with and without subclassing, using the same wndproc for both at first. When that didn't work I thought that maybe I *had* to subclass each additional window. I'm attaching an example of what I *want* to do. There's some comments just to let you know why I did things the way I did. I'm sure it's something silly.

sluggy:
Thanks for the radasm suggestion. I dl'ed it and tried it. Honestly I wish there was an ide somewhere in between that and qeditor. It'll be hard to get used to all the extra stuff, although I do like the rsrc editor and syntax highlighting. I haven't fully explored it yet, but I hope that the syntax coloring is adjustable.
I've tried it with and without assigning a parent hwnd in the CreateWindowEx call, but shouldn't I assign it?


thanks for looking at the code and I'm sure it's something basic that I'm not understanding.

-----------------------------------------------
edited cause our posts crossed cz

I think I understand the basic concept of it. It's just that the call to CreateWindowEx for the about window is failing and I can't seem to figure out why. But you're absolutely right. That's exactly what I'm trying to do.
Posted on 2001-12-05 01:30:38 by Will
I just checked one of your examples (the mouse-over button one) cz, and I understand it now. My code was almost completely wrong.
Posted on 2001-12-05 02:39:24 by Will