寄謹方BCB殻會埀匆俯匯渦徨脅音喘購伉Toolsapi?徽泌惚?厘匯劔涙祖議三?
音形螺螺才網胎匯和?
心心和中議殻會?栖委IDE延倖劔?
--->BCB5。0
//--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop USERES("nodebug.res"); USEPACKAGE("vcl50.bpi"); //--------------------------------------------------------------------------- #include <toolsapi.hpp> #include <inifiles.hpp> //--------------------------------------------------------------------------- #pragma package(smart_init) //--------------------------------------------------------------------------- // Package source. //--------------------------------------------------------------------------- namespace Nodebug // Here the namespace should be same with this file name. { bool NeedLocalize = true; bool NeedWriteToIni = false; TIniFile *ini, *chsini; AnsiString Section, Ident, Value; //===[ Do something on MenuItems. ]====================================== void __fastcall DoMenuItem(TMenuItem* MenuItem) { //Display all MenuItems. if(MenuItem->Visible==false) MenuItem->Visible = true; if ( NeedWriteToIni && !MenuItem->Name.IsEmpty()) { Ident = MenuItem->Name; Value = MenuItem->Caption; ini->WriteString ( Section, Ident, Value ); } } //===[ Do something on MenuItems. ]====================================== //===[ Enumerate all MenuItem''s SubItems. ]============================== void __fastcall EnumerateMenuItem(TMenuItem* MenuItem) { DoMenuItem(MenuItem); for ( int i=0; i<MenuItem->Count; i++ ) { EnumerateMenuItem(MenuItem->Items[i]); } } //===[ Enumerate all MenuItem''s SubItems. ]============================== void __fastcall LocalizeAppMenu() { _di_INTAServices IDE; HRESULT hr = BorlandIDEServices->QueryInterface(__uuidof(INTAServices), (void **) &IDE); if (SUCCEEDED(hr)) { //----------[AppBuilder macro start]-------------------------------------- #ifndef AppBuilder #define AppBuilder IDE->MainMenu->Owner #endif //----------[AppBuilder macro end ]-------------------------------------- TStringList* SectionList = new TStringList; TStringList* IdentList = new TStringList; AnsiString Value , Default("NULL"); try { chsini->ReadSections(SectionList); for (int i = 0; i < SectionList->Count; i++) { chsini->ReadSection( SectionList->Strings[i], IdentList); for (int x = 0; x < IdentList->Count; x++) { Value = chsini->ReadString( SectionList->Strings[i], IdentLis
|