Registry.hpp 找不到

aocaopo 2011-03-26 07:52:53
//UNIT1.H
//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Registry.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TListBox *ListBox1;
TButton *Button1;
TButton *Button2;
TMemo *Memo1;
void __fastcall Button1Click(TObject *Sender);
void __fastcall Button2Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif


//UNIT1.CPP
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h "
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm "
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
TRegistry *Registry = new TRegistry;
try
{
ListBox1-> Items-> Clear();
Registry-> RootKey =HKEY_CURRENT_USER;
Registry-> OpenKey( "Software\\Microsoft\\Windows\\CurrentVersion\\Run ",false);
Registry-> GetValueNames(ListBox1-> Items);
Registry-> CloseKey();
}
__finally
{
delete Registry;
ListBox1-> ItemIndex=0;
}
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button2Click(TObject *Sender)
{
TRegistry *Registry = new TRegistry;
AnsiString s;

if ( ListBox1-> Items-> Count )
{
Registry-> RootKey =HKEY_CURRENT_USER;
Registry-> OpenKey( "Software\\Microsoft\\Windows\\CurrentVersion\\Run ",false);
for (int i=0;i <ListBox1-> Items-> Count; i++)
{
s=Registry-> ReadString(ListBox1-> Items-> Strings[i]);
Memo1-> Lines-> Add( "键: "+ListBox1-> Items-> Strings[i]+ " 值: "+s);
}
Registry-> CloseKey();
}
delete Registry;
}
//---------------------------------------------------------------------------

...全文
168 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
usecf 2011-03-29
  • 打赏
  • 举报
回复
学习一下
银点 2011-03-28
  • 打赏
  • 举报
回复
唉,我都算是不靠谱的了。
ccrun.com 2011-03-28
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 aocaopo 的回复:]
不是vc 是用 MinGW
[/Quote]

1. 我说的也不是VC.
2. MinGW是不能编译这段代码的, 涉及到VCL的只能用C++Builder来编译.
hemiya 2011-03-28
  • 打赏
  • 举报
回复
楼主,很扯。
用mingw编译cb的代码。
My_Love 2011-03-28
  • 打赏
  • 举报
回复
LZ来搞笑的吧?
MinGW跑C++Builder来提问!
paste 2011-03-28
  • 打赏
  • 举报
回复
我是来围观妖哥的...
ccrun.com 2011-03-28
  • 打赏
  • 举报
回复
aocaopo 2011-03-28
  • 打赏
  • 举报
回复
MinGW 想对注册表操作 没找到 合适的代码
ccrun.com 2011-03-28
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 aocaopo 的回复:]
c++builder MinGW vc ....

我想做控制台小程序开发 用啥好?
[/Quote]

啥都行。
aocaopo 2011-03-28
  • 打赏
  • 举报
回复
c++builder MinGW vc ....

我想做控制台小程序开发 用啥好?
ccrun.com 2011-03-28
  • 打赏
  • 举报
回复
aocaopo 2011-03-28
  • 打赏
  • 举报
回复
跪求 对注册 表操作 的代码
aocaopo 2011-03-28
  • 打赏
  • 举报
回复
囧 囧 囧 !


那怎么用 MinGW 编译实现对注册表操作的代码?
aocaopo 2011-03-28
  • 打赏
  • 举报
回复
不是vc 是用 MinGW
ccrun.com 2011-03-26
  • 打赏
  • 举报
回复
Project-->Options-->Directories/Conditionals-->Include path中,将$(BCB)\include;$(BCB)\include\vcl添加进去。

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧