<?xml version="1.0" encoding="UTF-8" ?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Posteet: redemarrer</title> 
    <link>http://www.posteet.com/</link> 
    <description>Recent posteets posted to Posteet</description>
    <ttl>60</ttl>

    
    <item>
        <title>MFC redemarrer Windows</title>
        <link>http://www.posteet.com/view/377</link>
        <description>
        <![CDATA[<pre>// Fonction pour redemarrer Windows avec les MFC

void RestartWindows(void)
{
	// Declaration
	HANDLE hToken; 
	TOKEN_PRIVILEGES tkp; 

	// Get a token for this process. 
	OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &amp;hToken);


	// Get the LUID for the shutdown privilege.  
	LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME,&amp;tkp.Privileges[0].Luid); 

	tkp.PrivilegeCount = 1;  // one privilege to set    
	tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; 

	// Get the shutdown privilege for this process.  
	AdjustTokenPrivileges(hToken, FALSE, &amp;tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0); 


	// Shut down the system and force all applications to close.  
	ExitWindowsEx(EWX_REBOOT| EWX_FORCE, 0); 
}</pre> <a href="http://www.posteet.com/tags/C">[C]</a>  <a href="http://www.posteet.com/tags/C++">[C++]</a>  <a href="http://www.posteet.com/tags/MFC">[MFC]</a>  <a href="http://www.posteet.com/tags/redemarrer">[redemarrer]</a>  <a href="http://www.posteet.com/tags/windows">[windows]</a> ]]>        </description>
        <dc:creator>moifort</dc:creator>
        <pubDate>Mon, 12 Nov 2007 12:57:16 +0000</pubDate>

            <category>C</category>
            <category>C++</category>
            <category>MFC</category>
            <category>redemarrer</category>
            <category>windows</category>
    
    </item>


</channel>
</rss>
