//--------------------------------------------------------------------------- #include #include #pragma hdrstop #include "test.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TtestF *testF; //--------------------------------------------------------------------------- __fastcall TtestF::TtestF(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TtestF::FormShow(TObject *Sender) { HMODULE hDll=0; PFN_CTYPT_ENUM_PROVIDERS_U pfnCryptEnumProvidersU=NULL; DWORD indexProv=0; char szName[100]; DWORD dwProvType,cbName; WCHAR provName[100]; hDll=LoadLibrary("Crypt32.dll"); pfnCryptEnumProvidersU=(PFN_CTYPT_ENUM_PROVIDERS_U)GetProcAddress(hDll,"CryptEnumProvidersU"); ComboBox1->Clear(); while(pfnCryptEnumProvidersU(indexProv, NULL, 0,&dwProvType, NULL, &cbName)) { if(pfnCryptEnumProvidersU(indexProv++, NULL, 0,&dwProvType, provName, &cbName)) { ComboBox1->Items->Add(provName); } } } //--------------------------------------------------------------------------- void __fastcall TtestF::ComboBox1Click(TObject *Sender) { DWORD dwProvType,cbName; HMODULE hDll=0; WCHAR provName[100]; hDll=LoadLibrary("Crypt32.dll"); HCRYPTPROV hProv=NULL; PFN_CTYPT_ENUM_PROVIDERS_U pfnCryptEnumProvidersU=NULL; pfnCryptEnumProvidersU=(PFN_CTYPT_ENUM_PROVIDERS_U)GetProcAddress(hDll,"CryptEnumProvidersU"); pfnCryptEnumProvidersU(ComboBox1->Items->IndexOf(ComboBox1->Text), NULL, 0,&dwProvType, provName, &cbName); Label1->Caption=dwProvType; } //---------------------------------------------------------------------------