File:  [OS/2 SDKs] / pmsdk / samples / template / tempinit.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Thu Aug 9 12:28:13 2018 UTC (7 years, 9 months ago) by root
Branches: msft, MAIN
CVS tags: pmsdk-1988, HEAD
Microsoft OS/2 SDK PM 08-08-1988

/****************************** Module Header ******************************\
* Module Name: tempinit.c
*
*     Initialization portion of Presentation Manager Template Application
*
* Created by Microsoft Corp., 1988
*
\***************************************************************************/

#define INCL_WINCOMMON
#define INCL_WINMESSAGEMGR
#include <os2.h>
#include "template.h"

extern HAB     hAB;
extern HMQ     hMsgQ;
extern HWND    hwndTemplate;
extern HWND    hwndTemplateFrame;

/***************************** Private Function ****************************\
*
* BOOL FAR TemplateInitApp( )
*
* Effects:  Registers Application Window Class
*           Creates Standard Window
*
* Warnings: None
*
* History:
*  01-Jun-87 by rickd  Converted to new API
\***************************************************************************/

BOOL FAR TemplateInitApp( VOID )
{
    char szTitle[21];
    ULONG ctldata;

    /*  Register Application Window Class  */

    if ( !WinRegisterClass( hAB, (PCH)"Template", (PFNWP)TemplateWndProc,
            CS_SYNCPAINT, 0 ) )
        return( FALSE );


    /* Create a window instance of class "Template" */

    WinLoadString( hAB, NULL, IDSTITLE, sizeof(szTitle), (PCH)szTitle );
   
    ctldata = FCF_STANDARD;

    hwndTemplateFrame = WinCreateStdWindow(
        HWND_DESKTOP,   /* specify desktop as parent window                */
                        /* window styles                                   */
        WS_VISIBLE | FS_ICON | FS_ACCELTABLE,
        &ctldata,       /* frame creation flags                            */
        (PCH)"Template",/* window class name                               */
        (PCH)szTitle,   /* name appearing in window caption                */
        0L,              /*                                                 */
        (HMODULE)NULL,   /*  use current executable module id               */
        ID_TEMPLATE,     /*  menu id + accelerator id + icon id             */
        (HWND FAR *)&hwndTemplate  /* window handle                         */
        );

    return( TRUE );
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.