Jump to content
Fivewin Brasil

Erro ao enviar e-mail via CDOMessage e Gmail


Marca

Recommended Posts

C:\FWH1608\SOURCE\FUNCTION\GETSYSIN.PRG

#include "FiveWin.ch"
	#define HORZRES             8
#define VERTRES            10
#Define BITSPIXEL          12
#define PLANES             14
#define LOGPIXELSX         88
#define LOGPIXELSY         90
	#ifndef SM_DIGITIZER
#define SM_DIGITIZER            94
#endif
#ifndef SM_CMOUSEBUTTONS
#define SM_CMOUSEBUTTONS        43
#endif
	//----------------------------------------------------------------------------//
	Function LargeFonts( nPixelX, nPixelY )
	  Local hDC
	  hDC     := CreateDC( "DISPLAY", "", "" )
  nPixelX := GetDeviceCaps( hDC, LOGPIXELSX )
  nPixelY := GetDeviceCaps( hDC, LOGPIXELSY )
	  DeleteDC( hDC )
	Return ( nPixelX >= 120 )
	//----------------------------------------------------------------------------//
	function DispFontPerSize()
	   local hDC, nPixelX
	   hDC     = CreateDC( "DISPLAY", "", "" )
   nPixelX = GetDeviceCaps( hDC, LOGPIXELSX )
	   DeleteDC( hDC )
	return ( nPixelX / 96 )
	//----------------------------------------------------------------------------//
	function ColorsQty()
	   local hDC, nPlanes, nBitsPixel
	   hDC        = CreateDC( "DISPLAY", "", "" )
   nPlanes    = GetDeviceCaps( hDC, PLANES )
   nBitsPixel = GetDeviceCaps( hDC, BITSPIXEL )
	   DeleteDC( hDC )
	return Int( 2 ^ ( nPlanes * nBitsPixel ) )
	//----------------------------------------------------------------------------//
	function ScrResolution( nWidth, nHeight )
	   local hDC
	   hDC     = CreateDC( "DISPLAY", "", "" )
   nWidth  = GetDeviceCaps( hDC, HORZRES )
   nHeight = GetDeviceCaps( hDC, VERTRES )
	   DeleteDC( hDC )
	return { nWidth, nHeight }
	//----------------------------------------------------------------------------//
	#define VER_PLATFORM_WIN32s         0
#define VER_PLATFORM_WIN32_WINDOWS  1
#define VER_PLATFORM_WIN32_NT       2
	function cWinVersion()
	   local aVersion := GetVersion()
   local cVersion := ""
	   do case
      case aVersion[ 4 ] == VER_PLATFORM_WIN32_NT
           if aVersion[ 1 ] == 6
             if aVersion[ 2 ] == 0
                cVersion = "Vista"
             elseif aVersion[ 2 ] == 1
                cVersion = "7"
             elseif aVersion[ 2 ] == 2
                if IsWindows10()                 
                   cVersion = "10"
                else                         
                   cVersion = "8"   
                endif                            
             endif
           endif  
                 
           if aVersion[ 1 ] == 5
              if aVersion[ 2 ] == 2
                 cVersion = "Server 2003"
              elseif aVersion[ 2 ] == 1
                 cVersion = "XP"
              elseif aVersion[ 2 ] == 0
                 cVersion = "2000"
              endif
           endif
	           if aVersion[ 1 ] <= 4
              cVersion = "NT"
           endif
	      case aVersion[ 4 ] == VER_PLATFORM_WIN32_WINDOWS
           if aVersion[ 1 ] == 4
              if aVersion[ 2 ] == 90
                 cVersion = "ME"
              elseif aVersion[ 2 ] == 10
                 cVersion = "98"
              elseif aVersion[ 2 ] == 0
                 cVersion = "95"
              endif
           endif
   endcase
	   cVersion += IF( IsWin64(), " 64 ", " 32 " ) + "Bits"
	return cVersion
	//----------------------------------------------------------------------------//
	function IsWinVista()
	return ( "Vista" $ cWinVersion() )
	//----------------------------------------------------------------------------//
	function IsWinXP()
	return ( "XP" $ cWinVersion() )
	//----------------------------------------------------------------------------//
	function IsWin2000()
	return ( "2000" $ cWinVersion() )
	//----------------------------------------------------------------------------//
	function IsWin7()
	return "7" $ cWinVersion()
	//----------------------------------------------------------------------------//
	function IsWin8()
	return "8" == cWinVersion()
	//----------------------------------------------------------------------------//
	#define  HKEY_LOCAL_MACHINE  2147483650  // 0x80000002
#ifndef HKEY_CURRENT_USER
   #define  HKEY_CURRENT_USER       2147483649        // 0x80000001
#endif
	function IsWindows10()
	   local oReg := TReg32():New( HKEY_LOCAL_MACHINE,;
                               "SOFTWARE\Microsoft\Windows NT\CurrentVersion",;
                               .F. )
   local cProductName := oReg:Get( "ProductName" )
	   oReg:Close()
	return "Windows 10" $ cProductName
	//----------------------------------------------------------------------------//
	function FW_IsTouchScreen();  return ( GetSysMetrics( SM_DIGITIZER )     > 0 )
function FW_IsMousePresent(); return ( GetSysMetrics( SM_CMOUSEBUTTONS ) > 0 )
	//----------------------------------------------------------------------------//
	function FW_IsTabletMode()
	
   local oReg, lTabletMode := .f.
	   if IsWindows10()
	      oReg:= TReg32():New( HKEY_CURRENT_USER,;
             "SOFTWARE\Microsoft\Windows\CurrentVersion\ImmersiveShell" )
      lTabletMode := ( oReg:Get( "TabletMode", 0 ) > 0 )
	   endif
	return lTabletMode
	//----------------------------------------------------------------------------//
	function GetCPUSpeed()
	   local oReg := TReg32():New( HKEY_LOCAL_MACHINE,;
                       "HARDWARE\DESCRIPTION\System\CentralProcessor\0",;
                       .F. )
   local nCpuSpeed := oReg:Get( "~MHz", 0 )
	   oReg:Close()
	return nCpuSpeed
	//----------------------------------------------------------------------------//
	function GetSysFont()
	   do case
      case ! IsWinNt() .and. ! IsWin95()  // Win 3.1
           return "System"
   endcase
	return If( IsWindows10() .or. IsWin8(), "Segoe UI", "Ms Sans Serif" ) // Win NT, 9x
	//----------------------------------------------------------------------------//
	function BorlandVersion()
	   #ifdef __XHARBOUR__
      local cHexVer := NumToHex( BorlandC() )
   #else
      local cHexVer := hb_NumToHex( BorlandC() )
   #endif
	return SubStr( cHexVer, 1, 1 ) + "." + SubStr( cHexVer, 2 )
	//----------------------------------------------------------------------------//
	function SaveDesktop( cPngFileName )
	   local o := TWindow()
	   DestroyWindow( o:hWnd )
   o:hWnd = GetDesktopWindow()
   o:SaveToPng( cPngFileName )
	return nil
	//----------------------------------------------------------------------------//
	#define SM_CXFULLSCREEN  16
#define SM_CYFULLSCREEN  17
	function ScreenWidth()
	return GetSysMetrics( SM_CXFULLSCREEN )
	function ScreenHeight()
	return GetSysMetrics( SM_CYFULLSCREEN )
	function ScreenHeightMM()
	   local hDC, nHeight
	   hDC      := GetDC( 0 )
   nHeight  := GetDeviceCaps( hDC, 6 ) // VERTSIZE = 6
   ReleaseDC( hDC )
	return nHeight
	
function ScreenWidthMM()
	   local hDC, nWidth
	   hDC      := GetDC( 0 )
   nWidth   := GetDeviceCaps( hDC, 4 ) // HORZSIZE = 4
   ReleaseDC( hDC )
	return nWidth
	function ScreenSize( lInches )
	   local hDC, nWidth, nHeight, nDiag
	   hDC      := GetDC( 0 )
   nWidth   := GetDeviceCaps( hDC, 4 ) // HORZSIZE = 4
   nHeight  := GetDeviceCaps( hDC, 6 ) // VERTSIZE = 6
   ReleaseDC( hDC )
	   nDiag    := SQRT( nWidth * nWidth + nHeight * nHeight )
	return If( lInches == .t., nDiag / 25.4, nDiag )
	//----------------------------------------------------------------------------//
	function IsWin64()
	return ! Empty( GetEnv( "ProgramFiles(x86)" ) )
	//----------------------------------------------------------------------------//


 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...