Changeset 9376 for trunk/src


Ignore:
Timestamp:
Oct 29, 2002, 4:37:07 PM (23 years ago)
Author:
sandervl
Message:

Write default printer name to win.ini

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comdlg32/initcomdlg32.cpp

    r6645 r9376  
    1 /* $Id: initcomdlg32.cpp,v 1.3 2001-09-05 12:12:02 bird Exp $ */
     1/* $Id: initcomdlg32.cpp,v 1.4 2002-10-29 15:37:07 sandervl Exp $ */
    22/*
    33 * DLL entry point
     
    2626#define  INCL_DOSMODULEMGR
    2727#define  INCL_DOSPROCESS
     28#define  INCL_WINSHELLDATA
    2829#include <os2wrap.h>    //Odin32 OS/2 api wrappers
    2930#include <stdlib.h>
     
    3233#include <odin.h>
    3334#include <win32type.h>
     35#include <win32api.h>
    3436#include <winconst.h>
    3537#include <odinlx.h>
     
    5355   {
    5456   case DLL_PROCESS_ATTACH:
     57   {
     58       //Write default printer name to win.ini
     59       char achDefPrnName[256];
     60       if(PrfQueryProfileString(HINI_PROFILE, "PM_SPOOLER", "PRINTER", "", achDefPrnName,
     61                                 sizeof(achDefPrnName)) > 1)
     62       {
     63            int len = strlen(achDefPrnName);
     64            if(achDefPrnName[len-1] == ';') {
     65                achDefPrnName[len-1] = 0;
     66            }
     67            strcat(achDefPrnName, ",");
     68            WriteProfileStringA("windows", "device", achDefPrnName);
     69       }
     70       return COMDLG32_DllEntryPoint(hinstDLL, fdwReason, fImpLoad);
     71   }
     72
    5573   case DLL_THREAD_ATTACH:
    5674   case DLL_THREAD_DETACH:
    57     return COMDLG32_DllEntryPoint(hinstDLL, fdwReason, fImpLoad);
    58 
    5975   case DLL_PROCESS_DETACH:
    60     COMDLG32_DllEntryPoint(hinstDLL, fdwReason, fImpLoad);
    61     return TRUE;
     76       COMDLG32_DllEntryPoint(hinstDLL, fdwReason, fImpLoad);
     77       return TRUE;
    6278   }
    6379   return FALSE;
     
    84100   switch (ulFlag) {
    85101      case 0 :
    86      dllHandle = RegisterLxDll(hModule, LibMainComdlg32, (PVOID)&comdlg32_PEResTab,
     102         dllHandle = RegisterLxDll(hModule, LibMainComdlg32, (PVOID)&comdlg32_PEResTab,
    87103                                   COMDLG32_MAJORIMAGE_VERSION, COMDLG32_MINORIMAGE_VERSION,
    88104                                   IMAGE_SUBSYSTEM_WINDOWS_GUI);
    89105         if(dllHandle == 0)
    90         return 0UL;
    91 
     106             return 0UL;
     107 
    92108         break;
    93109      case 1 :
    94110         if(dllHandle) {
    95         UnregisterLxDll(dllHandle);
     111             UnregisterLxDll(dllHandle);
    96112         }
    97113         break;
Note: See TracChangeset for help on using the changeset viewer.