Visual Studio 2010 注册信息修改器

之所以要改这个,就是看那个启动界面不爽。嘎嘎,显示什么微软用户。当然了这个东西可以直接修改注册表或者手工修改,为了简单一点,直接做了个工具出来。

猛击此处下载!

 

界面如下:

源代码在这里,没什么东西。很简单。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, SkinExCtrls, SkinCtrls, Mask, SkinBoxCtrls, SkinData,
  DynamicSkinForm ,registry,ShellAPI, spMessages, spTrayIcon;
 
type
  TForm1 = class(TForm)
    spDynamicSkinForm1: TspDynamicSkinForm;
    spSkinData1: TspSkinData;
    spSkinFrame1: TspSkinFrame;
    spCompressedStoredSkin1: TspCompressedStoredSkin;
    spCompressedSkinList1: TspCompressedSkinList;
    spResourceStrData1: TspResourceStrData;
    spSkinShadowLabel1: TspSkinShadowLabel;
    spSkinShadowLabel2: TspSkinShadowLabel;
    spSkinStatusBar1: TspSkinStatusBar;
    spSkinButton2: TspSkinButton;
    spSkinEdit_org: TspSkinEdit;
    spSkinEdit_name: TspSkinEdit;
    spSkinStatusPanel1: TspSkinStatusPanel;
    spSkinStatusPanel2: TspSkinStatusPanel;
    spSkinLinkLabel1: TspSkinLinkLabel;
    spSkinShadowLabel3: TspSkinShadowLabel;
    spSkinEdit_path: TspSkinEdit;
    spSkinMessage1: TspSkinMessage;
    spTrayIcon1: TspTrayIcon;
    procedure FormCreate(Sender: TObject);
    procedure spSkinButton2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
  regKeyName:TRegistry;
  regKeyOrg:TRegistry;
  vsPathKey:TRegistry;
  IsWin64bit:Boolean;
implementation
 
{$R *.dfm}
 
function IsWin64: Boolean;
var
  Kernel32Handle: THandle;
  IsWow64Process: function(Handle: Windows.THandle; var Res: Windows.BOOL): Windows.BOOL; stdcall;
  GetNativeSystemInfo: procedure(var lpSystemInfo: TSystemInfo); stdcall;
  isWoW64: Bool;
  SystemInfo: TSystemInfo;
const
  PROCESSOR_ARCHITECTURE_AMD64 = 9;
  PROCESSOR_ARCHITECTURE_IA64 = 6;
begin
  Kernel32Handle := GetModuleHandle('KERNEL32.DLL');
  if Kernel32Handle = 0 then
    Kernel32Handle := LoadLibrary('KERNEL32.DLL');
  if Kernel32Handle <> 0 then
  begin
    IsWOW64Process := GetProcAddress(Kernel32Handle,'IsWow64Process');
    GetNativeSystemInfo := GetProcAddress(Kernel32Handle,'GetNativeSystemInfo');
    if Assigned(IsWow64Process) then
    begin
      IsWow64Process(GetCurrentProcess,isWoW64);
      Result := isWoW64 and Assigned(GetNativeSystemInfo);
      if Result then
      begin
        GetNativeSystemInfo(SystemInfo);
        Result := (SystemInfo.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_AMD64) or
                  (SystemInfo.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_IA64);
      end;
    end
    else Result := False;
  end
  else Result := False;
end;
 
procedure TForm1.FormCreate(Sender: TObject);
begin
   regKeyName := TRegistry.Create;
   regKeyName.RootKey := HKEY_LOCAL_MACHINE;
   regKeyOrg := TRegistry.Create;
   regKeyOrg.RootKey := HKEY_LOCAL_MACHINE;
   vsPathKey := TRegistry.Create;
   vsPathKey.RootKey := HKEY_LOCAL_MACHINE;
   IsWin64bit := IsWin64();
   if IsWin64bit then  begin
      regKeyName.OpenKey('SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Registration',True);
      spSkinEdit_name.Text := regKeyName.ReadString('UserName') ;
      regKeyOrg.OpenKey('SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion',True);
      spSkinEdit_org.Text := regKeyOrg.ReadString('RegisteredOrganization');
   end else begin
      regKeyName.OpenKey('SOFTWARE\Microsoft\VisualStudio\10.0\Registration',True);
      spSkinEdit_name.Text := regKeyName.ReadString('UserName') ;
      regKeyOrg.OpenKey('SOFTWARE\Microsoft\Windows NT\CurrentVersion',True);
      spSkinEdit_org.Text := regKeyOrg.ReadString('RegisteredOrganization');
   end;
   vsPathKey.OpenKey('SOFTWARE\Microsoft\VisualStudio\10.0\Setup\VS',True);
   spSkinEdit_path.Text := vsPathKey.ReadString('EnvironmentDirectory');
   if spSkinEdit_path.Text = '' then begin
      spSkinButton2.Enabled := False;
      spSkinMessage1.MessageDlg('当前系统可能没有安装Visual Studio 2010 !',mtWarning,[mbOK],0 );
   end;
end;
 
procedure TForm1.spSkinButton2Click(Sender: TObject);
var
  tmpcmd:string;
begin
    regKeyOrg.WriteString('RegisteredOrganization',spSkinEdit_org.Text);
    regKeyName.WriteString('UserName',spSkinEdit_name.Text);
    tmpcmd := '"' + spSkinEdit_path.Text + 'devenv.exe"';
    //WinExec(PAnsiChar(tmpcmd),SW_SHOWNORMAL);
    ShellExecute(handle,nil,PWideChar(tmpcmd),pchar(' /setup'),nil,sw_hide);
    //ShowMessage('已经修改成功,请重新启动Visual Studio 2010 查看效果!');
    spSkinMessage1.MessageDlg('已经修改成功,请重新启动Visual Studio 2010 查看效果!',mtInformation,[mbOK],0 );
end;
 
end.

 

You may also like

2条评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注