Jump to content

WinLoadSecondaryWindow

From EDM2

This function creates a secondary window from a dialog template in a resource. The secondary window is modeless.

Syntax

#define INCL_SW
#include <os2.h>

HWND        hwndParent;     /*  Parent window handle. */
HWND        hwndOwner;      /*  Owner window handle. */
PFNWP       pfnDlgProc;     /*  Secondary window procedure. */
HMODULE     hmod;           /*  Module handle. */
ULONG       idDlg;          /*  Resource ID of dialog template. */
PVOID       pCreateParams;  /*  Parameters passed to secondary window proc. */
HWND        hwnd;           /*  Window handle. */

hwnd = WinLoadSecondaryWindow(hwndParent, hwndOwner, pfnDlgProc, hmod, idDlg, pCreateParams);

Parameters

hwndParent (HWND) - input
Parent window handle of the created secondary frame window.
hwndOwner (HWND) - input
Requested owner-window handle of the created secondary frame.
pfnDlgProc (PFNWP) - input
Secondary window procedure for the created dialog window. This is a dialog procedure, except that it calls WinDefSecondaryWindowProc.
hmod (HMODULE) - input
Module handle for resource module.
idDlg (ULONG) - input
Resource ID of dialog template in the resources of module hmod.
pCreateParams (PVOID) - input
Passed to the secondary window procedure in the WM_INITDLG message.

Return Value

hwnd (HWND) - returns
Returns the frame handle of the secondary window.

Remarks

This call creates a standard frame window with a dialog window as the child of the FID_CLIENT window. Refer to WinLoadDlg in the IBM OS/2 Presentation Manager Programming Reference.

Example Code

The following code illustrates creating a secondary window from a dialog template in a resource.

  #define INCL_SW
  #include <os2me.h>

  HWND hwndFrame;

  hwndFrame = WinLoadSecondaryWindow (HWND_DESKTOP, /* Parent window */
                                      HWND_DESKTOP, /* Owner window  */
                                      MyDlgProc,    /* Dialog proc   */
                                      NULL,         /* Module handle */
                                      ID_DIALOG,    /* Resource ID   */
                                      NULL);        /* Create params */
  WinShowWindow (hwndFrame, TRUE);

Related Functions