<?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[Funktionsergebnis ausgeben und Message aktualisieren]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe dieses kleine Programm, welches diverse Dinge feststellen und in Zukunft anpassen soll.<br />
Windows Version prüfen und und eine Messagebox.<br />
DEP Status auslesen und wieder eine Messagebox...</p>
<p>1. Diese Messageboxen sind ein Problem.<br />
Eine einzige Messagebox sollte erweitert bzw. aktualisiert werden.<br />
Am liebsten natürlich alles mit einer Meldung am Ende ausgeben. Es ist entweder schon zu spät oder ich bin noch zu doof in c++.</p>
<p>2. Die Funktion WinVersionnummer() gibt den Wert &quot;int_WinVersion&quot; an switch weiter, wie kann ich mir den Anzeigen lassen zur Prüfung ohne &quot;große Umstände&quot;?</p>
<p>3. Ich habe zwar die Windows Version in eine Funktion bekommen, wie bekomme ich den DEP-Teil aus gleiche Weise ausgelagert? Hatte ständig Fehler beim Versuch.(dies nicht definiert, das nicht deklariert...)</p>
<p>Danke für jede Hilfe.</p>
<pre><code>// ConsoleApplication1.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
//

#include &quot;stdafx.h&quot;
#include &quot;Windows.h&quot;
#include &lt;VersionHelpers.h&gt;
#include &lt;iostream&gt;
#include &lt;string&gt;

//--------------------------------------------------------------------------------------------------WINVERSION FUNKTION 

int WinVersionnummer();
int WinVersionnummer() {
	int int_WinVersion;
	if (!IsWindows8OrGreater())
	{
		if (IsWindows7OrGreater())
		{
			int_WinVersion = 7;
		}
		else {
			int_WinVersion = 0;
		}
	}
	else {
		int_WinVersion = 8;
	}
	return int_WinVersion;
}
//--------------------------------------------------------------------------------------------------WINVERSION FUNKTION

int main()
{
	//--------------------------------------------------------------------------------------------------WINVERSION 
	switch (WinVersionnummer())
	{
	case 7:
		MessageBox(NULL, &quot;Windows 7&quot;, &quot;Version is Supported&quot;, MB_OK);
		break;
	case 8:
		MessageBox(NULL, &quot;You have at least Windows 8&quot;, &quot;Version is Supported&quot;, MB_OK);

		break;
	case 0:
		MessageBox(NULL, &quot;You need at least Windows 7&quot;, &quot;Version Not Supported&quot;, MB_OK);
		break;
	}
	//--------------------------------------------------------------------------------------------------WINVERSION 

	//---------------------------------------------------http://voidmain.realplain.com/SetDEP.c---------DEP
	typedef DEP_SYSTEM_POLICY_TYPE(WINAPI *GetSysDEPPolicy_f)(void);
	HMODULE  hKernel32 = GetModuleHandleW(L&quot;kernel32.dll&quot;);
	GetSysDEPPolicy_f GetSystemDEP = (GetSysDEPPolicy_f)GetProcAddress(hKernel32, &quot;GetSystemDEPPolicy&quot;);

	char buf[128], output[1024];
	LPSTR SysDEP_msg = buf;

	if (GetSystemDEP)
	{
		DEP_SYSTEM_POLICY_TYPE SysDEP_type = GetSystemDEP();
		LPCSTR type_msg;

		OSVERSIONINFO versionInfo;

		switch (SysDEP_type)
		{
		case DEPPolicyAlwaysOff:
			type_msg = &quot;DEPPolicyAlwaysOff and SetDEP will have no effect&quot;;
		case DEPPolicyAlwaysOn:
			type_msg = &quot;DEPPolicyAlwaysOn and SetDEP will have no effect&quot;;
			break;
		case DEPPolicyOptIn:
			versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
			type_msg = &quot;DEPPolicyOptIn is little to no use, on Vista and later&quot;;
			break;
		case DEPPolicyOptOut:
			type_msg = &quot;DEPPolicyOptOut is useful&quot;;
			break;
		default:
			type_msg = &quot;FATAL ERROR&quot;; // Shouldn't happen, prevent crash
		}
		MessageBox(NULL, type_msg, &quot;Result&quot;, MB_OK);
	}
	else
	{
		SysDEP_msg = &quot;Note: This system doesn't have the DEP functions!&quot;;
	}
	//--------------------------------------------------------------------------------------------------DEP

	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/334577/funktionsergebnis-ausgeben-und-message-aktualisieren</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 14:54:31 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/334577.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 Sep 2015 22:42:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Funktionsergebnis ausgeben und Message aktualisieren on Wed, 23 Sep 2015 22:42:39 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe dieses kleine Programm, welches diverse Dinge feststellen und in Zukunft anpassen soll.<br />
Windows Version prüfen und und eine Messagebox.<br />
DEP Status auslesen und wieder eine Messagebox...</p>
<p>1. Diese Messageboxen sind ein Problem.<br />
Eine einzige Messagebox sollte erweitert bzw. aktualisiert werden.<br />
Am liebsten natürlich alles mit einer Meldung am Ende ausgeben. Es ist entweder schon zu spät oder ich bin noch zu doof in c++.</p>
<p>2. Die Funktion WinVersionnummer() gibt den Wert &quot;int_WinVersion&quot; an switch weiter, wie kann ich mir den Anzeigen lassen zur Prüfung ohne &quot;große Umstände&quot;?</p>
<p>3. Ich habe zwar die Windows Version in eine Funktion bekommen, wie bekomme ich den DEP-Teil aus gleiche Weise ausgelagert? Hatte ständig Fehler beim Versuch.(dies nicht definiert, das nicht deklariert...)</p>
<p>Danke für jede Hilfe.</p>
<pre><code>// ConsoleApplication1.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
//

#include &quot;stdafx.h&quot;
#include &quot;Windows.h&quot;
#include &lt;VersionHelpers.h&gt;
#include &lt;iostream&gt;
#include &lt;string&gt;

//--------------------------------------------------------------------------------------------------WINVERSION FUNKTION 

int WinVersionnummer();
int WinVersionnummer() {
	int int_WinVersion;
	if (!IsWindows8OrGreater())
	{
		if (IsWindows7OrGreater())
		{
			int_WinVersion = 7;
		}
		else {
			int_WinVersion = 0;
		}
	}
	else {
		int_WinVersion = 8;
	}
	return int_WinVersion;
}
//--------------------------------------------------------------------------------------------------WINVERSION FUNKTION

int main()
{
	//--------------------------------------------------------------------------------------------------WINVERSION 
	switch (WinVersionnummer())
	{
	case 7:
		MessageBox(NULL, &quot;Windows 7&quot;, &quot;Version is Supported&quot;, MB_OK);
		break;
	case 8:
		MessageBox(NULL, &quot;You have at least Windows 8&quot;, &quot;Version is Supported&quot;, MB_OK);

		break;
	case 0:
		MessageBox(NULL, &quot;You need at least Windows 7&quot;, &quot;Version Not Supported&quot;, MB_OK);
		break;
	}
	//--------------------------------------------------------------------------------------------------WINVERSION 

	//---------------------------------------------------http://voidmain.realplain.com/SetDEP.c---------DEP
	typedef DEP_SYSTEM_POLICY_TYPE(WINAPI *GetSysDEPPolicy_f)(void);
	HMODULE  hKernel32 = GetModuleHandleW(L&quot;kernel32.dll&quot;);
	GetSysDEPPolicy_f GetSystemDEP = (GetSysDEPPolicy_f)GetProcAddress(hKernel32, &quot;GetSystemDEPPolicy&quot;);

	char buf[128], output[1024];
	LPSTR SysDEP_msg = buf;

	if (GetSystemDEP)
	{
		DEP_SYSTEM_POLICY_TYPE SysDEP_type = GetSystemDEP();
		LPCSTR type_msg;

		OSVERSIONINFO versionInfo;

		switch (SysDEP_type)
		{
		case DEPPolicyAlwaysOff:
			type_msg = &quot;DEPPolicyAlwaysOff and SetDEP will have no effect&quot;;
		case DEPPolicyAlwaysOn:
			type_msg = &quot;DEPPolicyAlwaysOn and SetDEP will have no effect&quot;;
			break;
		case DEPPolicyOptIn:
			versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
			type_msg = &quot;DEPPolicyOptIn is little to no use, on Vista and later&quot;;
			break;
		case DEPPolicyOptOut:
			type_msg = &quot;DEPPolicyOptOut is useful&quot;;
			break;
		default:
			type_msg = &quot;FATAL ERROR&quot;; // Shouldn't happen, prevent crash
		}
		MessageBox(NULL, type_msg, &quot;Result&quot;, MB_OK);
	}
	else
	{
		SysDEP_msg = &quot;Note: This system doesn't have the DEP functions!&quot;;
	}
	//--------------------------------------------------------------------------------------------------DEP

	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2468913</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2468913</guid><dc:creator><![CDATA[tusoweit]]></dc:creator><pubDate>Wed, 23 Sep 2015 22:42:39 GMT</pubDate></item><item><title><![CDATA[Reply to Funktionsergebnis ausgeben und Message aktualisieren on Thu, 24 Sep 2015 10:39:45 GMT]]></title><description><![CDATA[<p>Hol dir ein HANDLE auf die MessageBox, dann kannst du die gezielt adressieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2468943</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2468943</guid><dc:creator><![CDATA[Kernalcrasher]]></dc:creator><pubDate>Thu, 24 Sep 2015 10:39:45 GMT</pubDate></item></channel></rss>