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

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

    
    <item>
        <title>&quot;Iconiser&quot; des liens en CSS</title>
        <link>http://www.posteet.com/view/395</link>
        <description>
        <![CDATA[<pre>/* FICHIERS */
a[href $='.pdf'] { padding-left: 22px; background: transparent url(img/pdf.png) no-repeat center left;}
a[href $='.gif'] { padding-left: 22px; background: transparent url(img/image.png) no-repeat center left;}
a[href $='.png'] { padding-left: 22px; background: transparent url(img/image.png) no-repeat center left;}
a[href $='.jpg'] { padding-left: 22px; background: transparent url(img/image.png) no-repeat center left;}
a[href $='.doc'] { padding-left: 22px; background: transparent url(img/word.png) no-repeat center left;}
a[href $='.xls'] { padding-left: 22px; background: transparent url(img/excel.png) no-repeat center left;}
a[href $='.css'] { padding-left: 22px; background: transparent url(img/texte.png) no-repeat center left;}
a[href $='.txt'] { padding-left: 22px; background: transparent url(img/texte.png) no-repeat center left;}
a[href $='.php'] { padding-left: 22px; background: transparent url(img/php.png) no-repeat center left;}
a[href $='.zip'] { padding-left: 22px; background: transparent url(img/compress.png) no-repeat center left;}
a[href $='.rar'] { padding-left: 22px; background: transparent url(img/compress.png) no-repeat center left;}
a[href $='.tar.gz'] { padding-left: 22px; background: transparent url(img/package.png) no-repeat center left;}
a[href $='.pkg.gz'] { padding-left: 22px; background: transparent url(img/package.png) no-repeat center left;}
 
/* PROTOCOLES IM */
a[href ^=&quot;aim:&quot;]  { padding-left: 22px; background: transparent url(img/aim.png) no-repeat center left;}
a[href ^=&quot;msnim:&quot;] { padding-left: 22px; background: transparent url(img/msn.png) no-repeat center left;}
a[href ^=&quot;xmpp:&quot;] { padding-left: 22px; background: transparent url(img/jabber.png) no-repeat center left;}
a[href *=&quot;icq.com&quot;]  { padding-left: 22px; background: transparent url(img/icq.gif) no-repeat center left;}
a[href *=&quot;edit.yahoo.com/config/send_webmesg?&quot;]  { padding-left: 22px; background: transparent url(img/yahoo.gif) no-repeat center left;}
a[href ^=&quot;skype:&quot;]  { padding-left: 22px; background: transparent url(img/skype.png) no-repeat center left;}
 
/* SITES WEB */
a[href *=&quot;youtube.com/&quot;] { padding-left: 22px; background: transparent url(img/youtube.png) no-repeat center left;}
a[href *=&quot;metacafe.com/&quot;] { padding-left: 22px; background: transparent url(img/metacafe.png) no-repeat center left;}
a[href *=&quot;flickr.com&quot;] { padding-left: 22px; background: transparent url(img/flickr.png) no-repeat center left;}
a[href *=&quot;zooomr.com&quot;] { padding-left: 22px; background: transparent url(img/zooomr.png) no-repeat center left;}
a[href *=&quot;imageshack.us&quot;] { padding-left: 22px; background: transparent url(img/imageshack.png) no-repeat center left;}
a[href *=&quot;bubbleshare.com&quot;] { padding-left: 22px; background: transparent url(img/bubbleshare.png) no-repeat center left;}</pre> <a href="http://www.posteet.com/tags/css">[css]</a>  <a href="http://www.posteet.com/tags/icon">[icon]</a>  <a href="http://www.posteet.com/tags/icones">[icones]</a>  <a href="http://www.posteet.com/tags/liens">[liens]</a>  <a href="http://www.posteet.com/tags/links">[links]</a> ]]>        </description>
        <dc:creator>moifort</dc:creator>
        <pubDate>Mon, 12 Nov 2007 14:27:43 +0000</pubDate>

            <category>css</category>
            <category>icon</category>
            <category>icones</category>
            <category>liens</category>
            <category>links</category>
    
    </item>

  
    <item>
        <title>Manipulation des sockets en C et C++</title>
        <link>http://www.posteet.com/view/392</link>
        <description>
        <![CDATA[<pre>// Declaration socket
WSADATA WSAData;
SOCKET sock;
SOCKADDR_IN sin;	

// Initialisation socket
WSAStartup(MAKEWORD(2,0), &amp;WSAData);

sin.sin_addr.s_addr= inet_addr(&quot;127.0.0.1&quot;); // Adresse IP
sin.sin_family= AF_INET;
sin.sin_port= htons(4001);  // Port
sock = socket(AF_INET,SOCK_STREAM,0);
bind(sock, (SOCKADDR *)&amp;sin, sizeof(sin));

// Si connection etablie
if (connect(sock, (SOCKADDR *)&amp;sin, sizeof(sin)) == 0)
{
// Declaration socket
WSADATA WSAData;
SOCKET sock;
SOCKADDR_IN sin;	

// Initialisation socket
WSAStartup(MAKEWORD(2,0), &amp;WSAData);

sin.sin_addr.s_addr	= inet_addr(&quot;127.0.0.1&quot;); // Adresse IP
sin.sin_family		= AF_INET;
sin.sin_port		= htons(4001);  // Port
sock = socket(AF_INET,SOCK_STREAM,0);
bind(sock, (SOCKADDR *)&amp;sin, sizeof(sin));

// Si connection etablie
if (connect(sock, (SOCKADDR *)&amp;sin, sizeof(sin)) == 0)
else

// Fin
closesocket(sock);
WSACleanup();</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/socket">[socket]</a>  <a href="http://www.posteet.com/tags/windows">[windows]</a> ]]>        </description>
        <dc:creator>moifort</dc:creator>
        <pubDate>Mon, 12 Nov 2007 14:17:39 +0000</pubDate>

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

  
    <item>
        <title>MFC lire et ecrire la valeur d'une clé dans le registre</title>
        <link>http://www.posteet.com/view/391</link>
        <description>
        <![CDATA[<pre>// Déclaration du handle
HKEY hKey;
unsigned char KeyValue[MAX_PATH]; 
DWORD size = MAX_PATH;
DWORD regtype = REG_DWORD;


// Test l'ouverture du dossier de la cle qui est dans le HKEY_LOCAL_MACHINE du registre 
// et se trouve dans le dossier &quot;SYSTEM\\Protected\\Volume0&quot;
// KEY_ALL_ACCESS : Acces lecture et ecriture
if( RegOpenKeyEx( HKEY_LOCAL_MACHINE, &quot;SYSTEM\\Protected\\Volume0&quot;,0,KEY_ALL_ACCESS,&amp;hKey ) == ERROR_SUCCESS )
{
	RegQueryValueEx(hKey,&quot;Enabled&quot;,NULL,&amp;regtype, KeyValue,&amp;size );
	// Lecture de la valeur, si elle = 1, par exemple
	if ( KeyValue[0] == 1)
	{		
	}
	else
	{		
	}
	//Ferme la clé
	RegCloseKey( hKey );
}
else
{
         // Dans le cas ou il n'arrive pas a ouvrir la clé un message d'erreur apparait devant toutes les fenetre, MB_TOPMOST
         // avec un bouton OK, MB_OK
	 MessageBox(NULL, &quot;L'opération a échoué&quot;, &quot;Erreur&quot;, MB_OK|MB_TOPMOST);
}</pre> <a href="http://www.posteet.com/tags/C++">[C++]</a>  <a href="http://www.posteet.com/tags/clé">[clé]</a>  <a href="http://www.posteet.com/tags/ecriture">[ecriture]</a>  <a href="http://www.posteet.com/tags/lecture">[lecture]</a>  <a href="http://www.posteet.com/tags/MFC">[MFC]</a>  <a href="http://www.posteet.com/tags/mofifier">[mofifier]</a>  <a href="http://www.posteet.com/tags/registre">[registre]</a>  <a href="http://www.posteet.com/tags/windows">[windows]</a> ]]>        </description>
        <dc:creator>moifort</dc:creator>
        <pubDate>Mon, 12 Nov 2007 14:05:32 +0000</pubDate>

            <category>C++</category>
            <category>clé</category>
            <category>ecriture</category>
            <category>lecture</category>
            <category>MFC</category>
            <category>mofifier</category>
            <category>registre</category>
            <category>windows</category>
    
    </item>

  
    <item>
        <title>MFC convertir Tree en texte</title>
        <link>http://www.posteet.com/view/388</link>
        <description>
        <![CDATA[<pre>// Conversion d'un TreeControl en texte
void Conversion(void) 
{
	CStdioFile File;
	if(File.Open( &quot;C:\\test.txt&quot;, CFile::modeCreate | CFile::modeWrite | CFile::typeText )) // Cree un nouveau fichier, ici : &quot;C:\\test.txt&quot;
	{
		HTREEITEM hti = m_TreeStruct.GetRootItem();
		while( hti )
		{
			int nLevel = GetTreeLevel( hti );
			while( nLevel-- ) File.WriteString( &quot;|\t&quot; );
			if (m_TreeStruct.ItemHasChildren( hti ))
				File.WriteString(&quot;+ &quot; + m_TreeStruct.GetItemText( hti ) + &quot;\r\n&quot;);
			else
				File.WriteString(&quot;  &quot; + m_TreeStruct.GetItemText( hti ) + &quot;\r\n&quot;);
			hti = GetNextItem( hti );
		}
	}

        File.Close(); // Ferme le fichier

	ShellExecute(NULL, &quot;open&quot;, &quot;C:\\essai.txt&quot;, 0, 0, SW_SHOWNORMAL); // On l'ouvre avec l'executable auquel il est associé, sous windows notepad.
	
}



/************************************************************************
									    	           
FONCTION: int GetTreeLevel(HTREEITEM)&amp;HTREEITEM GetNextItem(HTREEITEM)
																        
DEFINITION: Sous fonctions pour la conversion du Tree -&gt; Txt			

************************************************************************/
int CTailleStructureDlg::GetTreeLevel( HTREEITEM hItem )
{
	int iIndent = 0;
	while( (hItem = m_TreeStruct.GetParentItem( hItem )) != NULL )
		iIndent++;
	return iIndent;
}
 
 
HTREEITEM CTailleStructureDlg::GetNextItem( HTREEITEM hItem )
{
	HTREEITEM	hti;
 
	if( m_TreeStruct.ItemHasChildren( hItem ) )
		return m_TreeStruct.GetChildItem( hItem );		
	else
	{		
		while( (hti = m_TreeStruct.GetNextSiblingItem( hItem )) == NULL )
		{
			if( (hItem = m_TreeStruct.GetParentItem( hItem ) ) == NULL )
				return NULL;
		}
	}
	return hti;
}</pre> <a href="http://www.posteet.com/tags/C++">[C++]</a>  <a href="http://www.posteet.com/tags/convertir">[convertir]</a>  <a href="http://www.posteet.com/tags/MFC">[MFC]</a>  <a href="http://www.posteet.com/tags/texte">[texte]</a>  <a href="http://www.posteet.com/tags/tree">[tree]</a>  <a href="http://www.posteet.com/tags/windows">[windows]</a> ]]>        </description>
        <dc:creator>moifort</dc:creator>
        <pubDate>Mon, 12 Nov 2007 13:46:24 +0000</pubDate>

            <category>C++</category>
            <category>convertir</category>
            <category>MFC</category>
            <category>texte</category>
            <category>tree</category>
            <category>windows</category>
    
    </item>

  
    <item>
        <title>MFC creer une Thread</title>
        <link>http://www.posteet.com/view/386</link>
        <description>
        <![CDATA[<pre>//Declaration
UINT ThreadRecherche( LPVOID param );

// Lancement du thread de traitement 
CWinThread* pThread;	
pThread = AfxBeginThread((AFX_THREADPROC)ThreadRecherche,(LPVOID)this, THREAD_PRIORITY_NORMAL|THREAD_TERMINATE);


// Fonction thread
UINT ThreadRecherche(LPVOID param )
{
	return 0;
}</pre> <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/thread">[thread]</a>  <a href="http://www.posteet.com/tags/windows">[windows]</a> ]]>        </description>
        <dc:creator>moifort</dc:creator>
        <pubDate>Mon, 12 Nov 2007 13:35:27 +0000</pubDate>

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

  
    <item>
        <title>MFC manipulation d'un Tree Control</title>
        <link>http://www.posteet.com/view/384</link>
        <description>
        <![CDATA[<pre>/**************** Ajouter des données dans le Tree Control *****************/
//Adding item to the root:

HTREEITEM hParent = m_MFC_Tree.InsertItem(&quot;ItemText&quot;,TVI_ROOT);

//Adding child items to the Parent:
HTREEITEM hParent = m_MFC_Tree.InsertItem(&quot;ItemText&quot;,TVI_ROOT);
HTREEITEM hChild = m_MFC_Tree.InsertItem(&quot;Child ItemText&quot;,hParent,TVI_LAST);

/**************** Récuperer des données dans le Tree Control ***************/

HTREEITEM hItem = m_MFC_Tree.GetSelectedItem();
CString strItemText = m_MFC_Tree.GetItemText(hItem);

/**************** Supprimer des données dans le Tree Control ***************/

HTREEITEM hItem = m_MFC_Tree.GetSelectedItem();
m_MFC_Tree.DeleteItem(hItem);

/************** Exemple de code lors d'un evenement sur le Tree ***********/

void CCoderSourceDlg::OnSelchangedTreectrl(NMHDR* pNMHDR, LRESULT* pResult) 
   {
         NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;

         // TODO: Add your control notification handler code here
         HTREEITEM hItem = m_MFC_Tree.GetSelectedItem();
         CString strItemText = m_MFC_Tree.GetItemText(hItem);

         MessageBox(strItemText);

        *pResult = 0;
   }</pre> <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/tree">[tree]</a>  <a href="http://www.posteet.com/tags/windows">[windows]</a> ]]>        </description>
        <dc:creator>moifort</dc:creator>
        <pubDate>Mon, 12 Nov 2007 13:11:20 +0000</pubDate>

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

  
    <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>

  
    <item>
        <title>Transparence IE png provenant de feuille de style CSS</title>
        <link>http://www.posteet.com/view/368</link>
        <description>
        <![CDATA[<pre>/* A modifier dans la page CSS*/
/* A la place de :*/
background-image: url(&quot;image.png&quot;);

/* remplacer par :*/
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop src='image.png');
background-image: none;

/* !ATTENTION! Probleme sur les liens, pour resoudre ajouter: */

a, input
{
position: relative;
z-index: 1;
}</pre> <a href="http://www.posteet.com/tags/balise">[balise]</a>  <a href="http://www.posteet.com/tags/css">[css]</a>  <a href="http://www.posteet.com/tags/IE">[IE]</a>  <a href="http://www.posteet.com/tags/internet explorer">[internet explorer]</a>  <a href="http://www.posteet.com/tags/png">[png]</a>  <a href="http://www.posteet.com/tags/transparence">[transparence]</a> ]]>        </description>
        <dc:creator>moifort</dc:creator>
        <pubDate>Mon, 12 Nov 2007 11:58:04 +0000</pubDate>

            <category>balise</category>
            <category>css</category>
            <category>IE</category>
            <category>internet explorer</category>
            <category>png</category>
            <category>transparence</category>
    
    </item>

  
    <item>
        <title>Transparence sous IE png provenant de balises &lt;img&gt;</title>
        <link>http://www.posteet.com/view/367</link>
        <description>
        <![CDATA[<pre>/* A ajouter entre les balise &lt;head&gt; */
&lt;!--[if lt IE 7]&gt;
&lt;script defer type=&quot;text/javascript&quot; src=&quot;pngfix.js&quot;&gt;&lt;/script&gt;
&lt;![endif]--&gt;</pre> <a href="http://www.posteet.com/tags/&lt;img&gt;">[&lt;img&gt;]</a>  <a href="http://www.posteet.com/tags/balise">[balise]</a>  <a href="http://www.posteet.com/tags/css">[css]</a>  <a href="http://www.posteet.com/tags/html">[html]</a>  <a href="http://www.posteet.com/tags/IE">[IE]</a>  <a href="http://www.posteet.com/tags/internet explorer">[internet explorer]</a>  <a href="http://www.posteet.com/tags/png">[png]</a>  <a href="http://www.posteet.com/tags/transparence">[transparence]</a> ]]>        </description>
        <dc:creator>moifort</dc:creator>
        <pubDate>Mon, 12 Nov 2007 11:45:50 +0000</pubDate>

            <category>&lt;img&gt;</category>
            <category>balise</category>
            <category>css</category>
            <category>html</category>
            <category>IE</category>
            <category>internet explorer</category>
            <category>png</category>
            <category>transparence</category>
    
    </item>


</channel>
</rss>
