home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
mltwin.zip
/
UFMULTW.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-10-06
|
2KB
|
45 lines
#define INCL_DOS
#define INCL_PM
#include <os2.h>
#include <gpfparms.h>
#include "MULTWIN.IDS"
#include "MULTWIN.EXT"
#include "MULTWIN.H"
void UFCreateMultWindow(PVOID pCrtParms) {
CreateMultWindow(pCrtParms);
}
/************************************************************/
/** User destroying function pair */
/** Only from another window you can apply WinDestroyWindow */
/** in the Gpf '.exe' world. */
/** [This is one of many possible solutions] */
/************************************************************/
#define WM_USER_DESTROY (WM_USER+1)
/******************************************************************/
/** Function fDestroy is attached to a control within the *********/
/** window of which many copies are permitted. Use this instead **/
/** of the GPF Window Dismiss function. Rather than trying to **/
/** destroy itself, a window issuing this message is asking some */
/** other (in our case MainWindow) entity to kill it. **/
/******************************************************************/
void UFSelfDestruct(PGPFPARMS pGpfParms) {
WinPostMsg(hwndMainWindow,WM_USER_DESTROY,
MPFROMHWND(pGpfParms->hwnd),MPFROMP(NULL));
}
/********************************************************************/
/** Function UFMultDestroy in this example is hooked to MainWindow */
/** at UserMessage receiving. The message WM_USER_DESTROY is */
/** posted to MainWindow by any procedure desiring to delete a copy */
/** of one of the multiple windows created above. */
/********************************************************************/
void UFMultDestroy(PGPFPARMS pGpfParms) {
HWND hwnd = HWNDFROMMP(pGpfParms->mp1);
if(pGpfParms->msg == WM_USER_DESTROY)
WinDestroyWindow(GpfGetHwndFrame(hwnd));
}