home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / S12659.ZIP / CLINIT.C < prev    next >
Text File  |  1989-01-06  |  2KB  |  41 lines

  1. #include "os2.h"
  2. #include "st.h"
  3. #include "client.h"
  4.  
  5. /*
  6.  *  Routine ClientInit registers the window classes for
  7.  *  the Graphics Exchange client application and creates the
  8.  *  frame, graphics, and DDE anchor windows.
  9.  */
  10.  
  11.  
  12. HWND ClientInit()
  13. {
  14. RECTL rect;            /* window rectangle work space for positioning */
  15. ULONG CtlData;         /* frame window control specifications         */
  16. HWND hFrame, hClient;  /* frame and client window handles             */
  17.  
  18.     if (!WinRegisterClass(hab1,(PSZ)"Master",(PFNWP)ClientWndProc,(ULONG)NULL,3*4))
  19.         return(FALSE);
  20.     if (!WinRegisterClass(hab1,(PSZ)"DDE_Win_P",(PFNWP)ClientDDEParWndProc,(ULONG)NULL,4*4))
  21.         return(FALSE);
  22.     if (!WinRegisterClass(hab1,(PSZ)"DDE_Win",(PFNWP)ClientDDEWndProc,(ULONG)NULL,4*4))
  23.         return(FALSE);
  24.     WinRegisterClass((HAB)NULL,(PSZ)"GraphicsCtl",(PFNWP)GraphicsCtlWndProc,CS_SIZEREDRAW,4);
  25.  
  26.     CtlData = FCF_TITLEBAR | FCF_SYSMENU | FCF_SIZEBORDER | FCF_MINMAX;
  27.     hFrame = WinCreateStdWindow(HWND_DESKTOP, (ULONG)NULL, &CtlData, (PSZ)"Master",
  28.                 (PSZ)"Client", 0L, (HMODULE)NULL, ID_MASTER, (HWND FAR *)&hClient);
  29.  
  30.     WinQueryWindowRect(HWND_DESKTOP, &rect);
  31.     WinSetWindowPos(hFrame, HWND_TOP, 50,LOUSHORT(rect.yTop) -200,450,180,SWP_SIZE|SWP_MOVE);
  32.     WinShowWindow(hFrame,TRUE);
  33.     WinSetFocus(HWND_DESKTOP,hFrame);
  34.  
  35.     WinQueryWindowRect(hClient, &rect);
  36.     GdCreateGraphicsCtl(hClient,WS_VISIBLE|ICS_AUTOPOS,0,0,LOUSHORT(rect.xRight-rect.xLeft),
  37.                     LOUSHORT(rect.yTop-rect.yBottom),120,10,10,hClient,ID_GRAPHICS1,(PVOID)NULL,(PVOID)NULL);
  38.  
  39.     return (hFrame);
  40. }
  41.