<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Problem mit OnCreate und Form1-&amp;gt;Visible = false]]></title><description><![CDATA[<p>Ich möchte mein Programm wenn es mit bestimmten Parametern gestartet wird nicht sichtbar machen. Es soll dann über ein TryIcon wieder sichtbar gemacht werden können.</p>
<pre><code>void __fastcall TForm1::FormCreate(TObject *Sender)
{
  if(ParamCount()==1 &amp;&amp; ParamStr(1)== &quot;-a&quot;){    
    Form1-&gt;Visible = false;
  }
}
</code></pre>
<p>Wieso funzt das denn nicht? Wenn ich dies über einen Button mache kann ich das Fenster ausblenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/101343/problem-mit-oncreate-und-form1-gt-visible-false</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Jul 2026 14:44:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/101343.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 15 Feb 2005 13:02:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit OnCreate und Form1-&amp;gt;Visible = false on Tue, 15 Feb 2005 13:02:11 GMT]]></title><description><![CDATA[<p>Ich möchte mein Programm wenn es mit bestimmten Parametern gestartet wird nicht sichtbar machen. Es soll dann über ein TryIcon wieder sichtbar gemacht werden können.</p>
<pre><code>void __fastcall TForm1::FormCreate(TObject *Sender)
{
  if(ParamCount()==1 &amp;&amp; ParamStr(1)== &quot;-a&quot;){    
    Form1-&gt;Visible = false;
  }
}
</code></pre>
<p>Wieso funzt das denn nicht? Wenn ich dies über einen Button mache kann ich das Fenster ausblenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/723914</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/723914</guid><dc:creator><![CDATA[Tommy123456]]></dc:creator><pubDate>Tue, 15 Feb 2005 13:02:11 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit OnCreate und Form1-&amp;gt;Visible = false on Tue, 15 Feb 2005 13:13:50 GMT]]></title><description><![CDATA[<p>Das ist wahrscheinlich einfach die falsche Stelle für das, was Du machen willst.<br />
Lies Dir mal den <a href="http://web.archive.org/web/20040204034528/http://www.bcbdev.com/articles/suggest.htm#oncreate" rel="nofollow">Artikel zu OnCreate im C++ Builder</a> durch.</p>
<p>Vielleicht kannst Du das Problem ja auch anders lösen. Ein Überschreiben von Loaded() könnte Dir<br />
eventuell weiterhelfen.</p>
<p>Gruß,</p>
<p>Alexander</p>
]]></description><link>https://www.c-plusplus.net/forum/post/723922</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/723922</guid><dc:creator><![CDATA[Alexander Kempf]]></dc:creator><pubDate>Tue, 15 Feb 2005 13:13:50 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit OnCreate und Form1-&amp;gt;Visible = false on Tue, 15 Feb 2005 14:22:24 GMT]]></title><description><![CDATA[<pre><code>void __fastcall TForm1::FormCreate(TObject *Sender)
{
  if(ParamCount()==1 &amp;&amp; ParamStr(1)== &quot;-a&quot;){    
    Form1-&gt;Hide();
  }
}
</code></pre>
<p>probiers mal so</p>
]]></description><link>https://www.c-plusplus.net/forum/post/723980</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/723980</guid><dc:creator><![CDATA[tuxman]]></dc:creator><pubDate>Tue, 15 Feb 2005 14:22:24 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit OnCreate und Form1-&amp;gt;Visible = false on Tue, 15 Feb 2005 15:28:09 GMT]]></title><description><![CDATA[<p>Das hab ich schon probiert funzt aber nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/724071</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/724071</guid><dc:creator><![CDATA[Tommy123456]]></dc:creator><pubDate>Tue, 15 Feb 2005 15:28:09 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit OnCreate und Form1-&amp;gt;Visible = false on Tue, 15 Feb 2005 16:08:21 GMT]]></title><description><![CDATA[<p>Mach das doch mal in WinMain !!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/724142</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/724142</guid><dc:creator><![CDATA[DerAltenburger]]></dc:creator><pubDate>Tue, 15 Feb 2005 16:08:21 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit OnCreate und Form1-&amp;gt;Visible = false on Wed, 16 Feb 2005 07:26:08 GMT]]></title><description><![CDATA[<p>Also ich hab es mit den Konstruktor und mit der WinMain probiert funzt aber immer noch nicht oder bin ich zu blöd dazu?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/724569</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/724569</guid><dc:creator><![CDATA[Tommy123456]]></dc:creator><pubDate>Wed, 16 Feb 2005 07:26:08 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit OnCreate und Form1-&amp;gt;Visible = false on Wed, 16 Feb 2005 08:58:58 GMT]]></title><description><![CDATA[<p>Und hast Du auch mal das Überschreiben von Loaded() ausprobiert?<br />
Zumindest der Konstruktor wird wohl vor Loaded aufgerufen und Loaded wird erst aufgerufen,<br />
wenn alle Eigenschaften aus der .dfm-Datei geladen sind.</p>
<p>Beispiel für Loaded:</p>
<pre><code class="language-cpp">// Header
virtual void __fastcall Loaded(void);

// Implementierung
void __fastcall TForm1::Loaded(void)
{
   TComponent::Loaded();

   if(ParamCount()==1 &amp;&amp; ParamStr(1)== &quot;-a&quot;){    
    Visible = false;
  }
}
</code></pre>
<p>Gruß,</p>
<p>Alexander</p>
]]></description><link>https://www.c-plusplus.net/forum/post/724611</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/724611</guid><dc:creator><![CDATA[Alexander Kempf]]></dc:creator><pubDate>Wed, 16 Feb 2005 08:58:58 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit OnCreate und Form1-&amp;gt;Visible = false on Wed, 16 Feb 2005 12:56:25 GMT]]></title><description><![CDATA[<p>Danke für die Hilfe hab auch dies ausprobiert es funktioniert einfach nicht. Wenn ich das in OnShow schreibe kommt eine Fehlermedlung. Ich bin irgendwie mit meinem Latein am Ende.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/724777</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/724777</guid><dc:creator><![CDATA[Tommy123456]]></dc:creator><pubDate>Wed, 16 Feb 2005 12:56:25 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit OnCreate und Form1-&amp;gt;Visible = false on Wed, 16 Feb 2005 13:23:20 GMT]]></title><description><![CDATA[<p>In OnShow sollte ds nun wirklich nicht!!!</p>
<p>:: In dem Moment, wo die Form angezeigt wird, willst Du unsichtbar machen - das kanner nich.</p>
<p>Aber in WinMain muss das gehen. Nach CreateForm.</p>
<p>Visible der Form sollte auch auf false stehen - Im Objectinspector!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/724796</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/724796</guid><dc:creator><![CDATA[DerAltenburger]]></dc:creator><pubDate>Wed, 16 Feb 2005 13:23:20 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit OnCreate und Form1-&amp;gt;Visible = false on Wed, 16 Feb 2005 13:32:11 GMT]]></title><description><![CDATA[<p>DerAltenburger schrieb:</p>
<blockquote>
<p>Aber in WinMain muss das gehen. Nach CreateForm.</p>
<p>Visible der Form sollte auch auf false stehen - Im Objectinspector!</p>
</blockquote>
<p>Ich habe genau das eben auch mal ausprobiert und es geht wirklich nicht.<br />
Irgendwo im Application-&gt;Run() wird wohl ein MainForm-&gt;Show() oder etwas in der Art aufgerufen.</p>
<p>Gruß,</p>
<p>Alexander</p>
]]></description><link>https://www.c-plusplus.net/forum/post/724808</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/724808</guid><dc:creator><![CDATA[Alexander Kempf]]></dc:creator><pubDate>Wed, 16 Feb 2005 13:32:11 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit OnCreate und Form1-&amp;gt;Visible = false on Wed, 16 Feb 2005 13:39:00 GMT]]></title><description><![CDATA[<p>Ich habe gerade noch mal in der BCB-Hilfe nachgeschaut.<br />
Unter TApplication::ShowMainForm steht:</p>
<p>BCB-Hilfe schrieb:</p>
<blockquote>
<p>Um das Hauptformular beim Start der Anwendung auszublenden, setzen Sie ShowMainForm vor dem Aufruf von Application-&gt;Run in der Haupt-Projektdatei auf false und stellen sicher, daß die Eigenschaft Visible des Formulars auf false steht.</p>
</blockquote>
<p>Gruß,</p>
<p>Alexander</p>
]]></description><link>https://www.c-plusplus.net/forum/post/724815</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/724815</guid><dc:creator><![CDATA[Alexander Kempf]]></dc:creator><pubDate>Wed, 16 Feb 2005 13:39:00 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit OnCreate und Form1-&amp;gt;Visible = false on Wed, 16 Feb 2005 14:01:36 GMT]]></title><description><![CDATA[<p>Bei mir geht das so:</p>
<p>Form1-&gt;Visible im OI auf True !!!<br />
In Form1 ist ein Timer 2sec</p>
<pre><code class="language-cpp">/*Project1.cpp
  Anfang*/
#include &quot;unit1.h&quot;
USERES(&quot;Project1.res&quot;);
USEFORM(&quot;Unit1.cpp&quot;, Form1);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{ try
  {  Application-&gt;Initialize();
     Application-&gt;CreateForm(__classid(TForm1), &amp;Form1);

     //Form ausblenden!!!
     ShowWindow(Form1-&gt;Handle,SW_HIDE);
     //Programm aus Taskleiste!!!
     ShowWindow(Application-&gt;Handle,SW_HIDE);
     //Programm starten
     Application-&gt;Run();
  }
  catch (Exception &amp;exception)
  { Application-&gt;ShowException(&amp;exception);
  }
  return 0;
}
//---------------------------------------------------------------------------
/*Project1.cpp
  Ende*/

*****************************************************************************
*****************************************************************************

/*Unit1.h
  Anfang*/
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include &lt;Classes.hpp&gt;
#include &lt;Controls.hpp&gt;
#include &lt;StdCtrls.hpp&gt;
#include &lt;Forms.hpp&gt;
#include &lt;ExtCtrls.hpp&gt;
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:	// Von der IDE verwaltete Komponenten
  TTimer *Timer1;
  void __fastcall Timer1Timer(TObject *Sender);
private:	// Anwenderdeklarationen
public:		// Anwenderdeklarationen
  __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
/*Unit1.h
  Ende*/

*****************************************************************************
*****************************************************************************

/*Unit1.cpp
  Anfang*/
//---------------------------------------------------------------------------
#include &lt;vcl.h&gt;
#pragma hdrstop
#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{ ShowWindow(Form1-&gt;Handle,SW_SHOW);
}
//---------------------------------------------------------------------------
/*Unit1.cpp
  Ende*/
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/724840</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/724840</guid><dc:creator><![CDATA[DerAltenburger]]></dc:creator><pubDate>Wed, 16 Feb 2005 14:01:36 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit OnCreate und Form1-&amp;gt;Visible = false on Wed, 16 Feb 2005 14:14:29 GMT]]></title><description><![CDATA[<p>Bei mir geht das so:</p>
<p>Form1-&gt;Visible im OI auf <strong>false</strong> !!<br />
In Form1 ist <strong>k</strong>ein Timer 2sec</p>
<pre><code class="language-cpp">/*Project1.cpp
  Anfang*/
#include &quot;unit1.h&quot;
USERES(&quot;Project1.res&quot;);
USEFORM(&quot;Unit1.cpp&quot;, Form1);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{ try
  {  Application-&gt;Initialize();
     Application-&gt;CreateForm(__classid(TForm1), &amp;Form1);

     // Wie in BCB-Hilfe beschrieben...
     Application-&gt;ShowMainForm = false;
     Application-&gt;Run();
  }
  catch (Exception &amp;exception)
  { Application-&gt;ShowException(&amp;exception);
  }
  return 0;
}
</code></pre>
<p>Aber man kann natürlich auch einen Timer verwenden - oder besser gleich zwei (einen zur Sicherheit) <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
anstatt einfach die eine Zeile hinzuzufügen.</p>
<p>Gruß,</p>
<p>Alexander</p>
]]></description><link>https://www.c-plusplus.net/forum/post/724854</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/724854</guid><dc:creator><![CDATA[Alexander Kempf]]></dc:creator><pubDate>Wed, 16 Feb 2005 14:14:29 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit OnCreate und Form1-&amp;gt;Visible = false on Thu, 17 Feb 2005 07:27:58 GMT]]></title><description><![CDATA[<p>Danke Danke Danke es funktioniert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/725380</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/725380</guid><dc:creator><![CDATA[Tommy123456]]></dc:creator><pubDate>Thu, 17 Feb 2005 07:27:58 GMT</pubDate></item></channel></rss>