GetMachineId 1.5i2 :

- primo rilascio.
This commit is contained in:
Dario Sassi
2014-09-13 21:31:49 +00:00
parent 26aa837bd9
commit 93af405f1b
7 changed files with 267 additions and 0 deletions
+105
View File
@@ -0,0 +1,105 @@
//----------------------------------------------------------------------------
// EgalTech 2014-2014
//----------------------------------------------------------------------------
// File : GetMachineId.cpp Data : 13.09.14 Versione : 1.5i2
// Contenuto : Programma per lettura identificativo di macchina.
//
//
//
// Modifiche : 13.09.14 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include <Windows.h>
#include <CommCtrl.h>
#include <wchar.h>
#include "resource.h"
#include "/EgtDev/Include/EGnStringConverter.h"
#include "/EgtDev/Include/SELkMachineId.h"
//------------------------------------------------------------------------------
#pragma comment( linker, \
"\"/manifestdependency:type='Win32' "\
"name='Microsoft.Windows.Common-Controls' "\
"version='6.0.0.0' "\
"processorArchitecture='x86' "\
"publicKeyToken='6595b64144ccf1df' "\
"language='*'\"")
#pragma comment( lib, "ComCtl32.lib")
#include "/EgtDev/Include/EgtLibVer.h"
#pragma comment( lib, EGTLIBDIR "SEgtLock" EGTLIBVER ".lib")
//------------------------------------------------------------------------------
INT_PTR CALLBACK
DialogProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch( uMsg) {
case WM_COMMAND :
switch ( LOWORD( wParam)) {
case IDOK :
SendMessage( hDlg, WM_CLOSE, 0, 0) ;
return TRUE ;
}
break ;
case WM_CLOSE :
DestroyWindow( hDlg) ;
return TRUE ;
case WM_DESTROY :
PostQuitMessage( 0) ;
return TRUE ;
}
return FALSE ;
}
//------------------------------------------------------------------------------
int WINAPI
wWinMain( HINSTANCE hInst, HINSTANCE h0, LPTSTR lpCmdLine, int nCmdShow)
{
// inizializzazioni
InitCommonControls() ;
HWND hDlg = CreateDialogParam( hInst, MAKEINTRESOURCE( IDD_DIALOG1), NULL, DialogProc, 0) ;
HWND hText = GetDlgItem( hDlg, IDC_MACHID) ;
SetClassLong( hDlg, GCL_HICON, (LONG) LoadIcon( hInst, MAKEINTRESOURCE(IDI_ICON))) ;
// se realese verifico debug non attivo
#if defined( NDEBUG)
BOOL IsDbgPresent = FALSE ;
CheckRemoteDebuggerPresent( GetCurrentProcess(), &IsDbgPresent) ;
if ( IsDbgPresent)
return 0 ;
#endif
// calcolo MachineId e lo imposto nell'edit
std::string sMachineId ;
if ( ! CalcMachineId( false) ||
! GetMachineId2( sMachineId))
sMachineId = "Error" ;
SetWindowTextW( hText, stringtoW( sMachineId)) ;
// visualizzzione dialogo
ShowWindow( hDlg, nCmdShow) ;
// loop dei messaggi
MSG msg ;
BOOL ret ;
while ( ( ret = GetMessage( &msg, 0, 0, 0)) != 0) {
if ( ret == -1)
return -1 ;
if ( ! IsDialogMessage( hDlg, &msg)) {
TranslateMessage( &msg) ;
DispatchMessage( &msg) ;
}
}
return 0 ;
}
BIN
View File
Binary file not shown.
+20
View File
@@ -0,0 +1,20 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GetMachineId", "GetMachineId.vcxproj", "{ADB37476-30A3-4A12-BEED-58D4F18EDE54}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ADB37476-30A3-4A12-BEED-58D4F18EDE54}.Debug|Win32.ActiveCfg = Debug|Win32
{ADB37476-30A3-4A12-BEED-58D4F18EDE54}.Debug|Win32.Build.0 = Debug|Win32
{ADB37476-30A3-4A12-BEED-58D4F18EDE54}.Release|Win32.ActiveCfg = Release|Win32
{ADB37476-30A3-4A12-BEED-58D4F18EDE54}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+105
View File
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{ADB37476-30A3-4A12-BEED-58D4F18EDE54}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>GetMachineId</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)$(Configuration)$(PlatformArchitecture)\</OutDir>
<IntDir>$(Configuration)$(PlatformArchitecture)\</IntDir>
<TargetName>$(ProjectName)D$(PlatformArchitecture)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)$(Configuration)$(PlatformArchitecture)\</OutDir>
<IntDir>$(Configuration)$(PlatformArchitecture)\</IntDir>
<TargetName>$(ProjectName)R$(PlatformArchitecture)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>copy $(TargetPath) \EgtProg\GetMachineId\</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
<Command>copy $(TargetPath) \EgtProg\GetMachineId\</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="GetMachineId.rc" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="GetMachineId.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="res\GetMachineId.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+37
View File
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="File di origine">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="File di intestazione">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="File di risorse">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h">
<Filter>File di intestazione</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="GetMachineId.rc">
<Filter>File di risorse</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<ClCompile Include="GetMachineId.cpp">
<Filter>File di origine</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="res\GetMachineId.ico">
<Filter>File di risorse</Filter>
</None>
</ItemGroup>
</Project>
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

BIN
View File
Binary file not shown.