<?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[[x] Schaltfläche]]></title><description><![CDATA[<p>hallo,<br />
<div class="plugin-markdown"><input type="checkbox" id="checkbox34242" checked="true" /><label for="checkbox34242">Schaltfläche (im Systenmenu oben rechts) was anderes erzwingen z.B. Programm minimieren statt Programm beenden?</label></div><br />
danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/149342/x-schaltfläche</link><generator>RSS for Node</generator><lastBuildDate>Thu, 06 Aug 2026 20:49:59 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/149342.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Jun 2006 10:41:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [x] Schaltfläche on Mon, 05 Jun 2006 10:41:20 GMT]]></title><description><![CDATA[<p>hallo,<br />
<div class="plugin-markdown"><input type="checkbox" id="checkbox34242" checked="true" /><label for="checkbox34242">Schaltfläche (im Systenmenu oben rechts) was anderes erzwingen z.B. Programm minimieren statt Programm beenden?</label></div><br />
danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071526</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071526</guid><dc:creator><![CDATA[C++_Hoby]]></dc:creator><pubDate>Mon, 05 Jun 2006 10:41:20 GMT</pubDate></item><item><title><![CDATA[Reply to [x] Schaltfläche on Mon, 05 Jun 2006 10:47:21 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Dann must du den Event <em>TForm::OnCloseQuery</em> verwenden, um einerseits das automatische Schließen zu verhindern und andereseits deine eigene Aktion auszuführen.<br />
Allerdings must du darauf achten in dem Event auch irgendwann das Form und damit die Anwendung wirklich schließen lassen zu können.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071529</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071529</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 05 Jun 2006 10:47:21 GMT</pubDate></item><item><title><![CDATA[Reply to [x] Schaltfläche on Mon, 05 Jun 2006 11:02:07 GMT]]></title><description><![CDATA[<p>danke es hat geklappt:</p>
<pre><code>bool bgDontClose = false;//Globale Varialbe
//------
void __fastcall TAppForm::Exit1Click(TObject *Sender)
{
 //hier wird das Programm beendet
 bgDontClose = true;
 Close();
}
//-------
void __fastcall TAppForm::FormCloseQuery(TObject *Sender,
      bool &amp;CanClose)
{
  //hier wir das Programm minimiert über die [x] Schaltfläche, BorderStyle ist bsSizeToolWin
  CanClose = bgDontClose;
  WindowState = wsMinimized;
  TrayIcon1-&gt;Hide = true;
  TrayIcon1-&gt;Minimize();
  TrayIcon1-&gt;Update();
}
//--------------------
</code></pre>
<p>danke schön und frohe Pfingsten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071538</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071538</guid><dc:creator><![CDATA[C++_Hoby]]></dc:creator><pubDate>Mon, 05 Jun 2006 11:02:07 GMT</pubDate></item><item><title><![CDATA[Reply to [x] Schaltfläche on Mon, 05 Jun 2006 11:13:50 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>statt der globalen Variable solltest du diese lieber als Member des Forms deklarieren.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071548</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071548</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 05 Jun 2006 11:13:50 GMT</pubDate></item><item><title><![CDATA[Reply to [x] Schaltfläche on Mon, 05 Jun 2006 12:13:20 GMT]]></title><description><![CDATA[<p>meinst du in den Header:</p>
<pre><code>private:	// User declarations
bool bgDontClose;
</code></pre>
<p>der pc lässt sich nicht runterfahren wenn das Programm active im systemtray ist. hast du ne Idee warum?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071576</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071576</guid><dc:creator><![CDATA[C++_Hoby]]></dc:creator><pubDate>Mon, 05 Jun 2006 12:13:20 GMT</pubDate></item><item><title><![CDATA[Reply to [x] Schaltfläche on Mon, 05 Jun 2006 12:20:21 GMT]]></title><description><![CDATA[<p>Hallo</p>
<blockquote>
<p>meinst du in den Header:</p>
</blockquote>
<p>Ja</p>
<blockquote>
<p>der pc lässt sich nicht runterfahren wenn das Programm active im systemtray ist. hast du ne Idee warum?</p>
</blockquote>
<p>Ist ja auch klar, weil auch Windows beim Beenden versucht alle Programme zu schließen. Dein Programm verweigert das und Windows bricht das herunterfahren ab.</p>
<p>/Edit : Als einfachte Lösung sehe ich, den [x]-Button zum Schließen im Form ganz zu entfernen, und somit auch kein OnCloseQuery zu benötigen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071580</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071580</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 05 Jun 2006 12:20:21 GMT</pubDate></item><item><title><![CDATA[Reply to [x] Schaltfläche on Mon, 05 Jun 2006 12:20:17 GMT]]></title><description><![CDATA[<blockquote>
<p>der pc lässt sich nicht runterfahren wenn das Programm active im systemtray ist. hast du ne Idee warum?</p>
</blockquote>
<p>dies hat sich erledigt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071582</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071582</guid><dc:creator><![CDATA[C++_Hoby]]></dc:creator><pubDate>Mon, 05 Jun 2006 12:20:17 GMT</pubDate></item><item><title><![CDATA[Reply to [x] Schaltfläche on Mon, 05 Jun 2006 12:30:55 GMT]]></title><description><![CDATA[<p>aber warum soll die bool Variable in den Header geschrieben werden?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071586</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071586</guid><dc:creator><![CDATA[C++_Hoby]]></dc:creator><pubDate>Mon, 05 Jun 2006 12:30:55 GMT</pubDate></item><item><title><![CDATA[Reply to [x] Schaltfläche on Mon, 05 Jun 2006 12:43:48 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Die Frage würde sich mit Grundkenntnissen erübrigen.<br />
Um es kurz zu machen : eine globale Variable ist genau einmal vorhanden. Eine Membervariable ist genau für jede Instanz der Klasse vorhanden.<br />
Da auch von Form-Klassen zur Laufzeit mehrere dynamische Instanzen erzeugt werden könnten, würden bei globalen Variablen mehrere Forms auf die selbe Variable zugreifen, was in deinem Kontext schlecht wäre.</p>
<p>Dieses Problem mag in deinem Ablauf noch nicht akut werden, aber besser du gewöhnst dir gleich an, keine globalen Variablen zu benutzen, es sei denn du weißt genau was du tust und das du diese brauchst.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071593</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071593</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 05 Jun 2006 12:43:48 GMT</pubDate></item><item><title><![CDATA[Reply to [x] Schaltfläche on Mon, 05 Jun 2006 13:19:17 GMT]]></title><description><![CDATA[<p>danke für dein Antwort,<br />
zu dem Herunterfahren des Rechners habe ich was zusammen gebastelt, und es funktioniert ohne Ärger.<br />
Header:</p>
<pre><code>protected:
  BEGIN_MESSAGE_MAP
     VCL_MESSAGE_HANDLER(WM_QUERYENDSESSION, TMessage, OnShutdown)
  END_MESSAGE_MAP(TForm)
  void __fastcall OnShutdown(TMessage &amp; Msg);
</code></pre>
<p>Cpp:</p>
<pre><code>void __fastcall TAppForm::OnShutdown(TMessage &amp;Msg)
{
 bgDontClose = true;
 TObject:: Dispatch(&amp;Msg);
 Close();
}
</code></pre>
<p>das Programm fängt den Runterfahren von Windows ab und zwingt sich selbt zu schliessen, dann läuft das Windows Runterfahren ohne Problem.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071622</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071622</guid><dc:creator><![CDATA[C++_Hoby]]></dc:creator><pubDate>Mon, 05 Jun 2006 13:19:17 GMT</pubDate></item><item><title><![CDATA[Reply to [x] Schaltfläche on Mon, 05 Jun 2006 14:51:47 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>ja das ist in Ordnung.</p>
<p>Allerdings finde ich die Namensgebung der Variable <em>bgDontClose</em> nicht gelungen. Du setzt bgDontClose auf wahr, wenn das Fenster geschlossen werden kann... die Variable sollte besser bgCanClose heißen, um Verwechlung mit der Wertebelegung auszuschließen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071683</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071683</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 05 Jun 2006 14:51:47 GMT</pubDate></item></channel></rss>