Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
main.cpp File Reference
#include <windows.h>
#include <windowsx.h>
#include <string.h>
#include <stdlib.h>
#include <mapi.h>
#include "port.h"
#include "resource.h"

Go to the source code of this file.

Defines

#define WM_PAINTICON   0x26

Functions

BOOL InitInstance (HINSTANCE hInstance, int nCmdShow)
BOOL CALLBACK LOADDS MyDlgProc (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
void ProcessCommand (HWND hWnd, int id, HWND hCtl, UINT codeNotify)
BOOL OpenMAPI (void)
void CloseMAPI (void)
void AppCleanup (void)
BOOL InitApp (void)
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Variables

HINSTANCE hInst
HWND hWnd
char NEAR szAppName [] = "Netscape QA Helper"
char NEAR szShortAppName [] = "QAHelper"
char szClassName [] = "Netscape_QAHelper_Class_Name"

Define Documentation

#define WM_PAINTICON   0x26

Definition at line 50 of file main.cpp.


Function Documentation

Definition at line 77 of file main.cpp.

{
  extern void    DoMAPILogoff(HWND hWnd);
  static BOOL isDone = FALSE;

  if (isDone)
    return;

  extern LHANDLE    mapiSession;

  if (mapiSession != 0)
  {
    DoMAPILogoff(hWnd);
  }

  CloseMAPI();
  isDone = TRUE;
}

Here is the call graph for this function:

Definition at line 192 of file mapiproc.cpp.

Here is the caller graph for this function:

BOOL InitApp ( void  )

Definition at line 110 of file main.cpp.

{
#ifndef WIN16
  WNDCLASS wc;
  wc.style         = 0; 
  wc.lpfnWndProc   = DefDlgProc; 
  wc.cbClsExtra    = 0; 
  wc.cbWndExtra    = DLGWINDOWEXTRA; 
  wc.hInstance     = hInst; 
  wc.hIcon         = LoadIcon(hInst, MAKEINTRESOURCE(ID_ICON_APP)); 
  wc.hCursor       = LoadCursor(0, IDC_ARROW); 
  wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
  wc.lpszMenuName  = NULL; 
  wc.lpszClassName = szClassName;
  
  if(!RegisterClass(&wc))
    return FALSE;

#else                
  hIconApp = LoadIcon(hInst, MAKEINTRESOURCE(ID_ICON_APP));
#endif
  
  return TRUE;
} // end InitApp
BOOL InitInstance ( HINSTANCE  hInstance,
int  nCmdShow 
)

Definition at line 97 of file main.cpp.

{
  /* Create a main window for this application instance.  */
  hWnd = CreateDialog((HINSTANCE) hInstance, 
            MAKEINTRESOURCE(ID_DIALOG),
            (HWND) NULL, (DLGPROC) MyDlgProc);
  
  if (!hWnd)
    return FALSE;
  else
    return TRUE;
}

Here is the call graph for this function:

BOOL CALLBACK LOADDS MyDlgProc ( HWND  hWnd,
UINT  wMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 174 of file mapiproc.cpp.

{
#ifdef WIN16
       m_hInstMapi = LoadLibrary("Y:\\ns\\cmd\\winfe\\mapi\\MAPI.DLL");      
#else
  m_hInstMapi = LoadLibrary("..\\..\\..\\..\\mapidll\\mozMAPI32.DLL");
#endif

  if (!m_hInstMapi)
  {
    ShowMessage(NULL, "Error Loading the MAPI DLL...Probably not found!");
    return(FALSE);
  }

  return(TRUE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void ProcessCommand ( HWND  hWnd,
int  id,
HWND  hCtl,
UINT  codeNotify 
)

Definition at line 69 of file mapiipc.cpp.

{ 
       switch (id) 
       {
       case IDOK:   
       case IDCANCEL:
              {
                     ShowWindow(hWnd, SW_HIDE);
              }
              
       default:
              ;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

int WINAPI WinMain ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPSTR  lpCmdLine,
int  nCmdShow 
)

Definition at line 136 of file main.cpp.

{
  MSG     msg;
  
  hInst = hInstance;
  
  if (!InitApp()) 
  { 
    return FALSE;
  }
  
  if (!InitInstance(hInstance, nCmdShow)) 
  {    
    return FALSE;
  }

  if (!OpenMAPI()) 
  {    
    return FALSE;
  }

  ShowWindow(hWnd, SW_SHOW);
  
  // Start the application
  while ((GetMessage(&msg, (HWND) NULL, (UINT) NULL, (UINT) NULL)))
  {
    if(IsDialogMessage(hWnd, &msg))
      continue;
    
    TranslateMessage(&msg);
    DispatchMessage(&msg);
  }

  return(msg.wParam);
}

Here is the call graph for this function:


Variable Documentation

Definition at line 65 of file main.cpp.

Definition at line 66 of file main.cpp.

char NEAR szAppName[] = "Netscape QA Helper"

Definition at line 72 of file main.cpp.

char szClassName[] = "Netscape_QAHelper_Class_Name"

Definition at line 74 of file main.cpp.

char NEAR szShortAppName[] = "QAHelper"

Definition at line 73 of file main.cpp.