Unitview.cpp
上传用户:cqslgg
上传日期:2009-12-10
资源大小:128k
文件大小:1k
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "Unitcontrol.h"
- #include "Unitview.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- #pragma resource "bitmap.res"
- TFormView *FormView;
- //---------------------------------------------------------------------------
- __fastcall TFormView::TFormView(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TFormView::Timer1Timer(TObject *Sender)
- {
- int i ;
- randomize();
- i=rand()%2;
- if(i==0)
- i=-1;
- else
- i=1;
- Image1->Top=i*(rand()%this->Height);
- Image1->Left=i*(rand()%this->Width);
- }
- //---------------------------------------------------------------------------
- void __fastcall TFormView::FormCreate(TObject *Sender)
- {
- AnsiString picdir="no";
- int frequence=3;
- TRegistry *Registry = new TRegistry;
- try
- {
- Registry->RootKey =HKEY_CURRENT_USER;
- if(Registry->KeyExists("\Software\CODEHUNTER")==false){
- Registry->OpenKey("\Software\CODEHUNTER",true);
- Registry->WriteString("PicDir",picdir);
- Registry->WriteInteger("frequence",frequence);
- Registry->CloseKey();
- }
- }
- __finally
- {
- delete Registry;
- }
- }
- //---------------------------------------------------------------------------