🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #2071

Re: How to open two windows from one application

#2071
From: Bruce Wright
Date: Sat, 13 Apr 1991 22:41
37 lines
2059 bytes
In article <1991Apr12.181046.14531@ux1.cso.uiuc.edu>, koziol@yoyodyne.ncsa.uiuc.edu (Quincey Koziol) writes:
> 
> Ok, I'm stumped.  How does one open two windows from one Windows App?  I have
> tried so many combinations I'm really getting sick of this problem.  Attached
> below is the relevant section of my current iteration of the code:

I've had no trouble creating multiple windows for a single app - you
must be doing something wrong.  A few possible problems:

>     /* get a procedure instance for the palette window */
>     lpProc=MakeProcInstance((FARPROC)PalWndProc,hInst);

1) You don't need to do a MakeProcInstance on a window function - 
   only on a dialog box function, a window subclass function, or
   some type of callback function.

>         palclass.style = CS_DBLCLKS;
>         palclass.lpfnWndProc = lpProc;

2) Set palclass.lpfnWndProc to PalWndProc (just like the class 
   structure for the main window sets lpfnWndProc to WndProc).

3) Make SURE you export the PalWndProc function in your .DEF file.

4) You may want to force a WM_PAINT of one or both windows after 
   you create them by adding an UpdateWindow (hPaletteWnd) or
   UpdateWindow (hWndApp) call after the ShowWindow call for the
   appropriate window.

That's all I see or can think of offhand.  There may be something 
else, either in code that you didn't post (like in the window
function for the palette window) or that just escaped me when I
read over the article.

Good luck -

						Bruce C. Wright
Technical Details
Message-ID: <1991Apr13.224148.3505@rti.rti.org>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!mcnc!rti!bcw
References: <1991Apr12.181046.14531@ux1.cso.uiuc.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!mcnc!rti!bcw
From: bcw@rti.rti.org (Bruce Wright)
Newsgroups: comp.windows.ms.programmer
Subject: Re: How to open two windows from one application
Summary: Multiple windows ...
Keywords: multiple windows
Message-ID: <1991Apr13.224148.3505@rti.rti.org>
Date: 13 Apr 91 22:41:48 GMT
References: <1991Apr12.181046.14531@ux1.cso.uiuc.edu>
Organization: Research Triangle Institute, RTP, NC
Lines: 37