<?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[InstallDate auslesen]]></title><description><![CDATA[<pre><code class="language-cpp">#include  &lt;iostream&gt; 
#include  &lt;string&gt; 
#include  &lt;windows.h&gt; 

using namespace std; 

#define cls system(&quot;cls&quot;) 
#define wait  system  (&quot;pause&gt;nul&quot;) 
void  color(string  pColor) 
{ 
  string  cmdstr  = &quot;color &quot;  + pColor; 
  system(cmdstr.c_str()); 
} 

typedef unsigned  long  ulong; 
typedef unsigned  char  uchar; 

bool  RegReadValueString(  string &amp;value_data, const HKEY  &amp;hkey,  const char* value) 
{ 
  ulong val_type; 

  //  Typ des Wertes prüfen 
  RegQueryValueEx(  hkey, //  Schlüssel -ein 
                    value,  //  Wert  -ein 
                    0,  //  immer NULL  -ein 
                    &amp;val_type, //  Typ des Wertes -aus 
                    0,  //  Puffer für Daten des Wertes -ein 
                    0 //  Größe des Puffers -aus 
                 ); 

  if( val_type  !=  REG_SZ  ) 
    return  false;  //  falls Werte-Typ !=  String 

  //  Daten lesen 
  ulong result; 
  ulong size  = 1;  //  Größe des Daten-Puffers 
  uchar *data = new uchar[1]; //  Daten-Puffer  ( Platz für 1 Zeichen =&gt; \0 ) 

  if( result  = RegQueryValueEx(  hkey, value,  0,  0,  data, &amp;size  ) ) 
  { 
    delete  []  data; 

    if( result  !=  ERROR_MORE_DATA ) 
      return  false;  //  Falls Daten = &quot;\0&quot; 

    try 
    { 
      data  = new uchar[size];  //  Puffer  auf die richtige Größe bringen 
    } 
    catch(  bad_alloc ) 
    { 
      return  false;  //  falls Vergrößern des Puffers fehlschlägt 
    } 

    if( RegQueryValueEx(  hkey, value,  0,  0,  data, &amp;size ) ) 
      return  false;  //  falls weitere Fehler auftreten 
  } 
  value_data  = (char*) data;  //  Daten in C-String-Parameter schreiben 
  delete  []  data; //  Daten-Array leeren 
  return  true; //  bei Erfolg 

} //  RegDataToStr 

int main() 
{ 
  HKEY  hkey; 
  string  status, name, domain, password;

  //  Schlüssel öffnen 
  if( RegOpenKeyEx( HKEY_LOCAL_MACHINE, //  Host-Key 
                    &quot;SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion&quot;, 
                      //  Unerschlüssel 
                    0,  //  immer NULL 
                    KEY_READ, //  Zugriffsberechtigungen zum öffnen 
                    &amp;hkey //  HKEY-Handle 
                  ) 
    ) 
  { 
    cls; 
    color(&quot;c&quot;); 
    cout  &lt;&lt;  &quot;Fehler: HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\&quot; 
          &lt;&lt;  &quot;CurrentVersion\\Winlogon konnte nicht geoeffnet werden.\n&quot; 
          &lt;&lt;  &quot;beliebige Taste zum Beenden ...\n&quot;; 
    wait; 
    exit(-1); 
  } 

  //  Daten lesen 

  //  Namen lesen 
  if( !RegReadValueString( name, hkey, &quot;InstallDate&quot; )  ) 
  { 
    cls; 
    color(&quot;c&quot;); 
    cout  &lt;&lt;  &quot;Fehler: InstallDate konnte nicht gelesen werden.\n&quot;; 
    wait; 
    exit(-1); 
  } 

  //  Hauptmenü ausgeben 
  hm: 

  int choice; 

  cls; 
  cout   
        &lt;&lt;  &quot;\t\tBenutzername:            &quot; &lt;&lt;  name  &lt;&lt;  endl ;

        system(&quot;PAUSE&quot;);
  return  0; 
}
</code></pre>
<p>Wieso kann ich mit folgenden Code nicht das Installdate auslesen? jedoch alle anderen parts von diesem Unterschlüssel???</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/192093/installdate-auslesen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 01 Jul 2026 00:31:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/192093.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 10 Sep 2007 13:39:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to InstallDate auslesen on Mon, 10 Sep 2007 13:39:48 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include  &lt;iostream&gt; 
#include  &lt;string&gt; 
#include  &lt;windows.h&gt; 

using namespace std; 

#define cls system(&quot;cls&quot;) 
#define wait  system  (&quot;pause&gt;nul&quot;) 
void  color(string  pColor) 
{ 
  string  cmdstr  = &quot;color &quot;  + pColor; 
  system(cmdstr.c_str()); 
} 

typedef unsigned  long  ulong; 
typedef unsigned  char  uchar; 

bool  RegReadValueString(  string &amp;value_data, const HKEY  &amp;hkey,  const char* value) 
{ 
  ulong val_type; 

  //  Typ des Wertes prüfen 
  RegQueryValueEx(  hkey, //  Schlüssel -ein 
                    value,  //  Wert  -ein 
                    0,  //  immer NULL  -ein 
                    &amp;val_type, //  Typ des Wertes -aus 
                    0,  //  Puffer für Daten des Wertes -ein 
                    0 //  Größe des Puffers -aus 
                 ); 

  if( val_type  !=  REG_SZ  ) 
    return  false;  //  falls Werte-Typ !=  String 

  //  Daten lesen 
  ulong result; 
  ulong size  = 1;  //  Größe des Daten-Puffers 
  uchar *data = new uchar[1]; //  Daten-Puffer  ( Platz für 1 Zeichen =&gt; \0 ) 

  if( result  = RegQueryValueEx(  hkey, value,  0,  0,  data, &amp;size  ) ) 
  { 
    delete  []  data; 

    if( result  !=  ERROR_MORE_DATA ) 
      return  false;  //  Falls Daten = &quot;\0&quot; 

    try 
    { 
      data  = new uchar[size];  //  Puffer  auf die richtige Größe bringen 
    } 
    catch(  bad_alloc ) 
    { 
      return  false;  //  falls Vergrößern des Puffers fehlschlägt 
    } 

    if( RegQueryValueEx(  hkey, value,  0,  0,  data, &amp;size ) ) 
      return  false;  //  falls weitere Fehler auftreten 
  } 
  value_data  = (char*) data;  //  Daten in C-String-Parameter schreiben 
  delete  []  data; //  Daten-Array leeren 
  return  true; //  bei Erfolg 

} //  RegDataToStr 

int main() 
{ 
  HKEY  hkey; 
  string  status, name, domain, password;

  //  Schlüssel öffnen 
  if( RegOpenKeyEx( HKEY_LOCAL_MACHINE, //  Host-Key 
                    &quot;SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion&quot;, 
                      //  Unerschlüssel 
                    0,  //  immer NULL 
                    KEY_READ, //  Zugriffsberechtigungen zum öffnen 
                    &amp;hkey //  HKEY-Handle 
                  ) 
    ) 
  { 
    cls; 
    color(&quot;c&quot;); 
    cout  &lt;&lt;  &quot;Fehler: HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\&quot; 
          &lt;&lt;  &quot;CurrentVersion\\Winlogon konnte nicht geoeffnet werden.\n&quot; 
          &lt;&lt;  &quot;beliebige Taste zum Beenden ...\n&quot;; 
    wait; 
    exit(-1); 
  } 

  //  Daten lesen 

  //  Namen lesen 
  if( !RegReadValueString( name, hkey, &quot;InstallDate&quot; )  ) 
  { 
    cls; 
    color(&quot;c&quot;); 
    cout  &lt;&lt;  &quot;Fehler: InstallDate konnte nicht gelesen werden.\n&quot;; 
    wait; 
    exit(-1); 
  } 

  //  Hauptmenü ausgeben 
  hm: 

  int choice; 

  cls; 
  cout   
        &lt;&lt;  &quot;\t\tBenutzername:            &quot; &lt;&lt;  name  &lt;&lt;  endl ;

        system(&quot;PAUSE&quot;);
  return  0; 
}
</code></pre>
<p>Wieso kann ich mit folgenden Code nicht das Installdate auslesen? jedoch alle anderen parts von diesem Unterschlüssel???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1362603</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1362603</guid><dc:creator><![CDATA[toxical]]></dc:creator><pubDate>Mon, 10 Sep 2007 13:39:48 GMT</pubDate></item><item><title><![CDATA[Reply to InstallDate auslesen on Mon, 10 Sep 2007 20:59:49 GMT]]></title><description><![CDATA[<p>toxical schrieb:</p>
<blockquote>
<p>Wieso kann ich mit folgenden Code nicht das Installdate auslesen?</p>
</blockquote>
<p>Zeile 31 : &quot;InstallDate&quot; ist ein REG_DWORD und kein REG_SZ.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1362878</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1362878</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 10 Sep 2007 20:59:49 GMT</pubDate></item><item><title><![CDATA[Reply to InstallDate auslesen on Tue, 11 Sep 2007 06:53:41 GMT]]></title><description><![CDATA[<p>weisst du /jemand auf die schnelle n vorschlag wie ich aus dem unterschlüssel das installdate in bin/hex auslesen kann???</p>
<p>oder wo man nachsehen kann?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1362990</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1362990</guid><dc:creator><![CDATA[toxical]]></dc:creator><pubDate>Tue, 11 Sep 2007 06:53:41 GMT</pubDate></item><item><title><![CDATA[Reply to InstallDate auslesen on Tue, 11 Sep 2007 08:33:28 GMT]]></title><description><![CDATA[<p>Indem Du eben berücksichtigst das RegQueryValueEx eben ein DWORD liefert. Und nicht nur REG_SZ!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1363059</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1363059</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 11 Sep 2007 08:33:28 GMT</pubDate></item><item><title><![CDATA[Reply to InstallDate auslesen on Wed, 12 Sep 2007 07:45:54 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;windows.h&gt; 
#include &lt;stdio.h&gt; 

int main(int argc, char *argv[]) 
{ 
 HKEY hkey; 

 char szBuffer[255]; 
 char KeyValue[255]; 

 unsigned long lBufferSize = 255; 

 RegOpenKeyEx(HKEY_LOCAL_MACHINE, &quot;Software\\Microsoft\\Windows NT\\CurrentVersion&quot;, 0, KEY_READ, &amp;hkey) ; 
 RegQueryValueEx(hkey, &quot;InstallDate&quot;, NULL, NULL, KeyValue, &amp;lBufferSize) ; 
 RegCloseKey(hkey) ; 

 printf(&quot;Wert des Schluessels: %s&quot;,KeyValue, &quot;\n\nPress any key...&quot;) ; 
 getchar() ; 

  return 0;
}
</code></pre>
<p>ich hab das ganze jetzt vereinfacht... nur wenn ich das installdate auslesen will schreibt er irgendwelche zeichen... irgendwas kapier i net oder mach i falsch alles andere liest er....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1363802</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1363802</guid><dc:creator><![CDATA[toxical]]></dc:creator><pubDate>Wed, 12 Sep 2007 07:45:54 GMT</pubDate></item><item><title><![CDATA[Reply to InstallDate auslesen on Wed, 12 Sep 2007 08:14:27 GMT]]></title><description><![CDATA[<p>Mach bitte aus KeyValue ein DWORD!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1363813</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1363813</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 12 Sep 2007 08:14:27 GMT</pubDate></item><item><title><![CDATA[Reply to InstallDate auslesen on Wed, 12 Sep 2007 08:32:58 GMT]]></title><description><![CDATA[<p>lol</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1363832</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1363832</guid><dc:creator><![CDATA[tenchou]]></dc:creator><pubDate>Wed, 12 Sep 2007 08:32:58 GMT</pubDate></item><item><title><![CDATA[Reply to InstallDate auslesen on Thu, 13 Sep 2007 08:00:08 GMT]]></title><description><![CDATA[<p>Martin Richter schrieb:</p>
<blockquote>
<p>Mach bitte aus KeyValue ein DWORD!</p>
</blockquote>
<p>jep genau, mein problem ist das ich nicht weiss wie <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1364450</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1364450</guid><dc:creator><![CDATA[toxical]]></dc:creator><pubDate>Thu, 13 Sep 2007 08:00:08 GMT</pubDate></item><item><title><![CDATA[Reply to InstallDate auslesen on Thu, 13 Sep 2007 08:33:29 GMT]]></title><description><![CDATA[<p>toxical schrieb:</p>
<blockquote>
<p>Martin Richter schrieb:</p>
<blockquote>
<p>Mach bitte aus KeyValue ein DWORD!</p>
</blockquote>
<p>jep genau, mein problem ist das ich nicht weiss wie <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
</blockquote>
<pre><code class="language-cpp">#include &lt;windows.h&gt; 
#include &lt;stdio.h&gt; 

int main(int argc, char *argv[]) 
{ 
 HKEY hkey; 

 char szBuffer[255]; 
 DWORD KeyValue; 

 DWORD lBufferSize = 255; 

 RegOpenKeyEx(HKEY_LOCAL_MACHINE, &quot;Software\\Microsoft\\Windows NT\\CurrentVersion&quot;, 0, KEY_READ, &amp;hkey) ; 
 RegQueryValueEx(hkey, &quot;InstallDate&quot;, NULL, NULL, KeyValue, &amp;lBufferSize) ; 
 RegCloseKey(hkey) ; 

 printf(&quot;Wert des Schluessels: %i&quot;,KeyValue, &quot;\n\nPress any key...&quot;) ; 
 getchar() ; 

  return 0;
}
</code></pre>
<p>gibt aber nicht den richtigen wert aus.... der in der regy gespeichert ist!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1364473</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1364473</guid><dc:creator><![CDATA[toxi]]></dc:creator><pubDate>Thu, 13 Sep 2007 08:33:29 GMT</pubDate></item><item><title><![CDATA[Reply to InstallDate auslesen on Thu, 13 Sep 2007 08:38:03 GMT]]></title><description><![CDATA[<p><a href="http://msdn2.microsoft.com/en-us/library/ms724911.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/ms724911.aspx</a></p>
<blockquote>
<p>**lpData<br />
A pointer to a buffer that receives the value's data. This parameter can be NULL if the data is not required.</p>
<p>lpcbData<br />
A pointer to a variable that specifies the size of the buffer pointed to by the lpData parameter, in bytes. When the function returns, this variable contains the size of the data copied to lpData.**</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1364477</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1364477</guid><dc:creator><![CDATA[tenchou]]></dc:creator><pubDate>Thu, 13 Sep 2007 08:38:03 GMT</pubDate></item><item><title><![CDATA[Reply to InstallDate auslesen on Thu, 13 Sep 2007 11:48:21 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;conio.h&gt; 
#include &lt;windows.h&gt; 
#include &lt;stdio.h&gt; 
#include &lt;tchar.h&gt; 
#include &lt;iostream&gt; 

using namespace std; 

int main(int argc, char *argv[]) { 

// ############# 

HKEY     m_hMasterKey     = HKEY_LOCAL_MACHINE;//Hauptschlüssel 
LPCTSTR  m_lpSubKey     = &quot;SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion&quot;;//Schlüssel Pfad 
LPCTSTR  m_lpValueName    = &quot;InstallDate&quot;;//Schlüsselname der ausgelesen wird 

HKEY hKey; 
DWORD dwNumber = 0; 
DWORD dwData = sizeof(DWORD); 
RegOpenKey(m_hMasterKey, m_lpSubKey, &amp;hKey);
RegQueryValueEx(hKey,&quot;InstallDate&quot;,0,0,(BYTE*)&amp;dwNumber,&amp;dwData);
RegCloseKey(hKey) ;

//    printf(&quot;Ausgabe: %i&quot;,szValue); 

    cout &lt;&lt; dwNumber &lt;&lt; endl;

// ############## 

printf (&quot;\n Press any key...&quot;); 

getch(); 

return 0; 

}
</code></pre>
<p>Jetzt bekomm ich den richtigen Wert... jetzt muss ich die Sekunden noch in ein vernünftiges Datum umwandeln...<br />
thx so far !!!!! :p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1364599</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1364599</guid><dc:creator><![CDATA[toxi]]></dc:creator><pubDate>Thu, 13 Sep 2007 11:48:21 GMT</pubDate></item></channel></rss>