void __fastcall TfrmMain::FormActivate(TObject *Sender) { if (firstTime) { this->WindowState = wsMaximized; RegIns(".ats", "atsfile"); RegIns("atsfile", "Aardbei Texture Studio 1"); RegIns("atsfile\\shell", ""); RegIns("atsfile\\shell\\open", ""); char tmp[128]; wsprintf(tmp, "%s \"%%1\"", Application->ExeName); RegIns("atsfile\\shell\\open\\command", tmp); wsprintf(tmp, "%s,0", Application->ExeName); RegIns("atsfile\\DefaultIcon", tmp); mnuMain->Items->Items[menuIndexGenerate]->Visible = false; mnuMain->Items->Items[menuIndexDistort]->Visible = false; mnuMain->Items->Items[menuIndexLayer]->Visible = false; mnuMain->Items->Items[menuIndexColor]->Visible = false; mnuMain->Items->Items[menuIndexBlur]->Visible = false; Undo1->Enabled = false; Export1->Enabled = false; mnuMain->Items->Items[menuIndexFile]->Items[menuIndexClose]->Visible = false; mnuMain->Items->Items[menuIndexFile]->Items[menuIndexSave]->Visible = false; mnuMain->Items->Items[menuIndexFile]->Items[menuIndexSaveAs]->Visible = false; Repaint(); // if paramcount is 1, load the file if (ParamCount() == 1) { _sleep(1); openedByClicking = true; textureFilename = new char[ParamStr(1).Length() + 1]; strcpy(textureFilename, ParamStr(1).c_str()); // textureFilename = ParamStr(1).c_str(); Open1Click(Sender); } firstTime = false; } }
void __fastcall TForm1::SpeedButton1Click(TObject *Sender) { Open1Click(Sender); }