head	 1.55;
branch   ;
access   ;
symbols  V80:1.9 V76d:1.2;
locks    ; strict;
comment  @ * @;


1.55
date	 94.09.19.00.16.33;  author jcooper;  state Exp;
branches ;
next	 1.54;

1.54
date	 94.09.18.22.47.33;  author jcooper;  state Exp;
branches ;
next	 1.53;

1.53
date	 94.09.16.00.44.49;  author jcooper;  state Exp;
branches ;
next	 1.52;

1.52
date	 94.08.24.18.40.15;  author mrr;  state Exp;
branches ;
next	 1.51;

1.51
date	 94.08.24.17.59.26;  author jcooper;  state Exp;
branches ;
next	 1.50;

1.50
date	 94.08.11.02.25.59;  author dumoulin;  state Exp;
branches ;
next	 1.49;

1.49
date	 94.08.11.00.09.17;  author jcooper;  state Exp;
branches ;
next	 1.48;

1.48
date	 94.08.04.05.51.54;  author dumoulin;  state Exp;
branches ;
next	 1.47;

1.47
date	 94.08.03.00.35.20;  author dumoulin;  state Exp;
branches ;
next	 1.46;

1.46
date	 94.08.02.05.00.16;  author dumoulin;  state Exp;
branches ;
next	 1.45;

1.45
date	 94.07.25.22.41.22;  author pearse_w_r;  state Exp;
branches ;
next	 1.44;

1.44
date	 94.07.25.18.51.48;  author jcooper;  state Exp;
branches ;
next	 1.43;

1.43
date	 94.06.30.16.33.35;  author dumoulin;  state Exp;
branches ;
next	 1.42;

1.42
date	 94.06.23.23.10.40;  author dumoulin;  state Exp;
branches ;
next	 1.41;

1.41
date	 94.06.17.09.08.49;  author dumoulin;  state Exp;
branches ;
next	 1.40;

1.40
date	 94.06.11.00.46.47;  author dumoulin;  state Exp;
branches ;
next	 1.39;

1.39
date	 94.06.06.22.06.13;  author gardnerd;  state Exp;
branches ;
next	 1.38;

1.38
date	 94.05.27.01.29.29;  author rushing;  state Exp;
branches ;
next	 1.37;

1.37
date	 94.05.26.22.02.38;  author jglasser;  state Exp;
branches ;
next	 1.36;

1.36
date	 94.05.23.19.51.51;  author rushing;  state Exp;
branches ;
next	 1.35;

1.35
date	 94.05.23.18.37.00;  author jcooper;  state Exp;
branches ;
next	 1.34;

1.34
date	 94.05.02.19.51.12;  author rushing;  state Exp;
branches ;
next	 1.33;

1.33
date	 94.05.02.19.45.42;  author rushing;  state Exp;
branches ;
next	 1.32;

1.32
date	 94.05.02.19.44.04;  author rushing;  state Exp;
branches ;
next	 1.31;

1.31
date	 94.04.22.05.02.23;  author dumoulin;  state Exp;
branches ;
next	 1.30;

1.30
date	 94.04.22.04.55.02;  author dumoulin;  state Exp;
branches ;
next	 1.29;

1.29
date	 94.04.19.10.18.52;  author dumoulin;  state Exp;
branches ;
next	 1.28;

1.28
date	 94.04.18.20.49.44;  author rushing;  state Exp;
branches ;
next	 1.27;

1.27
date	 94.03.01.19.10.19;  author rushing;  state Exp;
branches ;
next	 1.26;

1.26
date	 94.02.24.21.24.47;  author jcoop;  state Exp;
branches ;
next	 1.25;

1.25
date	 94.02.16.21.58.56;  author rushing;  state Exp;
branches ;
next	 1.24;

1.24
date	 94.02.16.20.59.17;  author rushing;  state Exp;
branches ;
next	 1.23;

1.23
date	 94.02.09.01.25.15;  author cnolan;  state Exp;
branches ;
next	 1.22;

1.22
date	 94.02.09.01.10.07;  author rushing;  state Exp;
branches ;
next	 1.21;

1.21
date	 94.02.04.02.18.13;  author rushing;  state Exp;
branches ;
next	 1.20;

1.20
date	 94.01.24.19.34.38;  author jcoop;  state Exp;
branches ;
next	 1.19;

1.19
date	 94.01.24.17.39.47;  author jcoop;  state Exp;
branches ;
next	 1.18;

1.18
date	 94.01.17.21.56.15;  author jcoop;  state Exp;
branches ;
next	 1.17;

1.17
date	 94.01.12.19.25.35;  author mrr;  state Exp;
branches ;
next	 1.16;

1.16
date	 93.12.08.01.27.21;  author rushing;  state Exp;
branches ;
next	 1.15;

1.15
date	 93.08.25.18.55.19;  author mbretherton;  state Exp;
branches ;
next	 1.14;

1.14
date	 93.08.05.20.06.07;  author jcoop;  state Exp;
branches ;
next	 1.13;

1.13
date	 93.07.13.16.03.04;  author riordan;  state Exp;
branches ;
next	 1.12;

1.12
date	 93.07.06.21.09.09;  author cnolan;  state Exp;
branches ;
next	 1.11;

1.11
date	 93.06.25.20.14.09;  author dumoulin;  state Exp;
branches ;
next	 1.10;

1.10
date	 93.06.24.17.13.14;  author riordan;  state Exp;
branches ;
next	 1.9;

1.9
date	 93.06.11.00.12.13;  author rushing;  state Exp;
branches ;
next	 1.8;

1.8
date	 93.05.28.17.18.00;  author rushing;  state Exp;
branches ;
next	 1.7;

1.7
date	 93.05.24.23.27.38;  author rushing;  state Exp;
branches ;
next	 1.6;

1.6
date	 93.05.18.22.10.45;  author rushing;  state Exp;
branches ;
next	 1.5;

1.5
date	 93.05.13.19.58.35;  author rushing;  state Exp;
branches ;
next	 1.4;

1.4
date	 93.05.13.16.18.00;  author rushing;  state Exp;
branches ;
next	 1.3;

1.3
date	 93.04.29.20.25.23;  author rushing;  state Exp;
branches ;
next	 1.2;

1.2
date	 93.03.09.01.28.03;  author dumoulin;  state Exp;
branches ;
next	 1.1;

1.1
date	 93.02.16.20.53.50;  author rushing;  state Exp;
branches ;
next	 ;


desc
@winvn version 0.76 placed into RCS
@


1.55
log
@MAPI for Win32s fix
@
text
@/*
 *
 * $Id: winvn.c 1.54 1994/09/18 22:47:33 jcooper Exp $
 * $Log: winvn.c $
 * Revision 1.54  1994/09/18  22:47:33  jcooper
 * new support for window cascading
 * 
 * Revision 1.53  1994/09/16  00:44:49  jcooper
 * massive cleanup, etc for 92.6
 * 
 * Revision 1.52  1994/08/24  18:40:15  mrr
 * authorization enables post/mail
 *
 * Revision 1.51  1994/08/24  17:59:26  jcooper
 * misc encoding/decoding changes
 *
 * Revision 1.50  1994/08/11  02:25:59  dumoulin
 * enabled STRICT compile and cleaned up parameter casting
 *
 * Revision 1.49  1994/08/11  00:09:17  jcooper
 * Enhancements to Mime and article encoding/encoding
 *
 * Revision 1.48  1994/08/04  05:51:54  dumoulin
 * Fixed problem with long mail addresses getting truncated to 32 chars
 *
 * Revision 1.47  1994/08/03  00:35:20  dumoulin
 * Fixed bug upon exit and startup for folks that don't have
 * any printers.
 *
 * Revision 1.46  1994/08/02  05:00:16  dumoulin
 * change HANDLE to HINSTANCE for better NT compatiblity
 *
 * Revision 1.45  1994/07/25  22:41:22  pearse_w_r
 * ShowUnreadOnly option
 *
 * Revision 1.44  1994/07/25  18:51:48  jcooper
 * execution of decoded files
 *
 * Revision 1.43  1994/06/30  16:33:35  dumoulin
 * Fix a problem with freeing printing fonts with an uninitialized variable
 *
 * Revision 1.42  1994/06/23  23:10:40  dumoulin
 * Changed code to not delete hardware device context for Printer device
 *
 * Revision 1.41  1994/06/17  09:08:49  dumoulin
 * Attempts to fix the Unable to Initialize Document printing bug
 *
 * Revision 1.40  1994/06/11  00:46:47  dumoulin
 * Fix defaults for GenSock.DLL and prompt if no username specified
 *
 * Revision 1.39  1994/06/06  22:06:13  gardnerd
 * horizontal scrolling support
 *
 * Revision 1.38  1994/05/27  01:29:29  rushing
 * unnecessary winundoc.h
 *
 * Revision 1.37  1994/05/26  22:02:38  jglasser
 * warnings
 *
 * Revision 1.36  1994/05/23  19:51:51  rushing
 * NNTPPort becomes NNTPService, and it's a string.
 *
 * Revision 1.35  1994/05/23  18:37:00  jcooper
 * new attach code, session [dis]connect
 *
 * Revision 1.34  1994/05/02  19:51:12  rushing
 * more changes from jg
 *
 * Revision 1.33  1994/05/02  19:45:42  rushing
 * redoing JD's print font size change
 *
 * Revision 1.32  1994/05/02  19:44:04  rushing
 * changes from jody glasser
 *
 * Revision 1.31  1994/04/22  05:02:23  dumoulin
 * Fix font size problem
 *
 * Revision 1.30  1994/04/22  04:55:02  dumoulin
 * Fix font conversion problem when converting older winvn.ini files
 *
 * Revision 1.29  1994/04/19  10:18:52  dumoulin
 * Updated converter for old to new INI files
 *
 * Revision 1.28  1994/04/18  20:49:44  rushing
 * check MailList for NULL on write of newsrc
 *
 * Revision 1.27  1994/03/01  19:10:19  rushing
 * ThreadFullSubject option added
 *
 * Revision 1.26  1994/02/24  21:24:47  jcoop
 * jcoop changes
 *
 * Revision 1.25  1994/02/16  21:58:56  rushing
 * call to profilestring was a little hosed for .sig file
 *
 * Revision 1.24  1994/02/16  20:59:17  rushing
 * Added .ini param to force use of XHDR over XOVER
 *
 * Revision 1.23  1994/02/09  01:25:15  cnolan
 * cnolan 90.2 changes
 *
 * Revision 1.22  1994/02/09  01:10:07  rushing
 * PREF->COMM for GenSockDLL profile string
 *
 * Revision 1.21  1994/02/04  02:18:13  rushing
 * added GenSockDLL .ini parameter
 *
 * Revision 1.20  1994/01/24  19:34:38  jcoop
 * per email
 *
 * Revision 1.19  1994/01/24  17:39:47  jcoop
 * 90.2 changes
 *
 * Revision 1.18  1994/01/17  21:56:15  jcoop
 * New font/color and INI file routines.  Sig file and en/decoding inits
 *
 * Revision 1.17  1994/01/12  19:25:35  mrr
 * mrr mods 4
 * 
 * Revision 1.16  1993/12/08  01:27:21  rushing
 * new version box and cr lf consistency
 *
 * Revision 1.15  1993/08/25  18:55:19  mbretherton
 * MRB merge, mail & post logging
 *
 *
 * Revision 1.1x  1993/07/21 MBretherton 
 *                Include Posting and Mail log variables
 *
 * Revision 1.14  1993/08/05  20:06:07  jcoop
 * save multiple articles changes by jcoop@@oakb2s01.apl.com (John S Cooper)
 *
 * Revision 1.13  1993/07/13  16:03:04  riordan
 * MRR mods
 *
 * Revision 1.12  1993/07/06  21:09:09  cnolan
 * win32 support
 *
 * Revision 1.11  1993/06/25  20:14:09  dumoulin
 * Cleaned up Compiler Warnings
 *
 * Revision 1.10  1993/06/24  17:13:14  riordan
 * Save window positions between sessions.
 *
 * Revision 1.9  1993/06/11  00:12:13  rushing
 * second merge from Matt Bretherton sources.
 *
 *
 * Revision 1.8  1993/05/28  17:18:00  rushing
 * Added Misc... option to enable threading
 *
 * Revision 1.7  1993/05/24  23:27:38  rushing
 * Create an Article Italics Font for Quotation lines (MRB)
 *
 * Revision 1.6  1993/05/18  22:10:45  rushing
 * smtp support
 *
 * Revision 1.5  1993/05/13  19:58:35  rushing
 * fancy 'from' in group window
 *
 * Revision 1.4  1993/05/13  16:18:00  rushing
 * article fetch limit (ArticleThreshold .ini param) support.
 *
 * Revision 1.3  1993/04/29  20:25:23  rushing
 * attempted support for WSAAsyncSelect
 *
 * Revision 1.2  1993/03/09  01:28:03  dumoulin
 * added support for italic fonts in printing articles
 *
 * Revision 1.1  1993/02/16  20:53:50  rushing
 * Initial revision
 *
 *
 */

/*  WinVn.c
 *
 *  This program is a visual Usenet news reader for Microsoft Windows.
 *  It bears a vague similarity to the Unix program "vn"; hence the
 *  name WINVN.
 *
 *  WinVN talks NNTP (Network News Transport (?) Protocol) to a news
 *  server, which must be running the NNTP program.  (The source for
 *  a unix implementation of NNTP is readily and apparently freely
 *  available.)
 *
 *  For more information, see WINVN.WRI and WVDOC.C.
 *
 *  Mark Riordan    September - October 1989    riordanmr@@clvax1.cl.msu.edu
 *  1100 Parker  Lansing, MI  48912
 *  Now being maintained by Sam Rushing, rushing@@titan.ksc.nasa.gov
 */

#include <windows.h>
#include <windowsx.h>
#define WINMAIN
#include "wvglob.h"
#include "winvn.h"
#pragma hdrstop
#include "ctype.h"
#include "defaults.h"   // default profile settings
#include <stdlib.h>

char *CommStrtoID (char *, int *, int *, char *);

/*--- function WinMain -----------------------------------------------
 *
 *  Main program for WinVN.
 *  Initialize, then execute main loop.
 *
 *    Entry    hInstance      is a handle to this instance of execution
 *                            of this program.
 *             hPrevInstance  is a handle to a previous instance
 *                            of execution of this program (usually
 *                            0, i.e., none.  Few people would have
 *                            two copies of WinVN running simultaneously.)
 *             lpCmdLine      points to the command line--currently
 *                            not used.  (Not to useful for Windows programs.)
 *             nCmdShow       is a flag indicating that the main window
 *                            should be displayed.  (Fairly worthless.)
 */

int PASCAL
WinMain (hInstance, hPrevInstance, lpCmdLine, nCmdShow)
     HINSTANCE hInstance;
     HINSTANCE hPrevInstance;
     LPSTR lpCmdLine;
     int nCmdShow;
{        
  HWND hWnd;
  int x,y,width,height;
  char mybuf[MAXINTERNALLINE];


  if (!hPrevInstance)
    if (!WinVnInit (hInstance, lpCmdLine))
      return (0);

  hInst = hInstance;

  /* Initialize the document that will contain the list of          */
  /* newsgroups.  This will be the main window.                     */

  InitDoc (&NetDoc, (HWND) 0, (TypDoc *) NULL, DOCTYPE_NET);

  /* Create and display the main window.  At first, the window      */
  /* just has an initialization message in it.                      */

  /* Compute default window position and size. */
  x = 0;
  y = 0;
  width = (int) (xScreen * 1 / 2);
  height = (int) (yScreen * 9 / 10);

  /* If the window position and size have been saved, use that
   * info instead.
   */
  GetPrivateProfileString (szAppName, "UsenetWindowPos", "!",
    mybuf,MAXINTERNALLINE,szAppProFile);
  if(mybuf[0] != '!') {
    sscanf(mybuf,"%d,%d,%d,%d",&x,&y,&width,&height);
  }

  hWnd = CreateWindow ("WinVn",
             "WinVN -- Usenet News Reader",
             WS_OVERLAPPEDWINDOW | WS_VSCROLL | WS_HSCROLL,
             x,   /* Initial X position */
             y,   /* Initial Y position */
             width,  /* Initial X width */
             height,/* Initial Y height */
             NULL,
             NULL,
             hInstance,
             NULL);

  if (!hWnd)
    return (0);

  SetHandleBkBrush (hWnd, hListBackgroundBrush); 
  SetUserMenus (hWnd, DISABLE);  // menus disabled until connection made

  hWndConf = hWnd;
  NetDoc.hDocWnd = hWnd;   /* mrr */

  /* Make sure we have a host name (JSC) */
  while (NNTPHost[0] == '\0' || !strcmp (NNTPHost, DEF_NNTPHost))
     if (!DialogBox (hInst, (LPCSTR) "WinVnComm", hWndConf, (DLGPROC) lpfnWinVnCommDlg))
       break;


  /* Make sure we have a valid user name (JD) */
  while (UserName[0] == '\0' || !strcmp (UserName, DEF_UserName)
                             || !strcmp (UserName, "Unknown"))
     if (!DialogBox (hInst, (LPCSTR) "WinVnPersonal", hWndConf, (DLGPROC) lpfnWinVnPersonalInfoDlg))
       break;
  
  MoreInit ();

  ShowWindow (hWnd, nCmdShow);

  UpdateWindow (hWnd);
  SendMessage (hWnd, WM_SIZE, 0, 0L);

  /* Read the NEWSRC file and display its contents in the           */
  /* main window.                                                   */

  if (!ReadNewsrc ())
    {
      MessageBox (hWndConf, "Cannot open the NEWSRC file.", "Fatal error", MB_OK | MB_ICONHAND);
      PostQuitMessage (0);
    }

#ifdef WIN32
  /* no MAPI support in win32s */ 
  if (GetVersion() == 1	&& MailForceType == MT_MAPI) {	
     MailForceType = MT_NONE;
     MessageBox(hWndConf, "WinVN does not support MAPI under Win32s", "MAPI Disabled", MB_OK|MB_ICONINFORMATION);
  }
#endif

  Initializing = INIT_NOT_CONNECTED;

  if (ConnectAtStartup)
   Connect ();

  InvalidateRect (hWnd, NULL, TRUE);
  UpdateWindow (hWndConf);

  /* And now for the main loop, which appears in all Windows programs. */
  hAccel = LoadAccelerators (hInstance, "WinVNAccel");

  while (MainLoopPass ());
  return (MainMsg.wParam);
}

/* --- FUNCTION Connect ---------------------------------------------
 * Connect inits comm services and starts connection process
 */
void Connect ()
{
  if (Initializing != INIT_NOT_CONNECTED)
     return;
  
  /* disable the connect menu item during connect attempt */
  SetConnectMenuItem (hWndConf, DISABLE); // connect item has reverse attributes

  Initializing = INIT_ESTAB_CONN;
  InvalidateRect (hWndConf, NULL, TRUE);
  UpdateWindow (hWndConf);
   
  if (MRRInitComm ())   /* Set up communications */
  {
    Initializing = INIT_NOT_CONNECTED;
    SetConnectMenuItem (hWndConf, ENABLE);   // connect item has reverse attributes
    return;
  }
  /* Set up the timer which will wake us up every so often
   * so we can check to see if new characters have arrived from
   * the server.
   */
  idTimer = SetTimer (hWndConf, ID_TIMER , 1000, (TIMERPROC) NULL);

  if (!idTimer)
  {
    MessageBox (hWndConf, "Couldn't create timer!", "Fatal WinVN Error", MB_OK | MB_ICONASTERISK);
    Initializing = INIT_NOT_CONNECTED;
    SetConnectMenuItem (hWndConf, ENABLE);   // connect item has reverse attributes
    return;
  }
  CommDoc = &NetDoc;

  /* MRRInitComm causes CommState to be ST_ESTABLISH_COMM.  DoCommState 
   * begins processing when DoCommInput (started by the timer) sees data
   * from the server.  DoCommState will set Initializing back to 
   * INIT_NOT_CONNECTED if any error.
   * Initializing is INIT_DONE when we're connected and happy
   */
}

/* --- FUNCTION WinVnInit ---------------------------------------------
 *
 *    Initialize the program (first stage).
 *    This routine does some initialization needed before the
 *    creation of the main window.
 *    I put off additional initialization until after the main
 *    window is created.
 *
 *    Entry    hInstance   is a handle to the current instance of
 *                         execution.
 *
 *    Exit     Window classes have been registered, and a small
 *             amount of other window- and comm-related initialization
 *             is done.
 */

BOOL
WinVnInit (HINSTANCE hInstance, LPSTR lpCmdLine )
{
  HANDLE hMemory;
  PWNDCLASS pWndClass;
  HDC hDC;
//  char mesbuf[60];
//  char *errptr;
  BOOL bSuccess;

  Initializing = INIT_READING_NEWSRC;
  CommLineLWAp1 = CommLineIn + MAXCOMMLINE;
  LineHeight = 30;      /* kludge so Net window doesn't get divide-by-zero */

  szAppName = "WinVN";

  // locate newsrc and winvn.ini

  if (fnLocateFiles (hInstance, lpCmdLine))
   return (-1);

  ReadWinvnProfile();

  // obtain point-to-logical-units conversion constants for screen and printer
  hDC = GetDC (hWndConf);
  ScreenYPixels = GetDeviceCaps(hDC, LOGPIXELSY);
  ReleaseDC (hWndConf, hDC);

  LimitedColor = GetDeviceCaps(hDC, RASTERCAPS) & RC_PALETTE;

  PrinterInit();
 
  // initialize fonts
  InitListFonts();
  InitArticleFonts();
//  InitPrintFonts();  
  InitStatusFonts();  
  
  /* Create pointers to the dialog box functions, needed   */
  /* for routine processing of dialog boxes.               */

  lpfnWinVnCommDlg =  (DLGPROC)MakeProcInstance ((FARPROC) WinVnCommDlg, hInstance);
  lpfnWinVnSaveArtDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnSaveArtDlg, hInstance);
  lpfnWinVnSaveArtsDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnSaveArtsDlg, hInstance);
  lpfnWinVnFindDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnFindDlg, hInstance);
  lpfnWinVnGenericDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnGenericDlg, hInstance);
  lpfnWinVnSubjectDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnSubjectDlg, hInstance);
  lpfnWinVnAuthDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnAuthDlg, hInstance);
  lpfnWinVnDoListDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnDoListDlg, hInstance);
  lpfnWinVnPersonalInfoDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnPersonalInfoDlg, hInstance);
  lpfnWinVnMiscDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnMiscDlg, hInstance);
  lpfnWinVnAppearanceDlg = (DLGPROC)MakeProcInstance ((FARPROC)WinVnAppearanceDlg, hInstance);
  lpfnEditSubClass = (DLGPROC)MakeProcInstance((FARPROC) editIntercept, hInst);
  lpfnWinVnThresholdDlg = (DLGPROC)MakeProcInstance ((FARPROC)WinVnThresholdDlg, hInstance);
  lpfnWinVnLogOptDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnLogOptDlg ,hInstance) ;
  lpfnWinVnDecodeArtsDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnDecodeArtsDlg, hInstance);
  lpfnWinVnAttachDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnAttachDlg, hInstance);
  lpfnWinVnEncodeDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnEncodeDlg, hInstance);
  lpfnWinVnSigFileDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnSigFileDlg, hInstance);
  lpfnWinVnExitDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnExitDlg, hInstance);
  lpfnWinVnMailDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnMailDlg, hInstance);
  lpfnWinVnSmartFilerDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnSmartFilerDlg, hInstance);
  lpfnWinVnSelectPathDlg = (DLGPROC)MakeProcInstance ((FARPROC) WinVnSelectPathDlg, hInstance);

  xScreen = GetSystemMetrics (SM_CXSCREEN);
  yScreen = GetSystemMetrics (SM_CYSCREEN);
  CaptionHeight = GetSystemMetrics (SM_CYCAPTION);
  
  CommDoc = &NetDoc;   
  Authenticated = FALSE;

  hListBackgroundBrush = CreateSolidBrush (ListBackgroundColor);
  hArticleBackgroundBrush = CreateSolidBrush (ArticleBackgroundColor);
  hStatusBackgroundBrush = CreateSolidBrush (StatusBackgroundColor);

  hMemory = LocalAlloc (LPTR, sizeof (WNDCLASS));
  pWndClass = (PWNDCLASS) LocalLock (hMemory);
  pWndClass->hCursor = LoadCursor (NULL, IDC_ARROW);
  pWndClass->hIcon = LoadIcon (hInstance, (LPSTR) "winvn");
  pWndClass->lpszMenuName = (LPSTR) "ConfMenu";
  pWndClass->lpszClassName = (LPSTR) "WinVn";
  pWndClass->hbrBackground = GetStockObject (WHITE_BRUSH);
  pWndClass->hInstance = hInstance;
  pWndClass->style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
  pWndClass->lpfnWndProc = WinVnConfWndProc;

  bSuccess = RegisterClass (pWndClass);

  if (bSuccess)
    {
      pWndClass->hCursor = LoadCursor (NULL, IDC_ARROW);
      pWndClass->hIcon = LoadIcon (hInstance, (LPSTR) "wvgroup");
      pWndClass->lpszMenuName = (LPSTR) "ViewMenu";
      pWndClass->lpszClassName = (LPSTR) "WinVnView";
      pWndClass->hbrBackground = GetStockObject (WHITE_BRUSH);
      pWndClass->hInstance = hInstance;
      pWndClass->style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
      pWndClass->lpfnWndProc = WinVnViewWndProc;

      bSuccess = RegisterClass (pWndClass);
    }

  if (bSuccess)
    {
      pWndClass->hCursor = LoadCursor (NULL, IDC_ARROW);
      pWndClass->hIcon = LoadIcon (hInstance, (LPSTR) "wvart");
      pWndClass->lpszMenuName = (LPSTR) "ArtMenu";
      pWndClass->lpszClassName = (LPSTR) "WinVnArt";
      pWndClass->hbrBackground = GetStockObject (WHITE_BRUSH);
      pWndClass->hInstance = hInstance;
      pWndClass->style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
      pWndClass->lpfnWndProc = WinVnArtWndProc;

      bSuccess = RegisterClass (pWndClass);
    }

  if (bSuccess)
    {
      pWndClass->hCursor = LoadCursor (NULL, IDC_ARROW);
      pWndClass->hIcon = LoadIcon (hInstance, (LPSTR) "wvpost");
      pWndClass->lpszMenuName = (LPSTR) "PostMenu";
      pWndClass->lpszClassName = (LPSTR) "WinVnPost";
      pWndClass->hbrBackground = GetStockObject (WHITE_BRUSH);
      pWndClass->hInstance = hInstance;
      pWndClass->style = CS_HREDRAW | CS_VREDRAW;
      pWndClass->lpfnWndProc = WinVnPostWndProc;

      bSuccess = RegisterClass (pWndClass);
    }

  if (bSuccess)
    {
      pWndClass->hCursor = LoadCursor (NULL, IDC_ARROW);
      pWndClass->hIcon = LoadIcon (hInstance, (LPSTR) "wvmail");
      pWndClass->lpszMenuName = (LPSTR) "MailMenu";
      pWndClass->lpszClassName = (LPSTR) "WinVnMail";
      pWndClass->hbrBackground = GetStockObject (WHITE_BRUSH);
      pWndClass->hInstance = hInstance;
      pWndClass->style = CS_HREDRAW | CS_VREDRAW;
      pWndClass->lpfnWndProc = WinVnMailWndProc;

      bSuccess = RegisterClass (pWndClass);
    }
  if (bSuccess)
    {
      pWndClass->hCursor = LoadCursor (NULL, IDC_ARROW);
      pWndClass->hIcon = LoadIcon (hInstance, (LPSTR) "wvcstat2");
      pWndClass->lpszMenuName = (LPSTR) "StatMenu";
      pWndClass->lpszClassName = (LPSTR) "WinVnCoding";
      pWndClass->hbrBackground = GetStockObject (WHITE_BRUSH);
      pWndClass->hInstance = hInstance;
      pWndClass->style = CS_HREDRAW | CS_VREDRAW ;
      pWndClass->lpfnWndProc = WinVnCodingWndProc;

      bSuccess = RegisterClass (pWndClass);
    }
  if (bSuccess)
    {
      pWndClass->hCursor = LoadCursor (NULL, IDC_ARROW);
      pWndClass->hIcon = LoadIcon (hInstance, (LPSTR) "wvcstat1");
      pWndClass->lpszMenuName = NULL;
      pWndClass->lpszClassName = (LPSTR) "WinVnBlockCoding";
      pWndClass->hbrBackground = GetStockObject (WHITE_BRUSH);
      pWndClass->hInstance = hInstance;
      pWndClass->style = CS_HREDRAW | CS_VREDRAW ;
      pWndClass->lpfnWndProc = WinVnCodedBlockWndProc;

      bSuccess = RegisterClass (pWndClass);
    }

  LocalUnlock (hMemory);
  LocalFree (hMemory);
  return (bSuccess);
}

/* --- Function MoreInit -----------------------------------------------
 *
 *    Finish up initializing the program.
 *    I do as much initialization here as possible.  I'd rather
 *    have code run after the main window is created (in WinVNInit),
 *    so I have someplace to display error messages if necessary.
 *
 *    I read quite a few profile strings (from WIN.INI)
 *    here and act appropriately (usually means setting a global variable).
 *    I try to read as many as possible of the profile strings used by this
 *    program here.
 */
BOOL
MoreInit ()
{
  register int j;
  extern char uuTable[CODINGTABLESIZE], xxTable[CODINGTABLESIZE], base64Table[CODINGTABLESIZE];
//  CheckView (hWndConf);     /* modify menu as necessary           */

  /* Initialize some document and article related globals */

  for (j = 0; j < 16; j++)      // set custom colors to white
    CustomColors[j] = RGB(255, 255, 255);

  ActiveGroupDoc = (TypDoc *) NULL;
  ActiveArticleDoc = (TypDoc *) NULL;
  for (j = 0; j < MAXGROUPWNDS; j++)
    GroupDocs[j].InUse = FALSE;
  for (j = 0; j < MAXARTICLEWNDS; j++)
    ArticleDocs[j].InUse = FALSE;

  savingArtIndex = -1;     // reset to non-saving state
  SaveArtFileName[0] = '\0';

  CodingState = INACTIVE;
  CommDecoding = FALSE;

  CreateCodingMap(uuMap, uuTable);
  uuMap[' ']=0;      // decode both quote and space to 0 in UU
  CodingMap[CODE_UU] = uuMap;
  CreateCodingMap(xxMap, xxTable);
  CodingMap[CODE_XX] = xxMap;
  CreateCodingMap(base64Map, base64Table);
  CodingMap[CODE_BASE64] = base64Map;
  // the custom map is just a pointer.  The map is defined if/when a
  // custom table is read in during decoding
  CodingMap[CODE_CUSTOM] = customMap;

  AttachFileName[0]='\0';

  Signature = InitTextBlock (hWndConf);
  if (SigFileName[0] != '\0')
    if (ReadFileToTextBlock (hWndConf, Signature, SigFileName, ADD_PLAIN) == FAIL)
    {
   MessageBox (hWndConf, "Signatures disabled", "Signature File Failure", MB_OK);
   EnableSig = FALSE;
    }
     
  NumGroupWnds = NumArticleWnds = NumPostWnds = NumMailWnds = NumStatusTexts = 0;
  hCodedBlockWnd = NULL;
  for (j = 0; j < MAX_DECODE_THREADS; j++)
    CodingStatusText[j] = NULL;

  return (TRUE);
}


/* --- InitFont Functions -----------------------------------------------
 *    Initialize global fonts and metrics
 * Be sure to delete any existing font objects before replacing them
 * Convert points representation to logical units for sizes
 * JSC 1/10/93
 */
void
InitListFonts ()
{
  TEXTMETRIC tmFontInfo;
  HDC hDC;

  /* Unless user specified the system font, create a font as per
   * the user's specifications.
   */

  if (hListFont)     
   DeleteObject (hListFont);

  if (ListFontSize)
  {
   hListFont = CreateFont 
      (-MulDiv(ListFontSize, ScreenYPixels, 72),
      0, /* width */
      0, /* escapement */
      0, /* orientation */
      strstr (ListFontStyle,"Bold") ? FW_BOLD : FW_MEDIUM,
      (BYTE) (strstr (ListFontStyle,"Italic") ? 1 : 0),
      0, /* no underline */
      0, /* no strikeout */
      0,
      OUT_DEFAULT_PRECIS,
      CLIP_DEFAULT_PRECIS,
      0, /* no PROOF_QUALITY */
      0,
      ListFontFace);
  }
  else
   hListFont = GetStockObject (OEM_FIXED_FONT);

  /*  Get information about the font.  LineHeight and CharWidth
   *  are pretty self-explanatory and the methods of determining these
   *  are standard.  TopSpace and SideSpace are the top and left margins
   *  in pixels; I compute them by a method I determined empirically.
   */

  hDC = GetDC (hWndConf);
  SelectObject (hDC, hListFont);
  GetTextMetrics (hDC, (LPTEXTMETRIC) & tmFontInfo);

  LineHeight = tmFontInfo.tmExternalLeading + tmFontInfo.tmHeight;
  CharWidth = tmFontInfo.tmAveCharWidth;
//TopSpace = tmFontInfo.tmExternalLeading;
  TopSpace = LineHeight / 4;
  StartPen = TopSpace;
  SideSpace = CharWidth / 2;
  ReleaseDC (hWndConf, hDC);
}

void
InitArticleFonts ()
{
  TEXTMETRIC tmFontInfo;
  HDC hDC;
  
  if (hFontArtNormal)      
  {
   DeleteObject (hFontArtNormal);
   DeleteObject (hFontArtQuote);
  }
  if (ArticleFontSize && !ArticleFixedFont)
   {
      hFontArtNormal = CreateFont (
      -MulDiv(ArticleFontSize, ScreenYPixels, 72),
      0, /* width */
      0, /* escapement */
      0, /* orientation */
      strstr (ArticleFontStyle,"Bold") ? FW_BOLD : FW_MEDIUM,
      (BYTE) (strstr (ArticleFontStyle,"Italic") ? 1 : 0),
      0, /* no underline */
      0, /* no strikeout */
      0,
      OUT_DEFAULT_PRECIS,
      CLIP_DEFAULT_PRECIS,
      0, /* no PROOF_QUALITY */
      0,
      ArticleFontFace);

     hFontArtQuote = CreateFont (
      -MulDiv(ArticleFontSize, ScreenYPixels, 72),
      0, /* width */
      0, /* escapement */
      0, /* orientation */
      strstr (ArticleFontStyle,"Bold") ? FW_BOLD : FW_MEDIUM,
      (BYTE) (strstr (ArticleFontStyle,"Italic") ? 0 : 1),  // opposite to above italics
      0, /* no underline */
      0, /* no strikeout */
      0,
      OUT_DEFAULT_PRECIS,
      CLIP_DEFAULT_PRECIS,
      0, /* no PROOF_QUALITY */
      0,
      ArticleFontFace);
   }
   else if (ArticleFixedFont)
   {
      hFontArtNormal  = GetStockObject (ANSI_FIXED_FONT);
      hFontArtQuote = GetStockObject (ANSI_FIXED_FONT);
   }
   else
   {
      hFontArtNormal = hListFont;
      hFontArtQuote = hListFont;
   }

  hDC = GetDC (hWndConf);
  SelectObject (hDC, hFontArtNormal);
  GetTextMetrics (hDC, (LPTEXTMETRIC) & tmFontInfo);
  
  ArtLineHeight = tmFontInfo.tmExternalLeading + tmFontInfo.tmHeight;
  ArtCharWidth = tmFontInfo.tmAveCharWidth;

  SelectObject (hDC, hFontArtQuote);
  GetTextMetrics (hDC, (LPTEXTMETRIC) & tmFontInfo);

  ArtLineHeight = max (ArtLineHeight, tmFontInfo.tmExternalLeading + tmFontInfo.tmHeight);
  ArtCharWidth = max (ArtCharWidth, tmFontInfo.tmAveCharWidth);

  ArtTopSpace = ArtLineHeight / 4;
  ArtSideSpace = ArtCharWidth / 2;

  ReleaseDC (hWndConf, hDC);
}

void
InitStatusFonts ()
{
  TEXTMETRIC tmFontInfo;
  HDC hDC;

  /* Unless user specified the system font, create a font as per
   * the user's specifications.
   */

  if (hStatusFont)      
   DeleteObject (hStatusFont);

  if (StatusFontSize)
   {
      hStatusFont = CreateFont 
      (-MulDiv(StatusFontSize, ScreenYPixels, 72),
      0, /* width */
      0, /* escapement */
      0, /* orientation */
      strstr (StatusFontStyle,"Bold") ? FW_BOLD : FW_MEDIUM,
      (BYTE) (strstr (StatusFontStyle,"Italic") ? 1 : 0),
      0, /* no underline */
      0, /* no strikeout */
      0,
      OUT_DEFAULT_PRECIS,
      CLIP_DEFAULT_PRECIS,
      0, /* no PROOF_QUALITY */
      0,
      StatusFontFace);
   }
   else
      hStatusFont = GetStockObject (OEM_FIXED_FONT);

  /*  Get information about the font.  LineHeight and CharWidth
   *  are pretty self-explanatory and the methods of determining these
   *  are standard.  TopSpace and SideSpace are the top and left margins
   *  in pixels; I compute them by a method I determined empirically.
   */

  hDC = GetDC (hWndConf);
  SelectObject (hDC, hStatusFont);
  GetTextMetrics (hDC, (LPTEXTMETRIC) & tmFontInfo);

  StatusLineHeight = tmFontInfo.tmExternalLeading + tmFontInfo.tmHeight;
  StatusCharWidth = tmFontInfo.tmAveCharWidth;
  ReleaseDC (hWndConf, hDC);
}

void
InitPrintFonts ()
 { 
  HDC hDC;
  if (hFontPrint)    
   {
     DeleteObject (hFontPrint);
     DeleteObject (hFontPrintB);
     DeleteObject (hFontPrintI);
     DeleteObject (hFontPrintS);
    } 

  hDC = (pd.hDC) ? pd.hDC : GetPrinterDC (NULL);  
  PrinterYPixels = GetDeviceCaps(hDC, LOGPIXELSY);
  if (!pd.hDC) DeletePrinterDC (hDC);
  
  if (PrintFontSize)
   {
    hFontPrint = CreateFont (
            -MulDiv(PrintFontSize, PrinterYPixels, 72),
              0,     /* width */
         0, /* escapement */
         0, /* orientation */
         FW_MEDIUM,
         0, /* no italics */
         0, /* no underline */
         0, /* no strikeout */
         0,
         OUT_DEFAULT_PRECIS,     
         CLIP_DEFAULT_PRECIS,
         0, /* no PROOF_QUALITY */
         0,
         PrintFontFace);

    hFontPrintB = CreateFont (
         -MulDiv(PrintFontSize, PrinterYPixels, 72),
         0,     /* width */
         0, /* escapement */
         0, /* orientation */
         FW_BOLD,
         0, /* no italics */
         0, /* no underline */
         0, /* no strikeout */
         0,
         OUT_DEFAULT_PRECIS,
         CLIP_DEFAULT_PRECIS,
         0, /* no PROOF_QUALITY */
         0,
         PrintFontFace);

    hFontPrintI = CreateFont (
         -MulDiv((int)(0.9*PrintFontSize), PrinterYPixels, 72),
         0,     /* width */
         0, /* escapement */
         0, /* orientation */
         FW_LIGHT,
         1, /* italics */
         0, /* no underline */
         0, /* no strikeout */
         0,
         OUT_DEFAULT_PRECIS,
         CLIP_DEFAULT_PRECIS,
         0, /* no PROOF_QUALITY */
         0,
         PrintFontFace);

      hFontPrintS = CreateFont (
         -MulDiv((int)(1.5*PrintFontSize), PrinterYPixels, 72),
         0,     /* width */
         0, /* escapement */
         0, /* orientation */
         FW_EXTRABOLD,     
         0, /* no italics */
         1, /* underline */
         0, /* no strikeout */
         0,
         OUT_DEFAULT_PRECIS,
         CLIP_DEFAULT_PRECIS,
         0, /* no PROOF_QUALITY */
         0,
         PrintFontFace);
   }
  else
   {
     hFontPrint = CreateFont (   
            -MulDiv(8, PrinterYPixels, 72),
   //    40,    /* default Font Size */
         0,     /* width */
         0, /* escapement */
         0, /* orientation */
         FW_MEDIUM,
         0, /* no italics */
         0, /* no underline */
         0, /* no strikeout */
         0,
         OUT_DEFAULT_PRECIS,
         CLIP_DEFAULT_PRECIS,
         0, /* no PROOF_QUALITY */
         0,
         0);    /* Default Font Face */

     hFontPrintB = CreateFont (
            -MulDiv(8, PrinterYPixels, 72),
   //    40,    /* default font size */
         0,     /* width */
         0, /* escapement */
         0, /* orientation */
         FW_BOLD,
         0, /* no italics */
         0, /* no underline */
         0, /* no strikeout */
         0,
         OUT_DEFAULT_PRECIS,
         CLIP_DEFAULT_PRECIS,
         0, /* no PROOF_QUALITY */
         0,
         0);    /* default font face */

   hFontPrintI = CreateFont (  
            -MulDiv((int)(0.9 * 8), PrinterYPixels, 72),
   //    36,    /* default font size */
         0,     /* width */
         0, /* escapement */
         0, /* orientation */
         FW_LIGHT,
         1, /* italics */
         0, /* no underline */
         0, /* no strikeout */
         0,
         OUT_DEFAULT_PRECIS,
         CLIP_DEFAULT_PRECIS,
         0, /* no PROOF_QUALITY */
         0,
         0);    /* default font face */

   hFontPrintS = CreateFont (
            -MulDiv(8, PrinterYPixels, 72),
   //    60,
         0,     /* width */
         0, /* escapement */
         0, /* orientation */
         FW_EXTRABOLD,
         0, /* no italics */
         1, /* underline */
         0, /* no strikeout */
         0,
         OUT_DEFAULT_PRECIS,
         CLIP_DEFAULT_PRECIS,
         0, /* no PROOF_QUALITY */
         0,
         "Arial");
   }
}

void
DestroyFonts()
{
      if (hListFont) DeleteObject(hListFont);
      if (hFontArtNormal) DeleteObject(hFontArtNormal);
      if (hFontArtQuote) DeleteObject(hFontArtQuote);
      if (hStatusFont) DeleteObject(hStatusFont);
      if (hFontPrint) DeleteObject(hFontPrint);
      if (hFontPrintB) DeleteObject(hFontPrintB);
      if (hFontPrintS) DeleteObject(hFontPrintS);
      if (hFontPrintI) DeleteObject(hFontPrintI);   
}

/*-------------------------------------------------------------
 *
 *  Bitmap resource handlers
 *  jsc 9/10/94
 */
void
InitBitmaps()
{
	register int i;

    // Load drive and folder bitmaps
    for (i=IDB_DRIVEMIN; i<=IDB_DRIVEMAX; i++)
        DiskBitmaps[i-IDB_DRIVEMIN]=LoadBitmap(hInst, MAKEINTRESOURCE(i));

    for (i=IDB_FOLDERMIN; i<=IDB_FOLDERMAX; i++)
        FolderBitmaps[i-IDB_FOLDERMIN]=LoadBitmap(hInst, MAKEINTRESOURCE(i));

}

void
DestroyBitmaps()
{
	register int i;
	for (i=IDB_DRIVEMIN; i<=IDB_DRIVEMAX; i++)
	    if (DiskBitmaps[i-IDB_DRIVEMIN]) 
	    	DeleteObject(DiskBitmaps[i-IDB_DRIVEMIN]);
	
	for (i=IDB_FOLDERMIN; i<=IDB_FOLDERMAX; i++)
	    if (FolderBitmaps[i-IDB_FOLDERMIN])
	    	DeleteObject(FolderBitmaps[i-IDB_FOLDERMIN]);
}

/*--- Function WinVnDoComm  -----------------------------------
 *
 *  Set communications parameters.
 *
 *  Entry    szComm         is a string equivalent to that on a MODE statement.
 *                          E.g.,  "COM1:2400,n,8"
 */
int
WinVnDoComm (szComm)
     char *szComm;
{
  int retcode;
  char mesbuf[60];

  if (retcode = BuildCommDCB (szComm, (DCB FAR *) & DCBComm))
    {
      sprintf (mesbuf, "BuildComm returned %d", retcode);
      MessageBox (hWndConf, mesbuf, "Error building COM1 DCB", MB_OK | MB_ICONEXCLAMATION);
    }
  else
    {
      //SetCommState ((DCB FAR *) & DCBComm);
    }
  return (retcode);
}

/*--- Function CommStrtoID --------------------------------------
 *
 *   Takes a communications string of the form given to the MODE command
 *   and breaks it down to its constituent parts.
 *
 *   Entry    CommStr    is the string; e.g., "COM1:2400,n,8"
 *
 *   Exit     *Port      is the port (an IDD_* variable)
 *            *Parity    is the parity/data bits infor (an IDD_* symbol)
 *            szSpeed    is the speed, in character form
 *            CommStr    has been converted to upper case.
 *            Function value NULL if no error, else a pointer
 *             to an error message.
 */
char *
CommStrtoID (CommStr, Port, Parity, szSpeed)
     char *CommStr;
     int *Port, *Parity;
     char *szSpeed;
{
  char *ptr, *Speedptr;

  strupr (CommStr);
  ptr = CommStr;

  while (*(ptr) == ' ')
    ptr++;

  /* Crack the "COMx" part of the string.                           */

  if (strncmp (ptr, "COM", 3) != 0)
    return ("Must be COM port");
  ptr += 3;

  if (*ptr == '1')
    {
      *Port = IDD_COM1;
    }
  else if (*ptr == '2')
    {
      *Port = IDD_COM2;
    }
  else
    {
      return ("COM port must be 1 or 2");
    }

  /* Crack the speed parameter.                                     */

  ptr += 2;
  while (*ptr == ' ')
    ptr++;
  for (Speedptr = szSpeed; isdigit (*ptr); *(Speedptr++) = *(ptr++));
  *Speedptr = '\0';

  if (szSpeed == Speedptr)
    {
      return ("Non-numeric COM speed");
    }

  while (isdigit (*ptr) || *ptr == ' ' || *ptr == ',')
    ptr++;

  /* Crack the parity parameter.                                    */

  if (*ptr == 'N')
    {
      *Parity = IDD_8NONE;
    }
  else if (*ptr == 'E')
    {
      *Parity = IDD_7EVEN;
    }
  else
    {
      return ("Bad parity");
    }

  return (NULL);
}

/*--- function MainLoopPass ---------------------------------------------
 *
 *    Do one pass of the main loop.
 *
 *    Entry
 *
 *    Exit     returns result of GetMessage()
 */
BOOL
MainLoopPass ()
{
  BOOL NoQuit;

  if (NoQuit = GetMessage (&MainMsg, NULL, NULL, NULL))
    {
      if (!TranslateAccelerator (MainMsg.hwnd, hAccel, &MainMsg))
      {
        TranslateMessage (&MainMsg);
        DispatchMessage (&MainMsg);
      }
    }
  return (NoQuit);
}


/*--- function ReadWinvnProfile -----------------------------------------
 *
 *    Read the profile values into global vars 
 *    (JSC 1/8/94)
 */
// section headings (globals)
char OLD[6]="winvn";
char COMM[15]="Communications";
char AUTH[14]="Authorization";
char INTERFACE[10]="Interface";
char PERSONAL[9]="Personal";
char PREF[12]="Preferences";
char CODING[7]="Coding";
char MAIL_ADDRESSES[15]="Mail Addresses";
char INTERNATIONAL[5]="intl";
char SMARTFILER[12]="Smart Filer";
char SEARCHES[9]="Searches";

void 
ReadWinvnProfile ()
{
  char buf[MAXINTERNALLINE];
  char *ptr;
  int j;

  /* mail address list */
  MailList = InitTextBlock (hWndConf);
  for (j = 1;; j++)
  {
    sprintf (str, "Address%d", j);
    GetPrivateProfileString (MAIL_ADDRESSES, str, "", buf, MAILLEN, szAppProFile);
    if (!strcmp(buf, ""))
      break;
    AddLineToTextBlock (MailList, buf);
  }
  MailListOrigNum = (int)MailList->numLines;
  
  /* smart filer extension list  -- jsc 9/10/94 */
  ExtMapSourceList = InitTextBlock (hWndConf);
  ExtMapDosList = InitTextBlock (hWndConf);
  for (j = 1;; j++)
  {
    sprintf (str, "ExtConvert%d", j);
    GetPrivateProfileString (SMARTFILER, str, "", buf, MAXINTERNALLINE, szAppProFile);
    if (!strcmp(buf, ""))
      break;
    if ((ptr = strchr(buf, ',')) != NULL)
    {
       *ptr = NULL; /* replace comma with null */
       ptr++;       /* skip comma, and any whitespace */
       while (*ptr && isspace(*ptr)) ++ptr;
       /* only add entries to lists if we had two tokens, comma-separated  */
       if (*ptr) {
          AddLineToTextBlock (ExtMapSourceList, buf);
          AddLineToTextBlock (ExtMapDosList, ptr);
       }
    }
  }
  ExtListOrigNum = (int)ExtMapSourceList->numLines;

  /* test for existence of Comm section in ini file
   * if doesn't exist, we need to upgrade this user's INI file
   */
  if (GetPrivateProfileString (COMM, NULL, "", buf, MAXINTERNALLINE, szAppProFile) == 0)
  {
   UpdateWinvnProfile();
   return;
  }

  GetPrivateProfileString (PERSONAL, "UserName", DEF_UserName, UserName, MAILLEN, szAppProFile);
  GetPrivateProfileString (PERSONAL, "MailAddress", DEF_MailAddr, MailAddress, MAILLEN, szAppProFile);
  GetPrivateProfileString (PERSONAL, "Organization", DEF_Organization, Organization, MAILLEN, szAppProFile);
  GetPrivateProfileString (PERSONAL, "ReplyTo", DEF_ReplyTo, ReplyTo, MAILLEN, szAppProFile);

  UsingSocket =
     GetPrivateProfileInt (COMM, "UseSocket", DEF_UsingSocket, szAppProFile);
  GetPrivateProfileString (COMM, "NNTPHost", DEF_NNTPHost, NNTPHost, MAXNNTPSIZE, szAppProFile);
  GetPrivateProfileString (COMM, "SMTPHost", DEF_SMTPHost, SMTPHost, MAXNNTPSIZE, szAppProFile);
  GetPrivateProfileString (COMM, "NNTPService", DEF_NNTPService, NNTPService, MAXNNTPSIZE, szAppProFile);
  DebugComm = 
     GetPrivateProfileInt (COMM, "DebugComm", DEF_DebugComm, szAppProFile);
  
  MailDemandLogon = 
     GetPrivateProfileInt (COMM, "MailDemandLogon", DEF_MailDemandLogon, szAppProFile);
  MailForceType = 
     GetPrivateProfileInt (COMM, "MailForceType", DEF_MailForceType, szAppProFile);

  GetPrivateProfileString (AUTH, "NNTPUserName", DEF_NNTPUserName, NNTPUserName, MAXNNTPSIZE, szAppProFile);
  GetPrivateProfileString (AUTH, "NNTPPassword", DEF_NNTPPassword, NNTPPasswordEncrypted, 2*MAXNNTPSIZE, szAppProFile);
  AuthReqPost = GetPrivateProfileInt (AUTH, "AuthReqPost", DEF_AuthReqPost, szAppProFile);
  AuthReqMail = GetPrivateProfileInt (AUTH, "AuthReqMail", DEF_AuthReqMail, szAppProFile);

  GetPrivateProfileString (COMM, "GenSockDLL", DEF_GenSockDLL, GenSockDLL, MAXFILENAME+1,szAppProFile);

  force_xhdr =
    GetPrivateProfileInt (COMM, "ForceXhdr", DEF_ForceXhdr, szAppProFile);

  threadp =
    GetPrivateProfileInt (PREF, "EnableThreading", DEF_EnableThreading, szAppProFile);
  GetPrivateProfileString (PREF, "SignatureFile", DEF_SignatureFile, SigFileName, MAXFILENAME+1,szAppProFile);

  EnableSig =
     GetPrivateProfileInt (PREF, "EnableSignature", DEF_EnableSignature, szAppProFile);

  MailLog = 
     GetPrivateProfileInt (PREF, "MailLog", DEF_MailLog, szAppProFile);
  GetPrivateProfileString (PREF, "MailLogFile" , DEF_MailLogFile, MailLogFile, MAXFILENAME, szAppProFile);
  PostLog = 
     GetPrivateProfileInt (PREF, "PostLog", DEF_PostLog, szAppProFile);
  GetPrivateProfileString (PREF, "PostLogFile" ,DEF_PostLogFile, PostLogFile, MAXFILENAME, szAppProFile);

  DoList = 
     GetPrivateProfileInt (PREF, "DoList", DEF_DoList,szAppProFile);
  ConnectAtStartup =
     GetPrivateProfileInt (PREF, "ConnectAtStartup", DEF_ConnectAtStartup, szAppProFile);
  FullNameFrom = 
     GetPrivateProfileInt (PREF, "FullNameFrom", DEF_FullNameFrom, szAppProFile);
  article_threshold = 
     GetPrivateProfileUInt (PREF, "ArticleThreshold", DEF_ArticleThreshold, szAppProFile);
  ShowUnsubscribed = 
     GetPrivateProfileInt (PREF, "ShowUnsubscribed",DEF_ShowUnsubscribed, szAppProFile); 
  ShowReadArticles = 
     GetPrivateProfileInt (PREF,"ShowReadArticles", DEF_ShowReadArticles, szAppProFile);
  ConfirmBatchOps = 
     GetPrivateProfileInt (PREF,"ConfirmBatchOps", DEF_ConfirmBatchOps, szAppProFile);
  ConfirmExit = 
     GetPrivateProfileInt (PREF,"ConfirmExit", DEF_ConfirmExit, szAppProFile);
  ConfirmReplyTo =
     GetPrivateProfileInt (PREF,"ConfirmReplyTo", DEF_ConfirmReplyTo, szAppProFile);
  CcByMail =
     GetPrivateProfileInt (PREF,"CcByMail", DEF_CcByMail, szAppProFile);
  ViewNew = 
     GetPrivateProfileInt (PREF, "NewWndGroup", DEF_NewWndGroup, szAppProFile);
  NewArticleWindow = 
     GetPrivateProfileInt (PREF, "NewWndArticle", DEF_NewWndArticle, szAppProFile);
  SaveArtAppend = 
     GetPrivateProfileInt (PREF, "SaveArtAppend", DEF_SaveArtAppend, szAppProFile);
  ShowUnreadOnly = 
     GetPrivateProfileInt (PREF, "ShowUnreadOnly",DEF_ShowUnreadOnly, szAppProFile); 

  ThreadFullSubject = 
    GetPrivateProfileInt (PREF, "ThreadFullSubject", DEF_ThreadFullSubject, szAppProFile);

  GroupMultiSelect = 
    GetPrivateProfileInt (PREF, "GroupMultiSelect", DEF_ThreadFullSubject, szAppProFile);

  GetPrivateProfileString (CODING, "DecodePath", DEF_DecodePath, DecodePathName, MAXFILENAME, szAppProFile);
  CodingStatusVerbose = 
     GetPrivateProfileInt (CODING, "CodingStatusVerbose", DEF_CodingStatusVerbose, szAppProFile);
  BlockCodingStatusAlwaysOnTop =
     GetPrivateProfileInt (CODING, "BlockCodingStatusAlwaysOnTop", DEF_BlockCodingStatusAlwaysOnTop, szAppProFile);

  DumbDecode = 
     GetPrivateProfileInt (CODING, "DumbDecode", DEF_DumbDecode, szAppProFile);
  ReviewAttach = 
     GetPrivateProfileInt (CODING, "ReviewAttach", DEF_ReviewAttach, szAppProFile);
  ArticleSplitLength = 
      GetPrivateProfileUInt (CODING, "ArticleSplitLength", (unsigned int) DEF_ArticleSplitLength, szAppProFile);
  GetPrivateProfileString (CODING, "EncodingTable", DEF_EncodingTable, UserCodingTable, CODINGTABLESIZE+1, szAppProFile);
  GetPrivateProfileString (CODING, "SubjectTemplate", "%s  -  %f [%p/%t]", SubjectTemplate, CODINGTABLESIZE+1, szAppProFile);
  GenerateMIME = 
     GetPrivateProfileInt (CODING, "GenerateMIME", DEF_GenerateMIME, szAppProFile);
  MIMEUsageSuggestions = 
     GetPrivateProfileInt (CODING, "MIMEUsageSuggestions", DEF_MIMEUsageSuggestions, szAppProFile);
  GetPrivateProfileString (CODING, "MIMEBoundary",DEF_MIMEBoundary, MIMEBoundary, MAXINTERNALLINE, szAppProFile);
  BlankBeforeMIME =
     GetPrivateProfileInt (CODING, "BlankBeforeMIME", DEF_BlankBeforeMIME, szAppProFile);
  GetPrivateProfileString (CODING, "EncodingType", DEF_EncodingType, EncodingType, MAXINTERNALLINE, szAppProFile);
  EncodingTypeNum = EncodingTypeToNum (EncodingType);
  GetPrivateProfileString (CODING, "MIMEUUType", DEF_MIMEUUType, MIMEUUType, 80, szAppProFile);
  GetPrivateProfileString (CODING, "MIMEXXType", DEF_MIMEXXType, MIMEXXType, 80, szAppProFile);
  GetPrivateProfileString (CODING, "MIMECustomType", DEF_MIMECustomType, MIMECustomType, 80, szAppProFile);
  
  GetPrivateProfileString (CODING, "DefaultContentType",DEF_DefaultContentType, DefaultContentType, MAXINTERNALLINE, szAppProFile);
  AttachInNewArt =
     GetPrivateProfileInt (CODING, "AttachInNewArt", DEF_AttachInNewArt, szAppProFile);
  ExecuteDecodedFiles =
     GetPrivateProfileInt (CODING, "ExecuteDecodedFiles", DEF_ExecuteDecodedFiles, szAppProFile);
  KeepArticleHeaderVisible =
     GetPrivateProfileInt (CODING, "KeepArticleHeaderVisible", DEF_KeepArticleHeaderVisible, szAppProFile);
  UseSmartFiler =
     GetPrivateProfileInt (CODING, "UseSmartFiler", DEF_UseSmartFiler, szAppProFile);

  GetPrivateProfileString (INTERFACE, "ListFontFace", DEF_ListFontFace, ListFontFace, 32,szAppProFile);
  ListFontSize = 
     GetPrivateProfileInt (INTERFACE, "ListFontSize", DEF_ListFontSize, szAppProFile);
  GetPrivateProfileString (INTERFACE, "ListFontStyle", DEF_ListFontStyle, ListFontStyle, 32, szAppProFile);
//  FontBold = 
//     GetPrivateProfileInt (INTERFACE, "FontBold", TRUE, szAppProFile);
  GetPrivateProfileString (INTERFACE, "ArticleFontFace", DEF_ArticleFontFace, ArticleFontFace, 32, szAppProFile);
  ArticleFontSize = 
     GetPrivateProfileInt (INTERFACE, "ArticleFontSize", DEF_ArticleFontSize, szAppProFile);
  GetPrivateProfileString (INTERFACE, "ArticleFontStyle", DEF_ArticleFontStyle, ArticleFontStyle, 32, szAppProFile);
  GetPrivateProfileString (INTERFACE, "StatusFontFace", DEF_StatusFontFace, StatusFontFace, 32, szAppProFile);
  StatusFontSize = 
     GetPrivateProfileInt (INTERFACE, "StatusFontSize", DEF_StatusFontSize, szAppProFile);
  GetPrivateProfileString (INTERFACE, "StatusFontStyle", DEF_StatusFontStyle, StatusFontStyle, 32, szAppProFile);
  GetPrivateProfileString (INTERFACE, "PrintFontFace", DEF_PrintFontFace, PrintFontFace, 32, szAppProFile);
  PrintFontSize = 
     GetPrivateProfileInt (INTERFACE, "PrintFontSize", DEF_PrintFontSize, szAppProFile);
//  ArticleFixedFont = 
//     GetPrivateProfileInt (INTERFACE, "ArticleFixedFont", FALSE, szAppProFile);
  ArticleFixedFont = 0;
  GetPrivateProfileString (INTERFACE, "NetUnSubscribedColor", DEF_NetUnSubscribedColor, buf, 32, szAppProFile);
  NetUnSubscribedColor = StrToRGB (buf);
  GetPrivateProfileString (INTERFACE, "NetSubscribedColor", DEF_NetSubscribedColor, buf, 32, szAppProFile);
  NetSubscribedColor = StrToRGB (buf);
  GetPrivateProfileString (INTERFACE, "ArticleUnSeenColor", DEF_ArticleUnSeenColor, buf, 32, szAppProFile);
  ArticleUnSeenColor = StrToRGB (buf);
  GetPrivateProfileString (INTERFACE, "ArticleSeenColor", DEF_ArticleSeenColor, buf, 32, szAppProFile);
  ArticleSeenColor = StrToRGB (buf);
  GetPrivateProfileString (INTERFACE, "ArticleTextColor", DEF_ArticleTextColor, buf, 32, szAppProFile);
  ArticleTextColor = StrToRGB (buf);
  GetPrivateProfileString (INTERFACE, "StatusTextColor", DEF_StatusTextColor, buf, 32, szAppProFile);
  StatusTextColor = StrToRGB (buf);
  GetPrivateProfileString (INTERFACE, "ArticleBackgroundColor", DEF_ArticleBackgroundColor, buf, 32, szAppProFile);
  ArticleBackgroundColor = StrToRGB (buf);
  GetPrivateProfileString (INTERFACE, "ListBackgroundColor", DEF_ListBackgroundColor, buf, 32, szAppProFile);
  ListBackgroundColor = StrToRGB (buf);
  GetPrivateProfileString (INTERFACE, "StatusBackgroundColor", DEF_StatusBackgroundColor, buf, 32, szAppProFile);
  StatusBackgroundColor = StrToRGB (buf);
  ThumbTrack = 
     GetPrivateProfileInt (INTERFACE, "ThumbTrack", DEF_ThumbTrack, szAppProFile);

  GetPrivateProfileString (SEARCHES, "LastArticleTextFind", "", LastArticleTextFind, MAXINTERNALLINE, szAppProFile);
  GetPrivateProfileString (SEARCHES, "LastArticleHeaderFind", "", LastArticleHeaderFind, MAXINTERNALLINE, szAppProFile);
  GetPrivateProfileString (SEARCHES, "LastGroupNameFind", "", LastGroupNameFind, MAXINTERNALLINE, szAppProFile);

  OnDupeName = 
     GetPrivateProfileInt (SMARTFILER, "OnDupeName", DEF_OnDupeName, szAppProFile);
  OnNameTooLong = 
     GetPrivateProfileInt (SMARTFILER, "OnNameTooLong", DEF_OnNameTooLong, szAppProFile);
  MaxFileNameLen = 
     GetPrivateProfileInt (SMARTFILER, "MaxFileNameLen", DEF_MaxFileNameLen, szAppProFile);
  MaxFileExtLen = 
     GetPrivateProfileInt (SMARTFILER, "MaxFileExtLen", DEF_MaxFileExtLen, szAppProFile);
  EnableExtensionConversion =
     GetPrivateProfileInt (SMARTFILER, "EnableExtensionConversion", DEF_EnableExtensionConversion, szAppProFile);


  // The following is in WIN.INI (??)
  GetProfileString (INTERNATIONAL, "sDate", "." ,fmtDateDelim ,2 );
//  fmtDateDelim[1]=0 ;
   fmtDaysB4Mth = (1 == GetProfileInt (INTERNATIONAL,"iDate", 0 /* US Date Format*/));

  
#if 0
// Disabled serial comm stuff
  AskComm = 
     GetPrivateProfileInt (COMM, "AskComm", ASK_COMM_INITIAL, szAppProFile);
  GetPrivateProfileString (COMM, "CommString", "COM1:9600,e,7", szCommString, MAXCOMMCHARS,szAppProFile);
  errptr = CommStrtoID (szCommString, &CommPortID, &CommParityID, pszCommSpeed);
  if (errptr)
    {
      strcpy (mesbuf, "Error parsing ");
      strcat (mesbuf, szCommString);
      MessageBox (hWndConf, errptr, mesbuf, MB_OK | MB_ICONEXCLAMATION);
    }
#endif
}

/*--- function WriteWinvnProfile -----------------------------------------
 *
 *    Write the values modifiable in WinVn menus to the profile 
 *    (JSC 1/8/94)
 */
void 
WriteWinvnProfile ()
{
  char buf[MAXINTERNALLINE];
  register int j;
  
  WritePrivateProfileString (PERSONAL, "UserName", UserName, szAppProFile);
  WritePrivateProfileString (PERSONAL, "MailAddress", MailAddress, szAppProFile);
  WritePrivateProfileString (PERSONAL, "Organization", Organization, szAppProFile);
  WritePrivateProfileString (PERSONAL, "ReplyTo", ReplyTo, szAppProFile);

//WritePrivateProfileInt    (COMM, "AskComm", AskComm, szAppProFile);
//WritePrivateProfileString (COMM, "CommString", szCommString, szAppProFile);
  WritePrivateProfileInt    (COMM, "UseSocket", UsingSocket, szAppProFile);
  WritePrivateProfileString (COMM, "NNTPHost", NNTPHost, szAppProFile);
  WritePrivateProfileString (COMM, "SMTPHost", SMTPHost, szAppProFile);
  WritePrivateProfileString (COMM, "NNTPService", NNTPService, szAppProFile);
  WritePrivateProfileInt    (COMM, "MailDemandLogon", MailDemandLogon, szAppProFile);
  WritePrivateProfileInt    (COMM, "MailForceType", MailForceType, szAppProFile);
  WritePrivateProfileInt    (COMM, "DebugComm", DebugComm, szAppProFile);
  WritePrivateProfileString (COMM, "GenSockDLL", GenSockDLL, szAppProFile);
  
  WritePrivateProfileString (AUTH, "NNTPUserName", NNTPUserName, szAppProFile);
  WritePrivateProfileString (AUTH, "NNTPPassword", NNTPPasswordEncrypted, szAppProFile);

  WritePrivateProfileInt    (PREF, "EnableThreading", threadp, szAppProFile);
  WritePrivateProfileString (PREF, "SignatureFile", SigFileName, szAppProFile);
  WritePrivateProfileInt    (PREF, "EnableSignature", EnableSig, szAppProFile);
//  WritePrivateProfileString (PREF, "MailListFile", MailFileName, szAppProFile);

  WritePrivateProfileInt    (PREF, "MailLog", MailLog, szAppProFile);
  WritePrivateProfileString (PREF, "MailLogFile", MailLogFile, szAppProFile);
  WritePrivateProfileInt    (PREF, "PostLog", PostLog, szAppProFile);
  WritePrivateProfileString (PREF, "PostLogFile", PostLogFile, szAppProFile);

  WritePrivateProfileInt    (PREF, "DoList", DoList, szAppProFile);
  WritePrivateProfileInt    (PREF, "ConnectAtStartup", ConnectAtStartup, szAppProFile);
  WritePrivateProfileInt    (PREF, "FullNameFrom", FullNameFrom, szAppProFile);
  WritePrivateProfileUInt   (PREF, "ArticleThreshold", article_threshold, szAppProFile);
  WritePrivateProfileInt    (PREF, "ShowUnsubscribed", ShowUnsubscribed, szAppProFile);
  WritePrivateProfileInt    (PREF, "ShowReadArticles", ShowReadArticles, szAppProFile);
  WritePrivateProfileInt    (PREF, "ConfirmBatchOps", ConfirmBatchOps, szAppProFile);
  WritePrivateProfileInt    (PREF, "ConfirmExit", ConfirmExit, szAppProFile);
  WritePrivateProfileInt    (PREF, "ConfirmReplyTo", ConfirmReplyTo, szAppProFile);
  WritePrivateProfileInt    (PREF, "CcByMail", CcByMail, szAppProFile);
  WritePrivateProfileInt    (PREF, "NewWndGroup", ViewNew, szAppProFile);
  WritePrivateProfileInt    (PREF, "NewWndArticle", NewArticleWindow, szAppProFile);
  WritePrivateProfileInt    (PREF, "SaveArtAppend", SaveArtAppend, szAppProFile);
  WritePrivateProfileInt    (PREF, "ThreadFullSubject", ThreadFullSubject, szAppProFile);
  WritePrivateProfileInt    (PREF, "GroupMultiSelect", GroupMultiSelect, szAppProFile);
  WritePrivateProfileInt    (PREF, "ShowUnreadOnly", ShowUnreadOnly, szAppProFile);

  WritePrivateProfileString (CODING, "DecodePath", DecodePathName, szAppProFile);
  WritePrivateProfileInt    (CODING, "CodingStatusVerbose", CodingStatusVerbose, szAppProFile);
  WritePrivateProfileInt    (CODING, "BlockCodingStatusAlwaysOnTop", BlockCodingStatusAlwaysOnTop, szAppProFile);
  WritePrivateProfileInt    (CODING, "DumbDecode", DumbDecode, szAppProFile);
  WritePrivateProfileInt    (CODING, "ReviewAttach", ReviewAttach, szAppProFile);
  WritePrivateProfileInt    (CODING, "AttachInNewArt", AttachInNewArt, szAppProFile);
  WritePrivateProfileInt    (CODING, "ExecuteDecodedFiles", ExecuteDecodedFiles, szAppProFile);
  WritePrivateProfileInt    (CODING, "KeepArticleHeaderVisible", KeepArticleHeaderVisible, szAppProFile);
  WritePrivateProfileInt    (CODING, "UseSmartFiler", UseSmartFiler, szAppProFile);
  WritePrivateProfileUInt   (CODING, "ArticleSplitLength", ArticleSplitLength, szAppProFile);
  WritePrivateProfileString (CODING, "EncodingType", EncodingType, szAppProFile);
  WritePrivateProfileString (CODING, "EncodingTable", UserCodingTable, szAppProFile);
  WritePrivateProfileString (CODING, "SubjectTemplate", SubjectTemplate, szAppProFile);
  WritePrivateProfileInt    (CODING, "GenerateMIME", GenerateMIME, szAppProFile);
  WritePrivateProfileInt    (CODING, "MIMEUsageSuggestions", MIMEUsageSuggestions, szAppProFile);
  WritePrivateProfileString (CODING, "MIMEBoundary", MIMEBoundary, szAppProFile);
  WritePrivateProfileString (CODING, "MIMEUUType", MIMEUUType, szAppProFile);
  WritePrivateProfileString (CODING, "MIMEXXType", MIMEXXType, szAppProFile);
  WritePrivateProfileString (CODING, "MIMECustomType", MIMECustomType, szAppProFile);
  WritePrivateProfileInt    (CODING, "BlankBeforeMIME", BlankBeforeMIME, szAppProFile);
  WritePrivateProfileString (CODING, "DefaultContentType", DefaultContentType, szAppProFile);

  WritePrivateProfileString (INTERFACE, "ListFontFace", ListFontFace, szAppProFile);
  WritePrivateProfileInt    (INTERFACE, "ListFontSize", ListFontSize, szAppProFile);
  WritePrivateProfileString (INTERFACE, "ListFontStyle", ListFontStyle, szAppProFile);
  WritePrivateProfileString (INTERFACE, "ArticleFontFace", ArticleFontFace, szAppProFile);
  WritePrivateProfileInt    (INTERFACE, "ArticleFontSize", ArticleFontSize, szAppProFile);
  WritePrivateProfileString (INTERFACE, "ArticleFontStyle", ArticleFontStyle, szAppProFile);
  WritePrivateProfileString (INTERFACE, "StatusFontFace", StatusFontFace, szAppProFile);
  WritePrivateProfileInt    (INTERFACE, "StatusFontSize", StatusFontSize, szAppProFile);
  WritePrivateProfileString (INTERFACE, "StatusFontStyle", StatusFontStyle, szAppProFile);
  WritePrivateProfileString (INTERFACE, "PrintFontFace", PrintFontFace, szAppProFile);
  WritePrivateProfileInt    (INTERFACE, "PrintFontSize", PrintFontSize, szAppProFile);
//  WritePrivateProfileInt    (INTERFACE, "FontBold", FontBold, szAppProFile);
//  WritePrivateProfileInt    (INTERFACE, "ArticleFixedFont", ArticleFixedFont, szAppProFile);
  WritePrivateProfileString (INTERFACE, "NetUnSubscribedColor", RGBToStr(str, NetUnSubscribedColor), szAppProFile);
  WritePrivateProfileString (INTERFACE, "NetSubscribedColor", RGBToStr(str, NetSubscribedColor), szAppProFile);
  WritePrivateProfileString (INTERFACE, "ArticleUnSeenColor", RGBToStr(str, ArticleUnSeenColor), szAppProFile);
  WritePrivateProfileString (INTERFACE, "ArticleSeenColor", RGBToStr(str, ArticleSeenColor), szAppProFile);
  WritePrivateProfileString (INTERFACE, "ArticleTextColor", RGBToStr(str, ArticleTextColor), szAppProFile);
  WritePrivateProfileString (INTERFACE, "StatusTextColor", RGBToStr(str, StatusTextColor), szAppProFile);
  WritePrivateProfileString (INTERFACE, "ArticleBackgroundColor", RGBToStr(str, ArticleBackgroundColor), szAppProFile);
  WritePrivateProfileString (INTERFACE, "ListBackgroundColor", RGBToStr(str, ListBackgroundColor), szAppProFile);
  WritePrivateProfileString (INTERFACE, "StatusBackgroundColor", RGBToStr(str, StatusBackgroundColor), szAppProFile);
  WritePrivateProfileInt    (INTERFACE, "ThumbTrack", ThumbTrack, szAppProFile);

  WritePrivateProfileString (SEARCHES, "LastArticleTextFind", LastArticleTextFind, szAppProFile);
  WritePrivateProfileString (SEARCHES, "LastArticleHeaderFind", LastArticleHeaderFind, szAppProFile);
  WritePrivateProfileString (SEARCHES, "LastGroupNameFind", LastGroupNameFind, szAppProFile);

  WritePrivateProfileInt    (SMARTFILER, "OnDupeName", OnDupeName, szAppProFile);
  WritePrivateProfileInt    (SMARTFILER, "OnNameTooLong", OnNameTooLong, szAppProFile);
  WritePrivateProfileInt    (SMARTFILER, "MaxFileNameLen", MaxFileNameLen, szAppProFile);
  WritePrivateProfileInt    (SMARTFILER, "MaxFileExtLen", MaxFileExtLen, szAppProFile);
  WritePrivateProfileInt    (SMARTFILER, "EnableExtensionConversion", EnableExtensionConversion, szAppProFile);

  if (MailList) {
    for (j = 0; j < max(MailListOrigNum, (int)MailList->numLines); j++)
    {
      sprintf (str, "Address%d", j+1);
      WritePrivateProfileString (MAIL_ADDRESSES, str, 
         (j >= (int)MailList->numLines)?"":TextBlockLine(MailList, j), szAppProFile);
    }
  }

  if (ExtMapSourceList && ExtMapDosList) {
    for (j = 0; j < max(ExtListOrigNum, (int)ExtMapSourceList->numLines); j++)
    {
      sprintf (str, "ExtConvert%d", j+1);
      if (j >= (int)ExtMapSourceList->numLines)
         buf[0]='\0';
      else
         _snprintf(buf, MAXINTERNALLINE-1, "%s,%s", 
            TextBlockLine(ExtMapSourceList, j), TextBlockLine(ExtMapDosList, j));
         
      WritePrivateProfileString (SMARTFILER, str, buf, szAppProFile);
    }
  }
}

/*--- function UpdateWinvnProfile -----------------------------------------
 *
 *    Upgrades a user's old style of WinVn.ini to the new style
 *    (JSC 1/8/94)
 */
void
UpdateWinvnProfile ()
{
  char buf[512];
  
 
  GetPrivateProfileString (OLD, "UserName", DEF_UserName, UserName, MAILLEN, szAppProFile);
  GetPrivateProfileString (OLD, "MailAddress", DEF_MailAddr, MailAddress, MAILLEN, szAppProFile);
  GetPrivateProfileString (OLD, "Organization", DEF_Organization, Organization, MAILLEN, szAppProFile);
  GetPrivateProfileString (OLD, "ReplyTo", DEF_ReplyTo, ReplyTo, MAILLEN, szAppProFile);

  UsingSocket =
     GetPrivateProfileInt (OLD, "UseSocket", DEF_UsingSocket, szAppProFile);
  GetPrivateProfileString (OLD, "NNTPHost", DEF_NNTPHost, NNTPHost, MAXNNTPSIZE, szAppProFile);
  GetPrivateProfileString (OLD, "SMTPHost", DEF_SMTPHost, SMTPHost, MAXNNTPSIZE, szAppProFile);
  GetPrivateProfileString (OLD, "NNTPService", DEF_NNTPService, NNTPService, MAXNNTPSIZE, szAppProFile);
  DebugComm = 
     GetPrivateProfileInt (OLD, "DebugComm", DEF_DebugComm, szAppProFile);
  MailDemandLogon = 
     GetPrivateProfileInt (OLD, "MailDemandLogon", DEF_MailDemandLogon, szAppProFile);
  MailForceType = 
     GetPrivateProfileInt (OLD, "MailForceType", DEF_MailForceType, szAppProFile);

  GetPrivateProfileString (OLD, "NNTPUserName", DEF_NNTPUserName, NNTPUserName, MAXNNTPSIZE, szAppProFile);
  GetPrivateProfileString (OLD, "NNTPPassword", DEF_NNTPPassword, NNTPPasswordEncrypted, 2*MAXNNTPSIZE, szAppProFile);

  threadp =
     GetPrivateProfileInt (OLD, "EnableThreading", DEF_EnableThreading, szAppProFile);
  GetPrivateProfileString (OLD, "SignatureFile", DEF_SignatureFile, SigFileName, MAXFILENAME+1,szAppProFile);
//  GetPrivateProfileString (OLD, "MailListFile", DEF_MailFileName, MailFileName, MAXFILENAME+1,szAppProFile);
  EnableSig =
     GetPrivateProfileInt (OLD, "EnableSignature", DEF_EnableSignature, szAppProFile);

  MailLog = 
     GetPrivateProfileInt (OLD, "MailLog", DEF_MailLog, szAppProFile);
  GetPrivateProfileString (OLD, "MailLogFile" , DEF_MailLogFile, MailLogFile, MAXFILENAME, szAppProFile);
  PostLog = 
     GetPrivateProfileInt (OLD, "PostLog", DEF_PostLog, szAppProFile);
  GetPrivateProfileString (OLD, "PostLogFile" ,DEF_PostLogFile, PostLogFile, MAXFILENAME, szAppProFile);

  ConnectAtStartup =
     GetPrivateProfileInt (OLD, "ConnectAtStartup", DEF_ConnectAtStartup,szAppProFile);
  FullNameFrom = 
     GetPrivateProfileInt (OLD, "FullNameFrom", DEF_FullNameFrom, szAppProFile);
  article_threshold = 
     GetPrivateProfileUInt (OLD, "ArticleThreshold", DEF_ArticleThreshold, szAppProFile);
  ShowUnsubscribed = 
     GetPrivateProfileInt (OLD, "ShowUnsubscribed",DEF_ShowUnsubscribed, szAppProFile); 
  ShowReadArticles = 
     GetPrivateProfileInt (OLD,"ShowReadArticles", DEF_ShowReadArticles, szAppProFile);
  ConfirmBatchOps = 
     GetPrivateProfileInt (OLD,"ConfirmBatchOps", DEF_ConfirmBatchOps, szAppProFile);
  ConfirmExit = 
     GetPrivateProfileInt (OLD,"ConfirmExit", DEF_ConfirmExit, szAppProFile);
  ConfirmReplyTo =
     GetPrivateProfileInt (OLD, "ConfirmReplyTo", DEF_ConfirmReplyTo, szAppProFile);
  CcByMail =
     GetPrivateProfileInt (OLD,"CcByMail", DEF_CcByMail, szAppProFile);
  ViewNew = 
     GetPrivateProfileInt (OLD, "NewWndGroup", DEF_NewWndGroup, szAppProFile);
  NewArticleWindow = 
     GetPrivateProfileInt (OLD, "NewWndArticle", DEF_NewWndArticle, szAppProFile);
  SaveArtAppend = 
     GetPrivateProfileInt (OLD, "SaveArtAppend", DEF_SaveArtAppend, szAppProFile);
  ShowUnreadOnly = 
     GetPrivateProfileInt (OLD, "ShowUnreadOnly",DEF_ShowUnreadOnly, szAppProFile); 

  GetPrivateProfileString (OLD, "DecodePath", DEF_DecodePath, DecodePathName, MAXFILENAME, szAppProFile);
  CodingStatusVerbose = 
     GetPrivateProfileInt (OLD, "CodingStatusVerbose", DEF_CodingStatusVerbose, szAppProFile);
  BlockCodingStatusAlwaysOnTop =
     GetPrivateProfileInt (OLD, "BlockCodingStatusAlwaysOnTop", DEF_BlockCodingStatusAlwaysOnTop, szAppProFile);
  DumbDecode = 
     GetPrivateProfileInt (OLD, "DumbDecode", DEF_DumbDecode, szAppProFile);
  ReviewAttach = 
     GetPrivateProfileInt (OLD, "ReviewAttach", DEF_ReviewAttach, szAppProFile);
  GenerateMIME = 
     GetPrivateProfileInt (OLD, "GenerateMIME", DEF_GenerateMIME, szAppProFile);
  MIMEUsageSuggestions = 
     GetPrivateProfileInt (OLD, "MIMEUsageSuggestions", DEF_MIMEUsageSuggestions, szAppProFile);
  GetPrivateProfileString (OLD, "EncodingType", DEF_EncodingType, DefaultContentType, MAXINTERNALLINE, szAppProFile);
  EncodingTypeNum = EncodingTypeToNum (EncodingType);
  GetPrivateProfileString (OLD, "MIMEUUType", DEF_MIMEUUType, MIMEUUType, 80, szAppProFile);
  GetPrivateProfileString (OLD, "MIMEXXType", DEF_MIMEXXType, MIMEXXType, 80, szAppProFile);
  GetPrivateProfileString (OLD, "MIMECustomType", DEF_MIMECustomType, MIMEXXType, 80, szAppProFile);
  GetPrivateProfileString (OLD, "DefaultContentType",DEF_DefaultContentType, DefaultContentType, MAXINTERNALLINE, szAppProFile);
  AttachInNewArt =
     GetPrivateProfileInt (OLD, "AttachInNewArt", DEF_AttachInNewArt, szAppProFile);
  ExecuteDecodedFiles =
     GetPrivateProfileInt (OLD, "ExecuteDecodedFiles", DEF_ExecuteDecodedFiles, szAppProFile);
  KeepArticleHeaderVisible =
     GetPrivateProfileInt (OLD, "KeepArticleHeaderVisible", DEF_KeepArticleHeaderVisible, szAppProFile);
  UseSmartFiler =
     GetPrivateProfileInt (OLD, "UseSmartFiler", DEF_UseSmartFiler, szAppProFile);

  ArticleSplitLength = 
      GetPrivateProfileUInt (OLD, "ArticleSplitLength", (unsigned int) DEF_ArticleSplitLength, szAppProFile);
  GetPrivateProfileString (OLD, "EncodingTable", DEF_EncodingTable, UserCodingTable, CODINGTABLESIZE+1, szAppProFile);
  GetPrivateProfileString (OLD, "SubjectTemplate", "%s  -  %f [%p/%t]", SubjectTemplate, CODINGTABLESIZE+1, szAppProFile);
  GetPrivateProfileString (OLD, "MIMEBoundary",DEF_MIMEBoundary, MIMEBoundary, MAXINTERNALLINE, szAppProFile);
  BlankBeforeMIME =
     GetPrivateProfileInt (OLD, "BlankBeforeMIME", DEF_BlankBeforeMIME, szAppProFile);

  GetPrivateProfileString (OLD, "ListFontFace", DEF_ListFontFace, ListFontFace, 32,szAppProFile);
  ListFontSize = 
     GetPrivateProfileInt (OLD, "ListFontSize", DEF_ListFontSize, szAppProFile);
  GetPrivateProfileString (OLD, "ListFontStyle", DEF_ListFontStyle, ListFontStyle, 32, szAppProFile);
//  FontBold = 
//     GetPrivateProfileInt (OLD, "FontBold", TRUE, szAppProFile);
  GetPrivateProfileString (OLD, "ArticleFontFace", DEF_ArticleFontFace, ArticleFontFace, 32, szAppProFile);
  ArticleFontSize = 
     GetPrivateProfileInt (OLD, "ArticleFontSize", DEF_ArticleFontSize, szAppProFile);
  GetPrivateProfileString (OLD, "ArticleFontStyle", DEF_ArticleFontStyle, ArticleFontStyle, 32, szAppProFile);
  GetPrivateProfileString (OLD, "StatusFontFace", DEF_StatusFontFace, StatusFontFace, 32, szAppProFile);
  StatusFontSize = 
     GetPrivateProfileInt (OLD, "StatusFontSize", DEF_StatusFontSize, szAppProFile);
  GetPrivateProfileString (OLD, "StatusFontStyle", DEF_StatusFontStyle, StatusFontStyle, 32, szAppProFile);
  GetPrivateProfileString (OLD, "PrintFontFace", DEF_PrintFontFace, PrintFontFace, 32, szAppProFile);
  PrintFontSize = 
     GetPrivateProfileInt (OLD, "PrintFontSize", DEF_PrintFontSize, szAppProFile);
//
// Previous versions of WINVN.INI stored fonts in Device dependent units
// instead of Device Independent font sizes.  Since we can't safely 
// convert, set font to something reasonable.   (JD 4/22/94)
//
  if (ArticleFontSize && (ArticleFontSize == 0 || ArticleFontSize > 16))
     ArticleFontSize = 10;
  if (ListFontSize && (ListFontSize == 0 || ListFontSize > 16))
     ListFontSize = 10;
  if (StatusFontSize && (StatusFontSize == 0 || StatusFontSize > 16))
     StatusFontSize = 11;
  if (PrintFontSize && (PrintFontSize == 0 || PrintFontSize > 16))
     PrintFontSize = 10;

  ArticleFixedFont = 0;
  GetPrivateProfileString (OLD, "NetUnSubscribedColor", DEF_NetUnSubscribedColor, buf, 32, szAppProFile);
  NetUnSubscribedColor = StrToRGB (buf);
  GetPrivateProfileString (OLD, "NetSubscribedColor", DEF_NetSubscribedColor, buf, 32, szAppProFile);
  NetSubscribedColor = StrToRGB (buf);
  GetPrivateProfileString (OLD, "ArticleUnSeenColor", DEF_ArticleUnSeenColor, buf, 32, szAppProFile);
  ArticleUnSeenColor = StrToRGB (buf);
  GetPrivateProfileString (OLD, "ArticleSeenColor", DEF_ArticleSeenColor, buf, 32, szAppProFile);
  ArticleSeenColor = StrToRGB (buf);
  GetPrivateProfileString (OLD, "ArticleTextColor", DEF_ArticleTextColor, buf, 32, szAppProFile);
  ArticleTextColor = StrToRGB (buf);
  GetPrivateProfileString (OLD, "StatusTextColor", DEF_StatusTextColor, buf, 32, szAppProFile);
  StatusTextColor = StrToRGB (buf);
  GetPrivateProfileString (OLD, "ArticleBackgroundColor", DEF_ArticleBackgroundColor, buf, 32, szAppProFile);
  ArticleBackgroundColor = StrToRGB (buf);
  GetPrivateProfileString (OLD, "ListBackgroundColor", DEF_ListBackgroundColor, buf, 32, szAppProFile);
  ListBackgroundColor = StrToRGB (buf);
  GetPrivateProfileString (OLD, "StatusBackgroundColor", DEF_StatusBackgroundColor, buf, 32, szAppProFile);
  StatusBackgroundColor = StrToRGB (buf);
  ThumbTrack = 
     GetPrivateProfileInt (OLD, "ThumbTrack", DEF_ThumbTrack, szAppProFile);

  GetPrivateProfileString (OLD, "LastArticleTextFind", "", LastArticleTextFind, MAXINTERNALLINE, szAppProFile);
  GetPrivateProfileString (OLD, "LastArticleHeaderFind", "", LastArticleHeaderFind, MAXINTERNALLINE, szAppProFile);
  GetPrivateProfileString (OLD, "LastGroupNameFind", "", LastGroupNameFind, MAXINTERNALLINE, szAppProFile);

  OnDupeName = 
     GetPrivateProfileInt (OLD, "OnDupeName", DEF_OnDupeName, szAppProFile);
  OnNameTooLong = 
     GetPrivateProfileInt (OLD, "OnNameTooLong", DEF_OnNameTooLong, szAppProFile);
  MaxFileNameLen = 
     GetPrivateProfileInt (OLD, "MaxFileNameLen", DEF_MaxFileNameLen, szAppProFile);
  MaxFileExtLen = 
     GetPrivateProfileInt (OLD, "MaxFileExtLen", DEF_MaxFileExtLen, szAppProFile);
  EnableExtensionConversion =
     GetPrivateProfileInt (OLD, "EnableExtensionConversion", DEF_EnableExtensionConversion, szAppProFile);

  GetPrivateProfileString (COMM, "GenSockDLL", DEF_GenSockDLL, GenSockDLL, MAXFILENAME+1,szAppProFile);
  if (!GenSockDLL)
    {
     WritePrivateProfileString (COMM, "GenSockDLL", "gensock.dll", szAppProFile);
     strcpy (GenSockDLL, "gensock.dll");
    }
  WriteWinvnProfile();
  WritePrivateProfileString (OLD, "Notice1", "**** The [winvn] section is no longer needed unless    ****", szAppProFile);
  WritePrivateProfileString (OLD, "Notice2", "**** you want compatibility with old versions of WinVn ****", szAppProFile);

  strlwr (szAppProFile);
  sprintf (buf, "WinVN has discovered your configuration file is from an older release."
                "  Your configuration file %s has been updated.\nIf something doesn't work"
                " as expected, please review the changes.", szAppProFile);
  MessageBox (hWndConf, buf, "WinVn Configuration", MB_OK);
}
@


1.54
log
@new support for window cascading
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.53 1994/09/16 00:44:49 jcooper Exp $
d5 3
d312 8
@


1.53
log
@massive cleanup, etc for 92.6
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.52 1994/08/24 18:40:15 mrr Exp $
d5 3
d451 3
a453 1
  CommDoc = &NetDoc;
d618 1
a619 1
  numStatusTexts = 0;
d621 1
a621 1
    codingStatusText[j] = NULL;
d752 2
a753 2
  ArtLineHeight = max (ArtLineHeight, (unsigned int) (tmFontInfo.tmExternalLeading + tmFontInfo.tmHeight));
  ArtCharWidth = max (ArtCharWidth, (unsigned int) (tmFontInfo.tmAveCharWidth));
@


1.52
log
@authorization enables post/mail
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.51 1994/08/24 17:59:26 jcooper Exp $
d5 3
d188 2
a189 1
#define STRICT
d191 3
a193 3
#include "windows.h"
#include "WVglob.h"
#include "WinVn.h"
d423 22
a444 20
  lpfnWinVnCommDlg =  MakeProcInstance ((FARPROC) WinVnCommDlg, hInstance);
  lpfnWinVnSaveArtDlg = MakeProcInstance ((FARPROC) WinVnSaveArtDlg, hInstance);
  lpfnWinVnSaveArtsDlg = MakeProcInstance ((FARPROC) WinVnSaveArtsDlg, hInstance);
  lpfnWinVnFindDlg = MakeProcInstance ((FARPROC) WinVnFindDlg, hInstance);
  lpfnWinVnGenericDlg = MakeProcInstance ((FARPROC) WinVnGenericDlg, hInstance);
  lpfnWinVnSubjectDlg = MakeProcInstance ((FARPROC) WinVnSubjectDlg, hInstance);
  lpfnWinVnAuthDlg = MakeProcInstance ((FARPROC) WinVnAuthDlg, hInstance);
  lpfnWinVnDoListDlg = MakeProcInstance ((FARPROC) WinVnDoListDlg, hInstance);
  lpfnWinVnPersonalInfoDlg = MakeProcInstance ((FARPROC) WinVnPersonalInfoDlg, hInstance);
  lpfnWinVnMiscDlg = MakeProcInstance ((FARPROC) WinVnMiscDlg, hInstance);
  lpfnWinVnAppearanceDlg = MakeProcInstance ((FARPROC)WinVnAppearanceDlg, hInstance);
  lpfnEditSubClass = MakeProcInstance((FARPROC) editIntercept, hInst);
  lpfnWinVnThresholdDlg = MakeProcInstance ((FARPROC)WinVnThresholdDlg, hInstance);
  lpfnWinVnLogOptDlg = MakeProcInstance ((FARPROC) WinVnLogOptDlg ,hInstance) ;
  lpfnWinVnDecodeArtsDlg = MakeProcInstance ((FARPROC) WinVnDecodeArtsDlg, hInstance);
  lpfnWinVnAttachDlg = MakeProcInstance ((FARPROC) WinVnAttachDlg, hInstance);
  lpfnWinVnEncodeDlg = MakeProcInstance ((FARPROC) WinVnEncodeDlg, hInstance);
  lpfnWinVnSigFileDlg = MakeProcInstance ((FARPROC) WinVnSigFileDlg, hInstance);
  lpfnWinVnExitDlg = MakeProcInstance ((FARPROC) WinVnExitDlg, hInstance);
  lpfnWinVnMailDlg = MakeProcInstance ((FARPROC) WinVnMailDlg, hInstance);
a603 1
  Attaching = FALSE;
a612 4
/*MailList = InitTextBlock (hWndConf);
  if (MailFileName[0] != '\0')
    ReadFileToTextBlock (hWndConf, MailList, MailFileName, ADD_PLAIN);
*/
d959 45
d1151 2
d1158 1
d1161 38
a1198 2
  // test for existence of Comm section in ini file
  // if doesn't exist, we need to upgrade this user's INI file
a1239 2
//  GetPrivateProfileString (PREF, "MailListFile", DEF_MailFileName, MailFileName, MAXFILENAME+1,szAppProFile);

d1265 2
d1285 3
d1314 4
d1360 16
a1375 11
  MailList = InitTextBlock (hWndConf);
  for (j = 1;; j++)
  {
    sprintf (str, "Address%d", j);
    GetPrivateProfileString (MAIL_ADDRESSES, str, "", buf, MAILLEN, szAppProFile);
    if (!strcmp(buf, ""))
      break;
    AddLineToTextBlock (MailList, buf);
  }
  MailListOrigNum = (int)MailList->numLines;
  
d1405 1
d1446 1
a1454 1
  WritePrivateProfileInt    (CODING, "ExecuteDecodedFiles", ExecuteDecodedFiles, szAppProFile);
d1456 1
d1460 3
d1500 10
d1518 14
d1595 2
d1609 2
d1629 4
d1695 15
a1725 32

#if 0
/*--- function WriteMailRc -----------------------------------------
 *
 *    Write mail address list to file
 *    (JSC 2/1/94)
 */
void
WriteMailrc ()
{
  HANDLE hRetCode;
  TypMRRFile *MRRFile;
  register long j;
  int len;
  char mybuf[MAXINTERNALLINE];
  
  // overwrite previous file
  hRetCode = MRROpenFile (MailFileName, OF_CREATE, &MRRFile);
  if ((int) hRetCode < 0)
    {
      sprintf (str, "MRROpenFile on %s returned %d", MailFileName, hRetCode);
      MessageBox (hWndConf, str, "Write to mailrc file failed", MB_OK);
    }
  for (j = 0; j < (int)MailList->numLines; j++)
  {
      strcpy (mybuf, TextBlockLine (MailList, j));
      len = strlen (mybuf);
      MRRWriteLine (MRRFile, mybuf, len);
  }
  MRRCloseFile (MRRFile);
}
#endif
@


1.51
log
@misc encoding/decoding changes
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.50 1994/08/11 02:25:59 dumoulin Exp $
d5 3
d191 1
a191 1
#include "defaults.h"	// default profile settings
d270 1
a270 1
  SetUserMenus (hWnd, DISABLE);	// menus disabled until connection made
d306 1
a306 1
  	Connect ();
d327 1
a327 1
  SetConnectMenuItem (hWndConf, DISABLE);	// connect item has reverse attributes
d332 2
a333 2
  	
  if (MRRInitComm ())	/* Set up communications */
d336 1
a336 1
    SetConnectMenuItem (hWndConf, ENABLE);	// connect item has reverse attributes
d349 1
a349 1
    SetConnectMenuItem (hWndConf, ENABLE);	// connect item has reverse attributes
d443 1
a443 1
  Authorized = FALSE;
d566 1
a566 1
//  CheckView (hWndConf);		/* modify menu as necessary           */
d580 1
a580 1
  savingArtIndex = -1;		// reset to non-saving state
d587 1
a587 1
  uuMap[' ']=0;		// decode both quote and space to 0 in UU
d604 2
a605 2
	MessageBox (hWndConf, "Signatures disabled", "Signature File Failure", MB_OK);
	EnableSig = FALSE;
d622 4
a625 4
 * 	Initialize global fonts and metrics
 *	Be sure to delete any existing font objects before replacing them
 *	Convert points representation to logical units for sizes
 *	JSC 1/10/93
d637 2
a638 2
  if (hListFont)		
	DeleteObject (hListFont);
d642 15
a656 15
	hListFont = CreateFont 
		(-MulDiv(ListFontSize, ScreenYPixels, 72),
		0,	/* width */
		0,	/* escapement */
		0,	/* orientation */
		strstr (ListFontStyle,"Bold") ? FW_BOLD : FW_MEDIUM,
		(BYTE) (strstr (ListFontStyle,"Italic") ? 1 : 0),
		0,	/* no underline */
		0,	/* no strikeout */
		0,
		OUT_DEFAULT_PRECIS,
		CLIP_DEFAULT_PRECIS,
		0,	/* no PROOF_QUALITY */
		0,
		ListFontFace);
d659 1
a659 1
	hListFont = GetStockObject (OEM_FIXED_FONT);
d686 1
a686 1
  if (hFontArtNormal)		
d688 2
a689 2
	DeleteObject (hFontArtNormal);
	DeleteObject (hFontArtQuote);
d692 43
a734 43
	{
		hFontArtNormal = CreateFont (
		-MulDiv(ArticleFontSize, ScreenYPixels, 72),
		0,	/* width */
		0,	/* escapement */
		0,	/* orientation */
		strstr (ArticleFontStyle,"Bold") ? FW_BOLD : FW_MEDIUM,
		(BYTE) (strstr (ArticleFontStyle,"Italic") ? 1 : 0),
		0,	/* no underline */
		0,	/* no strikeout */
		0,
		OUT_DEFAULT_PRECIS,
		CLIP_DEFAULT_PRECIS,
		0,	/* no PROOF_QUALITY */
		0,
		ArticleFontFace);

	  hFontArtQuote = CreateFont (
		-MulDiv(ArticleFontSize, ScreenYPixels, 72),
		0,	/* width */
		0,	/* escapement */
		0,	/* orientation */
		strstr (ArticleFontStyle,"Bold") ? FW_BOLD : FW_MEDIUM,
		(BYTE) (strstr (ArticleFontStyle,"Italic") ? 0 : 1),  // opposite to above italics
		0,	/* no underline */
		0,	/* no strikeout */
		0,
		OUT_DEFAULT_PRECIS,
		CLIP_DEFAULT_PRECIS,
		0,	/* no PROOF_QUALITY */
		0,
		ArticleFontFace);
	}
	else if (ArticleFixedFont)
	{
		hFontArtNormal  = GetStockObject (ANSI_FIXED_FONT);
		hFontArtQuote = GetStockObject (ANSI_FIXED_FONT);
	}
	else
	{
		hFontArtNormal = hListFont;
		hFontArtQuote = hListFont;
	}
d765 2
a766 2
  if (hStatusFont)		
	DeleteObject (hStatusFont);
d769 19
a787 19
	{
		hStatusFont = CreateFont 
		(-MulDiv(StatusFontSize, ScreenYPixels, 72),
		0,	/* width */
		0,	/* escapement */
		0,	/* orientation */
		strstr (StatusFontStyle,"Bold") ? FW_BOLD : FW_MEDIUM,
		(BYTE) (strstr (StatusFontStyle,"Italic") ? 1 : 0),
		0,	/* no underline */
		0,	/* no strikeout */
		0,
		OUT_DEFAULT_PRECIS,
		CLIP_DEFAULT_PRECIS,
		0,	/* no PROOF_QUALITY */
		0,
		StatusFontFace);
	}
	else
		hStatusFont = GetStockObject (OEM_FIXED_FONT);
d808 1
a808 1
  if (hFontPrint)		
d823 14
a836 14
        		-MulDiv(PrintFontSize, PrinterYPixels, 72),
		        0,     /* width */
			0,	/* escapement */
			0,	/* orientation */
			FW_MEDIUM,
			0,	/* no italics */
			0,	/* no underline */
			0,	/* no strikeout */
			0,
			OUT_DEFAULT_PRECIS,     
			CLIP_DEFAULT_PRECIS,
			0,	/* no PROOF_QUALITY */
			0,
			PrintFontFace);
d839 14
a852 14
			-MulDiv(PrintFontSize, PrinterYPixels, 72),
			0,     /* width */
			0,	/* escapement */
			0,	/* orientation */
			FW_BOLD,
			0,	/* no italics */
			0,	/* no underline */
			0,	/* no strikeout */
			0,
			OUT_DEFAULT_PRECIS,
			CLIP_DEFAULT_PRECIS,
			0,	/* no PROOF_QUALITY */
			0,
			PrintFontFace);
d855 30
a884 30
			-MulDiv((int)(0.9*PrintFontSize), PrinterYPixels, 72),
			0,     /* width */
			0,	/* escapement */
			0,	/* orientation */
			FW_LIGHT,
			1,	/* italics */
			0,	/* no underline */
			0,	/* no strikeout */
			0,
			OUT_DEFAULT_PRECIS,
			CLIP_DEFAULT_PRECIS,
			0,	/* no PROOF_QUALITY */
			0,
			PrintFontFace);

		hFontPrintS = CreateFont (
			-MulDiv((int)(1.5*PrintFontSize), PrinterYPixels, 72),
			0,     /* width */
			0,	/* escapement */
			0,	/* orientation */
			FW_EXTRABOLD,   	
			0,	/* no italics */
			1,	/* underline */
			0,	/* no strikeout */
			0,
			OUT_DEFAULT_PRECIS,
			CLIP_DEFAULT_PRECIS,
			0,	/* no PROOF_QUALITY */
			0,
			PrintFontFace);
d889 15
a903 15
     			-MulDiv(8, PrinterYPixels, 72),
	//		40,    /* default Font Size */
			0,     /* width */
			0,	/* escapement */
			0,	/* orientation */
			FW_MEDIUM,
			0,	/* no italics */
			0,	/* no underline */
			0,	/* no strikeout */
			0,
			OUT_DEFAULT_PRECIS,
			CLIP_DEFAULT_PRECIS,
			0,	/* no PROOF_QUALITY */
			0,
			0);    /* Default Font Face */
d906 15
a920 15
     			-MulDiv(8, PrinterYPixels, 72),
	//		40,    /* default font size */
			0,     /* width */
			0,	/* escapement */
			0,	/* orientation */
			FW_BOLD,
			0,	/* no italics */
			0,	/* no underline */
			0,	/* no strikeout */
			0,
			OUT_DEFAULT_PRECIS,
			CLIP_DEFAULT_PRECIS,
			0,	/* no PROOF_QUALITY */
			0,
			0);    /* default font face */
d923 15
a937 15
   			-MulDiv((int)(0.9 * 8), PrinterYPixels, 72),
	//		36,    /* default font size */
			0,     /* width */
			0,	/* escapement */
			0,	/* orientation */
			FW_LIGHT,
			1,	/* italics */
			0,	/* no underline */
			0,	/* no strikeout */
			0,
			OUT_DEFAULT_PRECIS,
			CLIP_DEFAULT_PRECIS,
			0,	/* no PROOF_QUALITY */
			0,
			0);    /* default font face */
d940 16
a955 16
   			-MulDiv(8, PrinterYPixels, 72),
	//		60,
			0,     /* width */
			0,	/* escapement */
			0,	/* orientation */
			FW_EXTRABOLD,
			0,	/* no italics */
			1,	/* underline */
			0,	/* no strikeout */
			0,
			OUT_DEFAULT_PRECIS,
			CLIP_DEFAULT_PRECIS,
			0,	/* no PROOF_QUALITY */
			0,
			"Arial");
	}
d1116 2
a1117 2
  	UpdateWinvnProfile();
  	return;
d1140 2
d1274 1
a1274 1
    	break;
@


1.50
log
@enabled STRICT compile and cleaned up parameter casting
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.49 1994/08/11 00:09:17 jcooper Exp dumoulin $
d5 3
d1205 2
d1361 1
d1482 2
@


1.49
log
@Enhancements to Mime and article encoding/encoding
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.48 1994/08/04 05:51:54 dumoulin Exp $
d5 3
d179 1
d271 1
a271 1
     if (!DialogBox (hInst, "WinVnComm", hWndConf, lpfnWinVnCommDlg))
d278 1
a278 1
     if (!DialogBox (hInst, "WinVnPersonal", hWndConf, lpfnWinVnPersonalInfoDlg))
d337 1
a337 1
  idTimer = SetTimer (hWndConf, ID_TIMER ,1000, (FARPROC) NULL);
d373 1
a373 1
WinVnInit (HANDLE hInstance, LPSTR lpCmdLine )
d413 11
a423 11
  lpfnWinVnCommDlg = MakeProcInstance (WinVnCommDlg, hInstance);
  lpfnWinVnSaveArtDlg = MakeProcInstance (WinVnSaveArtDlg, hInstance);
  lpfnWinVnSaveArtsDlg = MakeProcInstance (WinVnSaveArtsDlg, hInstance);
  lpfnWinVnFindDlg = MakeProcInstance (WinVnFindDlg, hInstance);
  lpfnWinVnGenericDlg = MakeProcInstance (WinVnGenericDlg, hInstance);
  lpfnWinVnSubjectDlg = MakeProcInstance (WinVnSubjectDlg, hInstance);
  lpfnWinVnAuthDlg = MakeProcInstance (WinVnAuthDlg, hInstance);
  lpfnWinVnDoListDlg = MakeProcInstance (WinVnDoListDlg, hInstance);
  lpfnWinVnPersonalInfoDlg = MakeProcInstance (WinVnPersonalInfoDlg, hInstance);
  lpfnWinVnMiscDlg = MakeProcInstance (WinVnMiscDlg, hInstance);
  lpfnWinVnAppearanceDlg = MakeProcInstance (WinVnAppearanceDlg, hInstance);
d425 8
a432 8
  lpfnWinVnThresholdDlg = MakeProcInstance (WinVnThresholdDlg, hInstance);
  lpfnWinVnLogOptDlg = MakeProcInstance (WinVnLogOptDlg ,hInstance) ;
  lpfnWinVnDecodeArtsDlg = MakeProcInstance (WinVnDecodeArtsDlg, hInstance);
  lpfnWinVnAttachDlg = MakeProcInstance (WinVnAttachDlg, hInstance);
  lpfnWinVnEncodeDlg = MakeProcInstance (WinVnEncodeDlg, hInstance);
  lpfnWinVnSigFileDlg = MakeProcInstance (WinVnSigFileDlg, hInstance);
  lpfnWinVnExitDlg = MakeProcInstance (WinVnExitDlg, hInstance);
  lpfnWinVnMailDlg = MakeProcInstance (WinVnMailDlg, hInstance);
d449 1
a449 1
  pWndClass->hbrBa#kground = GetStockObject (WHITE_BRUSH);
@


1.48
log
@Fixed problem with long mail addresses getting truncated to 32 chars
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.47 1994/08/03 00:35:20 dumoulin Exp dumoulin $
d5 3
d1196 2
d1203 4
a1206 1

d1342 1
d1346 1
d1348 1
d1351 1
d1353 3
a1356 1
  WritePrivateProfileString (CODING, "EncodingType", EncodingType, szAppProFile);
a1357 2
  WritePrivateProfileInt    (CODING, "AttachInNewArt", AttachInNewArt, szAppProFile);
  WritePrivateProfileInt    (CODING, "ExecuteDecodedFiles", ExecuteDecodedFiles, szAppProFile);
d1470 2
d1474 3
@


1.47
log
@Fixed bug upon exit and startup for folks that don't have
any printers.
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.46 1994/08/02 05:00:16 dumoulin Exp dumoulin $
d5 4
d1250 1
a1250 1
    GetPrivateProfileString (MAIL_ADDRESSES, str, "", buf, 32, szAppProFile);
@


1.46
log
@change HANDLE to HINSTANCE for better NT compatiblity
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.45 1994/07/25 22:41:22 pearse_w_r Exp dumoulin $
d5 3
d396 1
a396 1
  InitPrintFonts();  
@


1.45
log
@ShowUnreadOnly option
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.44 1994/07/25 18:51:48 jcooper Exp pearse_w_r $
d5 3
d195 2
a196 2
     HANDLE hInstance;
     HANDLE hPrevInstance;
@


1.44
log
@execution of decoded files
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.43 1994/06/30 16:33:35 dumoulin Exp $
d5 3
d1163 2
d1321 1
d1438 2
@


1.43
log
@Fix a problem with freeing printing fonts with an uninitialized variable
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.42 1994/06/23 23:10:40 dumoulin Exp dumoulin $
d5 3
d1187 2
d1329 1
d1445 3
@


1.42
log
@Changed code to not delete hardware device context for Printer device
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.41 1994/06/17 09:08:49 dumoulin Exp dumoulin $
d5 3
d379 1
a379 3
  hDC = GetPrinterDC (NULL);
  PrinterYPixels = GetDeviceCaps(hDC, LOGPIXELSY);
//  DeleteDC (hDC);
d777 19
a795 13
{
	if (hFontPrint)		
	{
		DeleteObject (hFontPrint);
		DeleteObject (hFontPrintB);
		DeleteObject (hFontPrintI);
		DeleteObject (hFontPrintS);
	}
	if (PrintFontSize)
	{
		hFontPrint = CreateFont (
			-MulDiv(PrintFontSize, PrinterYPixels, 72),
			0,     /* width */
d809 1
a809 1
		hFontPrintB = CreateFont (
d825 1
a825 1
		hFontPrintI = CreateFont (
d856 6
a861 5
	}
	else
	{
		hFontPrint = CreateFont (
			40,    /* default Font Size */
d876 3
a878 2
		hFontPrintB = CreateFont (
			40,    /* default font size */
d893 3
a895 2
		hFontPrintI = CreateFont (
			36,    /* default font size */
d910 3
a912 2
		hFontPrintS = CreateFont (
			60,
@


1.41
log
@Attempts to fix the Unable to Initialize Document printing bug
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.40 1994/06/11 00:46:47 dumoulin Exp dumoulin $
d5 3
d378 2
a379 2
//  DeleteDC (hDC);   // JD 6/17/94
  
@


1.40
log
@Fix defaults for GenSock.DLL and prompt if no username specified
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.39 1994/06/06 22:06:13 gardnerd Exp dumoulin $
d5 3
d373 1
a373 1
  hDC = GetPrinterDC ();
d375 1
a375 1
  DeleteDC (hDC);
@


1.39
log
@horizontal scrolling support
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.38 1994/05/27 01:29:29 rushing Exp $
d5 3
d241 7
d1265 1
d1483 6
@


1.38
log
@unnecessary winundoc.h
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.37 1994/05/26 22:02:38 jglasser Exp rushing $
d5 3
d215 1
a215 1
             WS_OVERLAPPEDWINDOW | WS_VSCROLL,
@


1.37
log
@warnings
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.36 1994/05/23 19:51:51 rushing Exp rushing $
d5 3
a145 1
#include "winundoc.h"
@


1.36
log
@NNTPPort becomes NNTPService, and it's a string.
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.35 1994/05/23 18:37:00 jcooper Exp rushing $
d5 3
d597 1
a597 1
		strstr (ListFontStyle,"Italic") ? 1 : 0,
d648 1
a648 1
		strstr (ArticleFontStyle,"Italic") ? 1 : 0,
d664 1
a664 1
		strstr (ArticleFontStyle,"Italic") ? 0 : 1,  // opposite to above italics
d695 2
a696 2
  ArtLineHeight = max (ArtLineHeight, tmFontInfo.tmExternalLeading + tmFontInfo.tmHeight);
  ArtCharWidth = max (ArtCharWidth, tmFontInfo.tmAveCharWidth);
d725 1
a725 1
		strstr (StatusFontStyle,"Italic") ? 1 : 0,
d1140 1
a1140 1
      GetPrivateProfileUInt (CODING, "ArticleSplitLength", DEF_ArticleSplitLength, szAppProFile);
d1407 1
a1407 1
      GetPrivateProfileUInt (OLD, "ArticleSplitLength", DEF_ArticleSplitLength, szAppProFile);
@


1.35
log
@new attach code, session [dis]connect
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.34 1994/05/02 19:51:12 rushing Exp rushing $
d5 3
d296 1
d1065 1
a1065 2
  NNTPPort =
     GetPrivateProfileInt (COMM, "NNTPPort", DEF_NNTPPort, szAppProFile);
d1243 1
a1243 1
  WritePrivateProfileInt    (COMM, "NNTPPort", NNTPPort, szAppProFile);
d1343 1
a1343 2
  NNTPPort =
     GetPrivateProfileInt (OLD, "NNTPPort", DEF_NNTPPort, szAppProFile);
@


1.34
log
@more changes from jg
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.33 1994/05/02 19:45:42 rushing Exp rushing $
d5 3
d218 1
a227 5
  /* Set up communications--serial or IP.                           */

  if (MRRInitComm ())
    PostQuitMessage(0);

d243 6
a248 1
  Initializing = INIT_ESTAB_CONN;
d250 1
d259 43
a509 9
  /* Set up the timer which will wake us up every so often
   * so we can check to see if new characters have arrived from
   * the server.
   */
  idTimer = SetTimer (hWndConf, ID_TIMER ,1000, (FARPROC) NULL);

  if (!idTimer)
    MessageBox (hWndConf, "Couldn't create timer!", "WinVN", MB_OK | MB_ICONASTERISK);

a526 1
  EncodingType = CODE_UU;
d1097 2
d1131 2
a1132 3
//ReviewAttach = 
//   GetPrivateProfileInt (CODING, "ReviewAttach", DEF_ReviewAttach, szAppProFile);
  ReviewAttach = 1;
d1140 2
d1143 4
d1259 1
d1276 1
a1276 1
//WritePrivateProfileString (CODING, "ReviewAttach", ReviewAttach, szAppProFile);
d1282 3
d1366 2
a1367 2
  DoList = 
     GetPrivateProfileInt (OLD, "DoList", DEF_DoList,szAppProFile);
d1394 7
a1400 3
//ReviewAttach = 
//   GetPrivateProfileInt (OLD, "ReviewAttach", DEF_ReviewAttach, szAppProFile);
  ReviewAttach = 1;
@


1.33
log
@redoing JD's print font size change
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.32 1994/05/02 19:44:04 rushing Exp rushing $
d5 3
d1225 1
@


1.32
log
@changes from jody glasser
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.31 1994/04/22 05:02:23 dumoulin Exp rushing $
d5 3
d1381 1
a1381 1
     PrintFontSize = 12;
@


1.31
log
@Fix font size problem
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.30 1994/04/22 04:55:02 dumoulin Exp dumoulin $
d5 3
d1076 3
@


1.30
log
@Fix font conversion problem when converting older winvn.ini files
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.29 1994/04/19 10:18:52 dumoulin Exp dumoulin $
d5 3
d1369 2
d1372 1
a1372 3
     PrintFontSize = 10;
  if (StatusFontSize && (StatusFontSize == 0 || StatusFontSize > 16))
     StatusFontSize = 10;
a1373 2
//  ArticleFixedFont = 
//     GetPrivateProfileInt (OLD, "ArticleFixedFont", FALSE, szAppProFile);
@


1.29
log
@Updated converter for old to new INI files
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.28 1994/04/18 20:49:44 rushing Exp dumoulin $
d5 3
d1357 14
@


1.28
log
@check MailList for NULL on write of newsrc
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.27 1994/03/01 19:10:19 rushing Exp rushing $
d5 3
d1260 1
a1260 1
  char buf[MAXINTERNALLINE];
d1383 3
a1385 1
  sprintf (buf, "Your configuration file %s has been updated.\nPlease review the changes.", szAppProFile);
@


1.27
log
@ThreadFullSubject option added
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.26 1994/02/24 21:24:47 jcoop Exp rushing $
d5 3
d1203 1
d1239 7
a1245 5
  for (j = 0; j < max(MailListOrigNum, (int)MailList->numLines); j++)
  {
    sprintf (str, "Address%d", j+1);
    WritePrivateProfileString (MAIL_ADDRESSES, str, 
       (j >= (int)MailList->numLines)?"":TextBlockLine(MailList, j), szAppProFile);
@


1.26
log
@jcoop changes
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.25 1994/02/16 21:58:56 rushing Exp $
d5 3
d1058 3
@


1.25
log
@call to profilestring was a little hosed for .sig file
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.24 1994/02/16 20:59:17 rushing Exp rushing $
d5 3
d140 1
a140 1
{
d198 1
a198 1
       PostQuitMessage(0);
d274 2
d278 1
a278 1
  ReleaseDC (hWndConf, hDC);
d294 1
d308 1
d435 1
a435 1

d464 12
a475 1
  EncodingType = ENCODE_UU;
d486 1
a486 1
     }
d488 4
d553 1
a553 1
  TopSpace = tmFontInfo.tmExternalLeading;
d556 1
a556 1
  SideSpace = tmFontInfo.tmAveCharWidth / 2;
d565 1
a565 1

d622 10
d973 1
d980 1
d993 1
d998 1
a998 1
  GetPrivateProfileString (COMM, "SMTPHost", "", SMTPHost, MAXNNTPSIZE, szAppProFile);
d1004 5
d1020 1
d1024 2
a1038 4
  MailDemandLogon = 
     GetPrivateProfileInt (PREF, "MailDemandLogon", DEF_MailDemandLogon, szAppProFile);
  MailForceType = 
     GetPrivateProfileInt (PREF, "MailForceType", DEF_MailForceType, szAppProFile);
d1045 4
d1056 1
d1113 11
d1153 2
d1158 1
d1176 1
d1189 2
d1195 1
d1228 7
d1251 1
d1256 1
a1256 1
  GetPrivateProfileString (OLD, "SMTPHost", "", SMTPHost, MAXNNTPSIZE, szAppProFile);
d1261 7
a1267 3
  
  GetPrivateProfileString (AUTH, "NNTPUserName", DEF_NNTPUserName, NNTPUserName, MAXNNTPSIZE, szAppProFile);
  GetPrivateProfileString (AUTH, "NNTPPassword", DEF_NNTPPassword, NNTPPasswordEncrypted, 2*MAXNNTPSIZE, szAppProFile);
d1271 2
a1272 1
  GetPrivateProfileString (OLD, "SignatureFile", "", DEF_SignatureFile, MAXFILENAME+1,szAppProFile);
a1288 4
  MailDemandLogon = 
     GetPrivateProfileInt (OLD, "MailDemandLogon", DEF_MailDemandLogon, szAppProFile);
  MailForceType = 
     GetPrivateProfileInt (OLD, "MailForceType", DEF_MailForceType, szAppProFile);
d1295 4
d1306 1
d1371 32
@


1.24
log
@Added .ini param to force use of XHDR over XOVER
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.23 1994/02/09 01:25:15 cnolan Exp rushing $
d5 3
d979 1
a979 1
  GetPrivateProfileString (PREF, "SignatureFile", "", DEF_SignatureFile, MAXFILENAME+1,szAppProFile);
@


1.23
log
@cnolan 90.2 changes
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.22 1994/02/09 01:10:07 rushing Exp $
d5 3
d971 3
d975 1
a975 1
     GetPrivateProfileInt (PREF, "EnableThreading", DEF_EnableThreading, szAppProFile);
@


1.22
log
@PREF->COMM for GenSockDLL profile string
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.21 1994/02/04 02:18:13 rushing Exp rushing $
d5 3
d181 1
a181 1
  SetClassWord (hWnd, GCW_HBRBACKGROUND, hListBackgroundBrush);
@


1.21
log
@added GenSockDLL .ini parameter
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.20 1994/01/24 19:34:38 jcoop Exp rushing $
d5 3
d963 1
a963 1
  GetPrivateProfileString (PREF, "GenSockDLL", DEF_GenSockDLL, GenSockDLL, MAXFILENAME+1,szAppProFile);
@


1.20
log
@per email
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.19 1994/01/24 17:39:47 jcoop Exp jcoop $
d5 3
d959 2
@


1.19
log
@90.2 changes
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.18 1994/01/17 21:56:15 jcoop Exp $
d5 3
d179 2
a180 1
     DialogBox (hInst, "WinVnComm", hWndConf, lpfnWinVnCommDlg);
d1274 1
a1274 1
}@


1.18
log
@New font/color and INI file routines.  Sig file and en/decoding inits
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.18 1994/01/17 21:42:20 jcoop Exp $
d5 3
d91 1
a91 1

d174 4
d412 9
d937 3
a939 3
  GetPrivateProfileString (PERSONAL, "UserName", "", UserName, MAILLEN,szAppProFile);
  GetPrivateProfileString (PERSONAL, "MailAddress", "", MailAddress, MAILLEN,szAppProFile);
  GetPrivateProfileString (PERSONAL, "Organization", "", Organization, MAILLEN,szAppProFile);
d942 3
a944 3
     GetPrivateProfileInt (COMM, "UseSocket", 1, szAppProFile);
  GetPrivateProfileString (COMM, "NNTPHost", "news_host_here", NNTPHost, MAXNNTPSIZE,szAppProFile);
  GetPrivateProfileString (COMM, "SMTPHost", "", SMTPHost, MAXNNTPSIZE,szAppProFile);
d946 1
a946 1
     GetPrivateProfileInt (COMM, "NNTPPort", 119 ,szAppProFile);
d948 1
a948 1
     GetPrivateProfileInt (COMM, "DebugComm", FALSE, szAppProFile);
d950 2
a951 2
  GetPrivateProfileString (AUTH, "NNTPUserName", "", NNTPUserName, MAXNNTPSIZE,szAppProFile);
  GetPrivateProfileString (AUTH, "NNTPPassword", "", NNTPPasswordEncrypted, 2*MAXNNTPSIZE,szAppProFile);
d954 2
a955 2
     GetPrivateProfileInt (PREF, "EnableThreading", 0, szAppProFile);
  GetPrivateProfileString (PREF, "SignatureFile", "", SigFileName, MAXFILENAME+1,szAppProFile);
d957 1
a957 1
     GetPrivateProfileInt (PREF, "EnableSignature", 0, szAppProFile);
d960 2
a961 2
     GetPrivateProfileInt (PREF, "MailLog", 0 /* off */, szAppProFile);
  GetPrivateProfileString (PREF, "MailLogFile" , "MAIL.LOG" , MailLogFile, MAXFILENAME, szAppProFile);
d963 2
a964 2
     GetPrivateProfileInt (PREF, "PostLog", 0 /* off */, szAppProFile);
  GetPrivateProfileString (PREF, "PostLogFile" , "POST.LOG" , PostLogFile, MAXFILENAME, szAppProFile);
d967 1
a967 1
     GetPrivateProfileInt (PREF, "DoList", ID_DOLIST_ASK-ID_DOLIST_BASE,szAppProFile);
d969 1
a969 1
     GetPrivateProfileInt (PREF, "FullNameFrom", 1, szAppProFile);
d971 1
a971 1
     GetPrivateProfileInt (PREF, "ArticleThreshold", 300, szAppProFile);
d973 1
a973 1
     GetPrivateProfileInt (PREF, "MailDemandLogon", TRUE, szAppProFile);
d975 1
a975 1
     GetPrivateProfileInt (PREF, "MailForceType", -1, szAppProFile);
d977 1
a977 1
     GetPrivateProfileInt (PREF, "ShowUnsubscribed",TRUE,szAppProFile); 
d979 3
a981 1
     GetPrivateProfileInt (PREF,"ShowReadArticles",TRUE,szAppProFile);
d983 1
a983 1
     GetPrivateProfileInt (PREF, "NewWndGroup", FALSE, szAppProFile);
d985 1
a985 1
     GetPrivateProfileInt (PREF, "NewWndArticle", FALSE, szAppProFile);
d987 1
a987 1
     GetPrivateProfileInt (PREF, "SaveArtAppend", TRUE, szAppProFile);
d990 1
a990 1
     GetPrivateProfileInt (CODING, "CodingStatusVerbose", 0, szAppProFile);
d992 1
a992 1
     GetPrivateProfileInt (CODING, "DumbDecode", 0, szAppProFile);
d994 1
a994 1
//   GetPrivateProfileInt (CODING, "ReviewAttach", 1, szAppProFile);
d997 2
a998 2
     GetPrivateProfileInt (CODING, "ArticleSplitLength", 32000, szAppProFile);
  GetPrivateProfileString (CODING, "EncodingTable", "", UserCodingTable, CODINGTABLESIZE+1, szAppProFile);
d1000 1
a1000 1
  GetPrivateProfileString (CODING, "MIMEBoundary", "*-*-*- Next Section -*-*-*", MIMEBoundary, MAXINTERNALLINE, szAppProFile);
d1002 3
a1004 2
     GetPrivateProfileInt (CODING, "BlankBeforeMIME", 0, szAppProFile);
  GetPrivateProfileString (INTERFACE, "ListFontFace", "Courier", ListFontFace, 32,szAppProFile);
d1006 2
a1007 2
     GetPrivateProfileInt (INTERFACE, "ListFontSize", 10, szAppProFile);
  GetPrivateProfileString (INTERFACE, "ListFontStyle", "Regular", ListFontStyle, 32, szAppProFile);
d1010 1
a1010 1
  GetPrivateProfileString (INTERFACE, "ArticleFontFace", "Courier", ArticleFontFace, 32, szAppProFile);
d1012 3
a1014 3
     GetPrivateProfileInt (INTERFACE, "ArticleFontSize", 10,szAppProFile);
  GetPrivateProfileString (INTERFACE, "ArticleFontStyle", "Regular", ArticleFontStyle, 32, szAppProFile);
  GetPrivateProfileString (INTERFACE, "StatusFontFace", "Courier", StatusFontFace, 32, szAppProFile);
d1016 3
a1018 3
     GetPrivateProfileInt (INTERFACE, "StatusFontSize", 10,szAppProFile);
  GetPrivateProfileString (INTERFACE, "StatusFontStyle", "Regular", StatusFontStyle, 32, szAppProFile);
  GetPrivateProfileString (INTERFACE, "PrintFontFace", "Arial", PrintFontFace, 32, szAppProFile);
d1020 1
a1020 1
     GetPrivateProfileInt (INTERFACE, "PrintFontSize", 10, szAppProFile);
d1024 1
a1024 1
  GetPrivateProfileString (INTERFACE, "NetUnSubscribedColor", "0,0,200", buf, 32, szAppProFile);
d1026 1
a1026 1
  GetPrivateProfileString (INTERFACE, "NetSubscribedColor", "0,0,0", buf, 32, szAppProFile);
d1028 1
a1028 1
  GetPrivateProfileString (INTERFACE, "ArticleUnSeenColor", "0,0,0", buf, 32, szAppProFile);
d1030 1
a1030 1
  GetPrivateProfileString (INTERFACE, "ArticleSeenColor", "0,0,255", buf, 32, szAppProFile);
d1032 1
a1032 1
  GetPrivateProfileString (INTERFACE, "ArticleTextColor", "0,0,0", buf, 32, szAppProFile);
d1034 1
a1034 1
  GetPrivateProfileString (INTERFACE, "StatusTextColor", "0,0,0", buf, 32, szAppProFile);
d1036 1
a1036 1
  GetPrivateProfileString (INTERFACE, "ArticleBackgroundColor", "255,255,255", buf, 32, szAppProFile);
d1038 1
a1038 1
  GetPrivateProfileString (INTERFACE, "ListBackgroundColor", "255,255,255", buf, 32, szAppProFile);
d1040 1
a1040 1
  GetPrivateProfileString (INTERFACE, "StatusBackgroundColor", "255,255,255", buf, 32, szAppProFile);
d1043 1
a1043 1
     GetPrivateProfileInt (INTERFACE, "ThumbTrack", TRUE, szAppProFile);
d1105 1
d1155 3
a1157 3
  GetPrivateProfileString (OLD, "UserName", "", UserName, MAILLEN,szAppProFile);
  GetPrivateProfileString (OLD, "MailAddress", "", MailAddress, MAILLEN,szAppProFile);
  GetPrivateProfileString (OLD, "Organization", "", Organization, MAILLEN,szAppProFile);
d1160 3
a1162 3
     GetPrivateProfileInt (OLD, "UseSocket", 1, szAppProFile);
  GetPrivateProfileString (OLD, "NNTPHost", "news_host_here", NNTPHost, MAXNNTPSIZE,szAppProFile);
  GetPrivateProfileString (OLD, "SMTPHost", "", SMTPHost, MAXNNTPSIZE,szAppProFile);
d1164 1
a1164 1
     GetPrivateProfileInt (OLD, "NNTPPort", 119 ,szAppProFile);
d1166 1
a1166 1
     GetPrivateProfileInt (OLD, "DebugComm", FALSE, szAppProFile);
d1168 2
a1169 2
  GetPrivateProfileString (OLD, "NNTPUserName", "", NNTPUserName, MAXNNTPSIZE,szAppProFile);
  GetPrivateProfileString (OLD, "NNTPPassword", "", NNTPPasswordEncrypted, 2*MAXNNTPSIZE,szAppProFile);
d1172 2
a1173 2
     GetPrivateProfileInt (OLD, "EnableThreading", 0, szAppProFile);
  GetPrivateProfileString (OLD, "SignatureFile", "", SigFileName, MAXFILENAME+1,szAppProFile);
d1175 1
a1175 1
     GetPrivateProfileInt (OLD, "EnableSignature", 0, szAppProFile);
d1178 2
a1179 2
     GetPrivateProfileInt (OLD, "MailLog", 0 /* off */, szAppProFile);
  GetPrivateProfileString (OLD, "MailLogFile" , "MAIL.LOG" , MailLogFile, MAXFILENAME, szAppProFile);
d1181 2
a1182 2
     GetPrivateProfileInt (OLD, "PostLog", 0 /* off */, szAppProFile);
  GetPrivateProfileString (OLD, "PostLogFile" , "POST.LOG" , PostLogFile, MAXFILENAME, szAppProFile);
d1185 1
a1185 1
     GetPrivateProfileInt (OLD, "DoList", ID_DOLIST_ASK-ID_DOLIST_BASE,szAppProFile);
d1187 1
a1187 1
     GetPrivateProfileInt (OLD, "FullNameFrom", 1, szAppProFile);
d1189 1
a1189 1
     GetPrivateProfileInt (OLD, "ArticleThreshold", 300, szAppProFile);
d1191 1
a1191 1
     GetPrivateProfileInt (OLD, "MailDemandLogon", TRUE, szAppProFile);
d1193 1
a1193 1
     GetPrivateProfileInt (OLD, "MailForceType", -1, szAppProFile);
d1195 1
a1195 1
     GetPrivateProfileInt (OLD, "ShowUnsubscribed",TRUE,szAppProFile); 
d1197 3
a1199 1
     GetPrivateProfileInt (OLD,"ShowReadArticles",TRUE,szAppProFile);
d1201 1
a1201 1
     GetPrivateProfileInt (OLD, "NewWndGroup", FALSE, szAppProFile);
d1203 1
a1203 1
     GetPrivateProfileInt (OLD, "NewWndArticle", FALSE, szAppProFile);
d1205 1
a1205 1
     GetPrivateProfileInt (OLD, "SaveArtAppend", TRUE, szAppProFile);
d1208 1
a1208 1
     GetPrivateProfileInt (OLD, "CodingStatusVerbose", 0, szAppProFile);
d1210 1
a1210 1
     GetPrivateProfileInt (OLD, "DumbDecode", 0, szAppProFile);
d1212 1
a1212 1
//   GetPrivateProfileInt (OLD, "ReviewAttach", 1, szAppProFile);
d1215 2
a1216 2
     GetPrivateProfileInt (OLD, "ArticleSplitLength", 32000, szAppProFile);
  GetPrivateProfileString (OLD, "EncodingTable", "", UserCodingTable, CODINGTABLESIZE+1, szAppProFile);
d1218 1
a1218 1
  GetPrivateProfileString (OLD, "MIMEBoundary", "*-*-*- Next Section -*-*-*", MIMEBoundary, MAXINTERNALLINE, szAppProFile);
d1220 3
a1222 2
     GetPrivateProfileInt (OLD, "BlankBeforeMIME", 0, szAppProFile);
  GetPrivateProfileString (OLD, "ListFontFace", "New Courier", ListFontFace, 32,szAppProFile);
d1224 2
a1225 2
     GetPrivateProfileInt (OLD, "ListFontSize", 10, szAppProFile);
  GetPrivateProfileString (OLD, "ListFontStyle", "Regular", ListFontStyle, 32, szAppProFile);
d1228 1
a1228 1
  GetPrivateProfileString (OLD, "ArticleFontFace", "Courier", ArticleFontFace, 32, szAppProFile);
d1230 3
a1232 3
     GetPrivateProfileInt (OLD, "ArticleFontSize", 10,szAppProFile);
  GetPrivateProfileString (OLD, "ArticleFontStyle", "Regular", ArticleFontStyle, 32, szAppProFile);
  GetPrivateProfileString (OLD, "StatusFontFace", "Courier", StatusFontFace, 32, szAppProFile);
d1234 3
a1236 3
     GetPrivateProfileInt (OLD, "StatusFontSize", 10,szAppProFile);
  GetPrivateProfileString (OLD, "StatusFontStyle", "Regular", StatusFontStyle, 32, szAppProFile);
  GetPrivateProfileString (OLD, "PrintFontFace", "Arial", PrintFontFace, 32, szAppProFile);
d1238 1
a1238 1
     GetPrivateProfileInt (OLD, "PrintFontSize", 0, szAppProFile);
d1242 1
a1242 1
  GetPrivateProfileString (OLD, "NetUnSubscribedColor", "0,0,200", buf, 32, szAppProFile);
d1244 1
a1244 1
  GetPrivateProfileString (OLD, "NetSubscribedColor", "0,0,0", buf, 32, szAppProFile);
d1246 1
a1246 1
  GetPrivateProfileString (OLD, "ArticleUnSeenColor", "0,0,0", buf, 32, szAppProFile);
d1248 1
a1248 1
  GetPrivateProfileString (OLD, "ArticleSeenColor", "0,0,255", buf, 32, szAppProFile);
d1250 1
a1250 1
  GetPrivateProfileString (OLD, "ArticleTextColor", "0,0,0", buf, 32, szAppProFile);
d1252 1
a1252 1
  GetPrivateProfileString (OLD, "StatusTextColor", "0,0,0", buf, 32, szAppProFile);
d1254 1
a1254 1
  GetPrivateProfileString (OLD, "ArticleBackgroundColor", "255,255,255", buf, 32, szAppProFile);
d1256 1
a1256 1
  GetPrivateProfileString (OLD, "ListBackgroundColor", "255,255,255", buf, 32, szAppProFile);
d1258 1
a1258 1
  GetPrivateProfileString (OLD, "StatusBackgroundColor", "255,255,255", buf, 32, szAppProFile);
d1261 1
a1261 1
     GetPrivateProfileInt (OLD, "ThumbTrack", TRUE, szAppProFile);
@


1.17
log
@mrr mods 4
@
text
@a0 1

d3 1
a3 1
 * $Id: winvn.c 1.16 1993/12/08 01:27:21 rushing Exp $
d5 3
d14 1
d166 2
d174 1
a174 1
      PostQuitMessage(0);
d192 1
a192 1
  InvalidateRect (hWnd, NULL, FALSE);
a194 2


a198 1

d222 1
a223 1
  char buf[60];
a225 1
  char intl_section[5] = "intl" ;
a227 1
  SaveNewsrc = TRUE;
a230 1

d238 1
a238 1
  /* Read profile strings.   */
d240 4
a243 9
  AskComm = GetPrivateProfileInt (szAppName, "AskComm", ASK_COMM_INITIAL, szAppProFile);
  UsingSocket = GetPrivateProfileInt (szAppName, "UseSocket", 1, szAppProFile);
  threadp = GetPrivateProfileInt (szAppName, "EnableThreading", 0, szAppProFile);
  GetPrivateProfileString (szAppName, "NNTPHost", "news_host_here", NNTPHost, MAXNNTPSIZE,szAppProFile);
  GetPrivateProfileString (szAppName, "SMTPHost", "", SMTPHost, MAXNNTPSIZE,szAppProFile);
  NNTPPort = GetPrivateProfileInt (szAppName, "NNTPPort", 119 ,szAppProFile);
  GetPrivateProfileString (szAppName, "CommString", "COM1:9600,e,7", szCommString, MAXCOMMCHARS,szAppProFile);
  GetPrivateProfileString (szAppName, "NNTPUserName", "", NNTPUserName, MAXNNTPSIZE,szAppProFile);
  GetPrivateProfileString (szAppName, "NNTPPassword", "", NNTPPasswordEncrypted, 2*MAXNNTPSIZE,szAppProFile);
d245 10
a254 53
#if 0
  errptr = CommStrtoID (szCommString, &CommPortID, &CommParityID, pszCommSpeed);
  if (errptr)
    {
      strcpy (mesbuf, "Error parsing ");
      strcat (mesbuf, szCommString);
      MessageBox (hWndConf, errptr, mesbuf, MB_OK | MB_ICONEXCLAMATION);
    }
#endif
  DoList =
    GetPrivateProfileInt (szAppName, "DoList", ID_DOLIST_ASK,szAppProFile);
  FullNameFrom =
    GetPrivateProfileInt (szAppName, "FullNameFrom", 1, szAppProFile);
  article_threshold =
    GetPrivateProfileInt (szAppName, "ArticleThreshold",300, szAppProFile);

  GetPrivateProfileString (szAppName, "UserName", "", UserName, MAILLEN,szAppProFile);
  GetPrivateProfileString (szAppName, "MailAddress", "", MailAddress, MAILLEN,szAppProFile);
  GetPrivateProfileString (szAppName, "Organization", "", Organization, MAILLEN,szAppProFile);

  FontSize = GetPrivateProfileInt (szAppName, "FontSize", 0, szAppProFile);
  PrintFontSize = GetPrivateProfileInt (szAppName, "PrintFontSize", 0, szAppProFile);
  GetPrivateProfileString (szAppName, "PrintFontFace", "Helv", PrintFontFace, 32,szAppProFile);
  GetPrivateProfileString (szAppName, "FontFace", "Helv", FontFace, 32,szAppProFile);
  ArticleFontSize = GetPrivateProfileInt (szAppName, "ArticleFontSize", 0,szAppProFile);
  GetPrivateProfileString (szAppName, "ArticleFontFace", "Helv", ArticleFontFace, 32, szAppProFile);
  FontBold = GetPrivateProfileInt (szAppName, "FontBold", TRUE, szAppProFile);
  ArticleFixedFont = GetPrivateProfileInt (szAppName, "ArticleFixedFont", FALSE, szAppProFile);
  GetPrivateProfileString (szAppName, "NetUnSubscribedColor", "255,33,33" /*"200,60,150"*/ , buf, 32, szAppProFile);
  NetUnSubscribedColor = StrToRGB (buf);
  GetPrivateProfileString (szAppName, "GroupSeenColor", "80,100,235" /*"100,120,180"*/ , buf, 32, szAppProFile);
  GroupSeenColor = StrToRGB (buf);
  ViewNew = GetPrivateProfileInt (szAppName, "NewWndGroup", FALSE, szAppProFile);
  NewArticleWindow = GetPrivateProfileInt (szAppName, "NewWndArticle", FALSE, szAppProFile);
  SaveArtAppend = GetPrivateProfileInt (szAppName, "SaveArtAppend", TRUE, szAppProFile);
  ThumbTrack = GetPrivateProfileInt (szAppName, "ThumbTrack", TRUE, szAppProFile);
  MailDemandLogon = GetPrivateProfileInt (szAppName, "MailDemandLogon", TRUE, szAppProFile);
  MailForceType = GetPrivateProfileInt (szAppName, "MailForceType", -1, szAppProFile);

  MailLog = GetPrivateProfileInt (szAppName, "MailLog", 0 /* off */, szAppProFile);
  GetPrivateProfileString (szAppName, "MailLogFile" , "MAIL.LOG" , MailLogFile, MAXFILENAME, szAppProFile);
  PostLog = GetPrivateProfileInt (szAppName, "PostLog", 0 /* off */, szAppProFile);
  GetPrivateProfileString (szAppName, "PostLogFile" , "POST.LOG" , PostLogFile, MAXFILENAME, szAppProFile);
  ShowUnsubscribed = GetPrivateProfileInt (szAppName,"ShowUnsubscribed",TRUE,szAppProFile); 
  ShowReadArticles = GetPrivateProfileInt (szAppName,"ShowReadArticles",TRUE,szAppProFile);
  DebugComm = GetPrivateProfileInt (szAppName, "DebugComm", FALSE, szAppProFile);

  /* internationalise winvn */

  GetProfileString (intl_section , "sDate", "." ,fmtDateDelim ,2 );
//  fmtDateDelim[1]=0 ;
  fmtDaysB4Mth = (1 == GetProfileInt (intl_section,"iDate", 0 /* US Date Format*/));

d271 5
d282 3
d353 28
a380 1
    }                                  
a396 1
 *    In particular, I do a bunch of font stuff here.
a397 1

d401 1
a401 2
  int retcode, j;
  TEXTMETRIC tmFontInfo;
d403 1
a403 1
  HDC hDC;
d405 1
a405 2
  retcode = TRUE;
  CheckView (hWndConf);    /* modify menu as necessary           */
d407 2
a408 4
  hDC = GetDC (hWndConf);
  /* Unless user specified the system font, create a font as per
   * the user's specifications.
   */
d410 6
a415 21
  if (FontSize)
   {
      hFont = CreateFont (FontSize,
      0, /* width */
      0, /* escapement */
      0, /* orientation */
      FontBold ? FW_BOLD : FW_MEDIUM,
      0, /* no italics */
      0, /* no underline */
      0, /* no strikeout */
      0,
      OUT_DEFAULT_PRECIS,
      CLIP_DEFAULT_PRECIS,
      0, /* no PROOF_QUALITY */
      0,
      FontFace);
   }
   else
   {
      hFont = GetStockObject (OEM_FIXED_FONT);
   }
d417 2
a418 41
  if (ArticleFontSize && !ArticleFixedFont)
   {
      hFontArtNormal = CreateFont (ArticleFontSize,
      0, /* width */
      0, /* escapement */
      0, /* orientation */
      FW_MEDIUM,    /* default weight */
      0, /* no italics */
      0, /* no underline */
      0, /* no strikeout */
      0,
      OUT_DEFAULT_PRECIS,
      CLIP_DEFAULT_PRECIS,
      0, /* no PROOF_QUALITY */
      0,
      ArticleFontFace);
     hFontArtQuote = CreateFont (ArticleFontSize,
      0, /* width */
      0, /* escapement */
      0, /* orientation */
      FW_MEDIUM,    /* default weight */
      1, /* comments are in italics */
      0, /* no underline */
      0, /* no strikeout */
      0,
      OUT_DEFAULT_PRECIS,
      CLIP_DEFAULT_PRECIS,
      0, /* no PROOF_QUALITY */
      0,
      ArticleFontFace);
   }
   else if (ArticleFixedFont)
   {
      hFontArtNormal  = GetStockObject (ANSI_FIXED_FONT);
      hFontArtQuote = GetStockObject (ANSI_FIXED_FONT);
   }
   else
   {
      hFontArtNormal = hFont;
      hFontArtQuote = hFont;
   }
d420 3
a422 16
  if (PrintFontSize)
   {
     hFontPrint = CreateFont (PrintFontSize,
                               0,     /* width */
                               0,   /* escapement */
                               0,   /* orientation */
                               FW_MEDIUM,
                               0,   /* no italics */
                               0,   /* no underline */
                               0,   /* no strikeout */
                                    0,
                               OUT_DEFAULT_PRECIS,
                               CLIP_DEFAULT_PRECIS,
                               0,   /* no PROOF_QUALITY */
                               0,
                               PrintFontFace);
d424 2
a425 14
     hFontPrintB = CreateFont (PrintFontSize,
                               0,     /* width */
                               0,   /* escapement */
                               0,   /* orientation */
                               FW_BOLD,
                               0,   /* no italics */
                               0,   /* no underline */
                               0,   /* no strikeout */
                                    0,
                               OUT_DEFAULT_PRECIS,
                               CLIP_DEFAULT_PRECIS,
                               0,   /* no PROOF_QUALITY */
                               0,
                               PrintFontFace);
d427 12
a438 14
           hFontPrintI = CreateFont ((int)(PrintFontSize * .90),
                               0,     /* width */
                               0,   /* escapement */
                               0,   /* orientation */
                               FW_LIGHT,
                               1,   /* italics */
                               0,   /* no underline */
                               0,   /* no strikeout */
                                    0,
                               OUT_DEFAULT_PRECIS,
                               CLIP_DEFAULT_PRECIS,
                               0,   /* no PROOF_QUALITY */
                               0,
                               PrintFontFace);
d440 2
a441 31
           hFontPrintS = CreateFont ((int)(PrintFontSize * 1.5),
                               0,     /* width */
                               0,   /* escapement */
                               0,   /* orientation */
                               FW_EXTRABOLD,
                               0,   /* no italics */
                               1,   /* underline */
                               0,   /* no strikeout */
                                    0,
                               OUT_DEFAULT_PRECIS,
                               CLIP_DEFAULT_PRECIS,
                               0,   /* no PROOF_QUALITY */
                               0,
                               "Helv");
   }
   else
   {
                hFontPrint = CreateFont (40,    /* default Font Size */
                               0,     /* width */
                               0,   /* escapement */
                               0,   /* orientation */
                               FW_MEDIUM,
                               0,   /* no italics */
                               0,   /* no underline */
                               0,   /* no strikeout */
                                    0,
                               OUT_DEFAULT_PRECIS,
                               CLIP_DEFAULT_PRECIS,
                               0,   /* no PROOF_QUALITY */
                               0,
                               0);    /* Default Font Face */
a442 14
      hFontPrintB = CreateFont (40,   /* default font size */
                               0,     /* width */
                               0,   /* escapement */
                               0,   /* orientation */
                               FW_BOLD,
                               0,   /* no italics */
                               0,   /* no underline */
                               0,   /* no strikeout */
                                    0,
                               OUT_DEFAULT_PRECIS,
                               CLIP_DEFAULT_PRECIS,
                               0,   /* no PROOF_QUALITY */
                               0,
                               0);    /* default font face */
d444 11
a454 14
              hFontPrintI = CreateFont (36,   /* default font size */
                               0,     /* width */
                               0,   /* escapement */
                               0,   /* orientation */
                               FW_LIGHT,
                               1,   /* italics */
                               0,   /* no underline */
                               0,   /* no strikeout */
                                    0,
                               OUT_DEFAULT_PRECIS,
                               CLIP_DEFAULT_PRECIS,
                               0,   /* no PROOF_QUALITY */
                               0,
                               0);    /* default font face */
d456 3
a458 15
              hFontPrintS = CreateFont (60,
                               0,     /* width */
                               0,   /* escapement */
                               0,   /* orientation */
                               FW_EXTRABOLD,
                               0,   /* no italics */
                               1,   /* underline */
                               0,   /* no strikeout */
                                    0,
                               OUT_DEFAULT_PRECIS,
                               CLIP_DEFAULT_PRECIS,
                               0,   /* no PROOF_QUALITY */
                               0,
                               "Helv");
   }
d460 2
a461 1
  ReleaseDC (hWndConf, hDC);
d463 21
d491 1
a491 1
  SelectObject (hDC, hFont);
d501 1
d503 56
d562 1
a562 1

d566 1
d568 5
a572 1
  strcpy (SaveArtFileName, "");
d574 3
a576 1
  /* Initialize some document-related stuff.                        */
d578 2
a579 7
  ActiveGroupDoc = (TypDoc *) NULL;
  ActiveArticleDoc = (TypDoc *) NULL;
  for (j = 0; j < MAXGROUPWNDS; j++)
    GroupDocs[j].InUse = FALSE;
  for (j = 0; j < MAXARTICLEWNDS; j++)
    ArticleDocs[j].InUse = FALSE;
  savingArtIndex = -1;     /* reset to non-saving state */
d581 34
a614 1
  return retcode;
d617 27
d645 15
d661 100
d884 4
a887 4
   {
     TranslateMessage (&MainMsg);
     DispatchMessage (&MainMsg);
   }
d891 357
@


1.16
log
@new version box and cr lf consistency
@
text
@d4 1
a4 1
 * $Id: winvn.c 1.15 1993/08/25 18:55:19 mbretherton Exp rushing $
d6 3
d131 1
a131 1
  /* just has an initialization message in it.							  */
d140 2
a141 2
	* info instead.
	*/
d143 1
a143 1
	 mybuf,MAXINTERNALLINE,szAppProFile);
d145 1
a145 1
	 sscanf(mybuf,"%d,%d,%d,%d",&x,&y,&width,&height);
d149 10
a158 10
		       "WinVN -- Usenet News Reader",
		       WS_OVERLAPPEDWINDOW | WS_VSCROLL,
				 x,	/* Initial X position */
				 y,	/* Initial Y position */
				 width,	/* Initial X width */
				 height,/* Initial Y height */
		       NULL,
		       NULL,
		       hInstance,
		       NULL);
d164 1
a164 1
  NetDoc.hDocWnd = hWnd;	/* mrr */
d229 1
a229 1
  LineHeight = 30;		/* kludge so Net window doesn't get divide-by-zero */
d294 3
d394 1
a394 2
    }

d423 1
a423 1
  CheckView (hWndConf);		/* modify menu as necessary           */
d431 20
a450 20
	{
		hFont = CreateFont (FontSize,
		0,	/* width */
		0,	/* escapement */
		0,	/* orientation */
		FontBold ? FW_BOLD : FW_MEDIUM,
		0,	/* no italics */
		0,	/* no underline */
		0,	/* no strikeout */
		0,
		OUT_DEFAULT_PRECIS,
		CLIP_DEFAULT_PRECIS,
		0,	/* no PROOF_QUALITY */
		0,
		FontFace);
	}
	else
	{
		hFont = GetStockObject (OEM_FIXED_FONT);
	}
d453 40
a492 40
	{
		hFontArtNormal = CreateFont (ArticleFontSize,
		0,	/* width */
		0,	/* escapement */
		0,	/* orientation */
		FW_MEDIUM,    /* default weight */
		0,	/* no italics */
		0,	/* no underline */
		0,	/* no strikeout */
		0,
		OUT_DEFAULT_PRECIS,
		CLIP_DEFAULT_PRECIS,
		0,	/* no PROOF_QUALITY */
		0,
		ArticleFontFace);
	  hFontArtQuote = CreateFont (ArticleFontSize,
		0,	/* width */
		0,	/* escapement */
		0,	/* orientation */
		FW_MEDIUM,    /* default weight */
		1,	/* comments are in italics */
		0,	/* no underline */
		0,	/* no strikeout */
		0,
		OUT_DEFAULT_PRECIS,
		CLIP_DEFAULT_PRECIS,
		0,	/* no PROOF_QUALITY */
		0,
		ArticleFontFace);
	}
	else if (ArticleFixedFont)
	{
		hFontArtNormal  = GetStockObject (ANSI_FIXED_FONT);
		hFontArtQuote = GetStockObject (ANSI_FIXED_FONT);
	}
	else
	{
		hFontArtNormal = hFont;
		hFontArtQuote = hFont;
	}
d495 30
a524 30
	{
	  hFontPrint = CreateFont (PrintFontSize,
		                         0,     /* width */
		                         0,	/* escapement */
		                         0,	/* orientation */
		                         FW_MEDIUM,
		                         0,	/* no italics */
		                         0,	/* no underline */
		                         0,	/* no strikeout */
	                                 0,
		                         OUT_DEFAULT_PRECIS,
		                         CLIP_DEFAULT_PRECIS,
		                         0,	/* no PROOF_QUALITY */
		                         0,
		                         PrintFontFace);

	  hFontPrintB = CreateFont (PrintFontSize,
		                         0,     /* width */
		                         0,	/* escapement */
		                         0,	/* orientation */
		                         FW_BOLD,
		                         0,	/* no italics */
		                         0,	/* no underline */
		                         0,	/* no strikeout */
	                                 0,
		                         OUT_DEFAULT_PRECIS,
		                         CLIP_DEFAULT_PRECIS,
		                         0,	/* no PROOF_QUALITY */
		                         0,
		                         PrintFontFace);
d527 13
a539 13
		                         0,     /* width */
		                         0,	/* escapement */
		                         0,	/* orientation */
		                         FW_LIGHT,
		                         1,	/* italics */
		                         0,	/* no underline */
		                         0,	/* no strikeout */
	                                 0,
		                         OUT_DEFAULT_PRECIS,
		                         CLIP_DEFAULT_PRECIS,
		                         0,	/* no PROOF_QUALITY */
		                         0,
		                         PrintFontFace);
d542 16
a557 16
		                         0,     /* width */
		                         0,	/* escapement */
		                         0,	/* orientation */
		                         FW_EXTRABOLD,
		                         0,	/* no italics */
		                         1,	/* underline */
		                         0,	/* no strikeout */
	                                 0,
		                         OUT_DEFAULT_PRECIS,
		                         CLIP_DEFAULT_PRECIS,
		                         0,	/* no PROOF_QUALITY */
		                         0,
		                         "Helv");
	}
	else
	{
d559 28
a586 28
		                         0,     /* width */
		                         0,	/* escapement */
		                         0,	/* orientation */
		                         FW_MEDIUM,
		                         0,	/* no italics */
		                         0,	/* no underline */
		                         0,	/* no strikeout */
	                                 0,
		                         OUT_DEFAULT_PRECIS,
		                         CLIP_DEFAULT_PRECIS,
		                         0,	/* no PROOF_QUALITY */
		                         0,
		                         0);    /* Default Font Face */

		hFontPrintB = CreateFont (40,   /* default font size */
		                         0,     /* width */
		                         0,	/* escapement */
		                         0,	/* orientation */
		                         FW_BOLD,
		                         0,	/* no italics */
		                         0,	/* no underline */
		                         0,	/* no strikeout */
	                                 0,
		                         OUT_DEFAULT_PRECIS,
		                         CLIP_DEFAULT_PRECIS,
		                         0,	/* no PROOF_QUALITY */
		                         0,
		                         0);    /* default font face */
d589 13
a601 13
		                         0,     /* width */
		                         0,	/* escapement */
		                         0,	/* orientation */
		                         FW_LIGHT,
		                         1,	/* italics */
		                         0,	/* no underline */
		                         0,	/* no strikeout */
	                                 0,
		                         OUT_DEFAULT_PRECIS,
		                         CLIP_DEFAULT_PRECIS,
		                         0,	/* no PROOF_QUALITY */
		                         0,
		                         0);    /* default font face */
d604 14
a617 14
		                         0,     /* width */
		                         0,	/* escapement */
		                         0,	/* orientation */
		                         FW_EXTRABOLD,
		                         0,	/* no italics */
		                         1,	/* underline */
		                         0,	/* no strikeout */
	                                 0,
		                         OUT_DEFAULT_PRECIS,
		                         CLIP_DEFAULT_PRECIS,
		                         0,	/* no PROOF_QUALITY */
		                         0,
		                         "Helv");
	}
d657 1
a657 1
  savingArtIndex = -1;		/* reset to non-saving state */
d787 4
a790 4
	{
	  TranslateMessage (&MainMsg);
	  DispatchMessage (&MainMsg);
	}
@



1.15
log
@MRB merge, mail & post logging
@
text
@d1 1
d4 1
a4 1
 * $Id: winvn.c 1.14 1993/08/05 20:06:07 jcoop Exp $
d6 2
@



1.14
log
@save multiple articles changes by jcoop@@oakb2s01.apl.com (John S Cooper)
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.13 1993/07/13 16:03:04 riordan Exp $
d5 7
a33 1
 *
d281 1
a281 1
  MailDemandLogon = GetPrivateProfileInt (szAppName, "MailDemandLogon", FALSE, szAppProFile);
d284 5
d310 1
@



1.13
log
@MRR mods
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.12 1993/07/06 21:09:09 cnolan Exp $
d5 3
d289 1
d637 1
@



1.12
log
@win32 support
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.11 1993/06/25 20:14:09 dumoulin Exp $
d5 3
d233 3
@



1.11
log
@Cleaned up Compiler Warnings
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.10 1993/06/24 17:13:14 riordan Exp dumoulin $
d5 3
d654 1
a654 1
      SetCommState ((DCB FAR *) & DCBComm);
@



1.10
log
@Save window positions between sessions.
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.9 1993/06/11 00:12:13 rushing Exp $
d5 3
d123 1
a123 1
  if(mybuf != '!') {
d199 1
a199 1
  char mesbuf[60];
d201 1
a201 1
  char *errptr;
@



1.9
log
@second merge from Matt Bretherton sources.
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.8 1993/05/28 17:18:00 rushing Exp $
d5 2
d8 1
a47 5
 *  WINVN currently only reads articles; it does not allow posting
 *  or mailing.  Posting will be implemented when I get around to it;
 *  the delay is due to the need to first implement an authentication
 *  scheme so we know the poster is accurately identified.
 *
d52 1
d91 3
d107 1
a107 1
  /* just has an initialization message in it.                      */
d109 15
d127 4
a130 4
		       0,	/* Initial X position */
		       0,	/* Initial Y position */
		       (int) (xScreen * 1 / 2),	/* Initial X width */
		       (int) (yScreen * 9 / 10),/* Initial Y height */
a756 1

@



1.8
log
@Added Misc... option to enable threading
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.7 1993/05/24 23:27:38 rushing Exp rushing $
d5 4
d183 1
d243 8
d264 1
@



1.7
log
@Create an Article Italics Font for Quotation lines (MRB)
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.6 1993/05/18 22:10:45 rushing Exp $
d5 2
d8 1
d197 1
@



1.6
log
@smtp support
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.5 1993/05/13 19:58:35 rushing Exp rushing $
d5 4
d383 1
a383 1
		hFontArt = CreateFont (ArticleFontSize,
d397 14
d414 2
a415 1
		hFontArt = GetStockObject (ANSI_FIXED_FONT);
d419 2
a420 1
		hFontArt = hFont;
d569 1
a569 1
  SelectObject (hDC, hFontArt);
@



1.5
log
@fancy 'from' in group window
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.4 1993/05/13 16:18:00 rushing Exp rushing $
d5 3
d190 2
a191 1
  GetPrivateProfileString (szAppName, "NNTPHost", "titan", NNTPHost, MAXNNTPSIZE,szAppProFile);
d237 1
a237 1
  lpfnWinVnSubjectDlg = MakeProcInstance (WinVnSubjectDlg, hInstance);
@



1.4
log
@article fetch limit (ArticleThreshold .ini param) support.
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.3 1993/04/29 20:25:23 rushing Exp rushing $
d5 3
d199 4
a202 1
  DoList = GetPrivateProfileInt (szAppName, "DoList", ID_DOLIST_ASK,szAppProFile);
@



1.3
log
@attempted support for WSAAsyncSelect
@
text
@d3 1
a3 1
 * $Id: winvn.c 1.2 1993/03/09 01:28:03 dumoulin Exp rushing $
d5 3
d187 1
d195 1
a195 1

d197 2
d233 1
@



1.2
log
@added support for italic fonts in printing articles
@
text
@d3 5
a7 2
 * $Id: winvn.c%v 1.1 1993/02/16 20:53:50 rushing Exp rushing $
 * $Log: winvn.c%v $
a78 5
  /* Set up communications--serial or IP.                           */

  if (MRRInitComm ())
      PostQuitMessage(0);

d104 5
@



1.1
log
@Initial revision
@
text
@d3 4
a6 2
 * $Id$
 * $Log$
d8 1
d327 1
d415 15
d468 15
@

