1 |
|
3 |
//---------------------------------------------------------------------------
|
2 |
|
|
#include <vcl\vcl.h>
|
3 |
|
|
#include <stdio.h>
|
4 |
|
|
#pragma hdrstop
|
5 |
|
|
|
6 |
|
|
#include "aproposde.h"
|
7 |
|
|
//---------------------------------------------------------------------------
|
8 |
|
|
#pragma resource "*.dfm"
|
9 |
|
|
Tsignature *signature;
|
10 |
|
|
//---------------------------------------------------------------------------
|
11 |
|
|
__fastcall Tsignature::Tsignature(TComponent* Owner)
|
12 |
|
|
: TForm(Owner)
|
13 |
|
|
{
|
14 |
|
|
}
|
15 |
|
|
//---------------------------------------------------------------------------
|
16 |
|
|
void __fastcall Tsignature::Button1Click(TObject *Sender)
|
17 |
|
|
{
|
18 |
|
|
signature->Close();
|
19 |
|
|
}
|
20 |
|
|
//---------------------------------------------------------------------------
|
21 |
|
|
void __fastcall Tsignature::FormClose(TObject *Sender, TCloseAction &Action)
|
22 |
|
|
{
|
23 |
|
|
Action=caFree;
|
24 |
|
|
}
|
25 |
|
|
//---------------------------------------------------------------------------
|
26 |
|
|
void __fastcall Tsignature::FormCreate(TObject *Sender)
|
27 |
|
|
{
|
28 |
|
|
int res;
|
29 |
|
|
HKEY clef;
|
30 |
|
|
DWORD type,taille;
|
31 |
|
|
BYTE *company,*name;
|
32 |
|
|
char mess[255];
|
33 |
|
|
/*
|
34 |
|
|
res=RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\ERIN\\Mailleur Automatique\\2.0",0,KEY_ALL_ACCESS,&clef);
|
35 |
|
|
if (res!=ERROR_SUCCESS) return;
|
36 |
|
|
|
37 |
|
|
res=RegQueryValueEx(clef,"Name",0,&type,0,&taille);
|
38 |
|
|
if (res!=ERROR_SUCCESS) return;
|
39 |
|
|
name=new BYTE[taille];
|
40 |
|
|
RegQueryValueEx(clef,"Name",0,&type,name,&taille);
|
41 |
|
|
|
42 |
|
|
res=RegQueryValueEx(clef,"Company",0,&type,0,&taille);
|
43 |
|
|
if (res!=ERROR_SUCCESS) return;
|
44 |
|
|
company=new BYTE[taille];
|
45 |
|
|
RegQueryValueEx(clef,"Company",0,&type,company,&taille);
|
46 |
|
|
sprintf(mess,"Licence accordée à %s\\%s",name,company);
|
47 |
|
|
Label7->Caption=mess;
|
48 |
|
|
delete name;
|
49 |
|
|
delete company;
|
50 |
|
|
RegCloseKey(clef);
|
51 |
|
|
*/
|
52 |
|
|
}
|
53 |
|
|
//---------------------------------------------------------------------------
|