﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-C++世界-随笔分类-各类常用接口</title><link>http://www.cppblog.com/fdsajhg/category/14552.html</link><description>管理系统--&lt;</description><language>zh-cn</language><lastBuildDate>Sun, 26 Sep 2010 10:03:02 GMT</lastBuildDate><pubDate>Sun, 26 Sep 2010 10:03:02 GMT</pubDate><ttl>60</ttl><item><title>各类--通信--接口</title><link>http://www.cppblog.com/fdsajhg/archive/2010/09/06/125968.html</link><dc:creator>傅先生</dc:creator><author>傅先生</author><pubDate>Sun, 05 Sep 2010 22:03:00 GMT</pubDate><guid>http://www.cppblog.com/fdsajhg/archive/2010/09/06/125968.html</guid><wfw:comment>http://www.cppblog.com/fdsajhg/comments/125968.html</wfw:comment><comments>http://www.cppblog.com/fdsajhg/archive/2010/09/06/125968.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/fdsajhg/comments/commentRss/125968.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/fdsajhg/services/trackbacks/125968.html</trackback:ping><description><![CDATA[<br>类之间通信<br>线程间通信<br>进程间通信<br>电脑间通信--串口通信<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---网络通信<br><br>各硬件间通信---串口通信<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---邮件通信<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---短信通信<br><br><br>///进程之间通信<br>
<p>HWND hWnd = FindWindow(NULL,"MyApp");</p>
<p>if(hWnd!=NULL)</p>
<p>{</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; COPYDATASTRUCT cpd; /*给COPYDATASTRUCT结构赋值*/</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cpd.dwData = 0;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cpd.cbData =&nbsp;strlen("字符串");</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cpd.lpData = (void*)"字符串";</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ::SendMessage(hWnd,WM_COPYDATA,NULL,(LPARAM)&amp;cpd);//发送！</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*完事儿了！！*/</p>
<p>}<br><br><br><br><br><br><br><br><br></p>
<code><font style="FONT: 10pt Fixedsys; COLOR: #000000">////////////短信通信<br><br>&nbsp;&nbsp;&nbsp;&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #0000ff">int&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">wcharilen</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">=</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">TestWcharLen</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">(</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">ctest</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">,</font><font style="FONT: 10pt Fixedsys; COLOR: #800080">1000</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">);<br>&nbsp;&nbsp;&nbsp;&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #0000ff">wchar_t&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">*</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">wszSomeString</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">=</font><font style="FONT: 10pt Fixedsys; COLOR: #0000ff">new&nbsp;wchar_t</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">[</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">wcharilen</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">];</font><font style="FONT: 10pt Comic Sans MS; COLOR: #008000">//起决定性<br>&nbsp;&nbsp;&nbsp;&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #0000ff">char&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">*</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">szANSIString</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">=</font><font style="FONT: 10pt Fixedsys; COLOR: #0000ff">new&nbsp;char&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">[</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">wcharilen</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">+</font><font style="FONT: 10pt Fixedsys; COLOR: #800080">500</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">];<br>&nbsp;&nbsp;&nbsp;&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">USES_CONVERSION</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">;&nbsp;</font><font style="FONT: 10pt Comic Sans MS; COLOR: #008000">//&nbsp;声明这个宏要使用的局部变量<br>&nbsp;&nbsp;&nbsp;&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">memcpy</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">(</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">wszSomeString</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">,</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">ctest</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">,</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">wcharilen</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">);<br>&nbsp;&nbsp;&nbsp;&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">lstrcpy&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">(&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">szANSIString</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">,&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">OLE2A</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">(</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">wszSomeString</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">)&nbsp;);<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #0000ff">char&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">*</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">dwcontext</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">=</font><font style="FONT: 10pt Fixedsys; COLOR: #0000ff">new&nbsp;char</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">[</font><font style="FONT: 10pt Fixedsys; COLOR: #800080">2048</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">];<br>&nbsp;&nbsp;&nbsp;&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #0000ff">char&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">*</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">dwtemp</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">=</font><font style="FONT: 10pt Fixedsys; COLOR: #0000ff">new&nbsp;char</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">[</font><font style="FONT: 10pt Fixedsys; COLOR: #800080">300</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">];<br><br>&nbsp;&nbsp;&nbsp;&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">dwcontext</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">=</font><font style="FONT: 10pt Fixedsys; COLOR: #808080">"http://sms.api.bz/fetion.php?username=13420300680&amp;password=yahoo123&amp;sendto=13420300680&amp;message="</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">;<br><br><br>&nbsp;&nbsp;&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #0000ff">char&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">*</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">thecontext</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">=</font><font style="FONT: 10pt Fixedsys; COLOR: #808080">"http://sms.api.bz/fetion.php?username="</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">;<br>&nbsp;&nbsp;&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #0000ff">char&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">*</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">dwPhoneGoNUM</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">=</font><font style="FONT: 10pt Fixedsys; COLOR: #808080">"13420300680"</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">;<br>&nbsp;&nbsp;&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #0000ff">char&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">*</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">dwPhoneGoPASS</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">=</font><font style="FONT: 10pt Fixedsys; COLOR: #808080">"yahoo123"</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">;<br>&nbsp;&nbsp;&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #0000ff">char&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">*</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">dwPhoneNUM</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">=</font><font style="FONT: 10pt Fixedsys; COLOR: #808080">"13420300680"</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">;<br><br>&nbsp;&nbsp;&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">CString&nbsp;CCtemp</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">;<br>&nbsp;&nbsp;&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">CCtemp</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">.</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">Format</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">(</font><font style="FONT: 10pt Fixedsys; COLOR: #808080">"%s%s&amp;password=%s&amp;sendto=%s&amp;message=%s"</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">,</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">thecontext</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">,</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">dwPhoneGoNUM</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">,</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">dwPhoneGoPASS</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">,</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">dwPhoneNUM</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">,</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">szANSIString</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">);&nbsp;&nbsp;&nbsp;&nbsp;<br></font><font style="FONT: 10pt Comic Sans MS; COLOR: #008000">//&nbsp;&nbsp;&nbsp;&nbsp;memcpy(dwtemp,szANSIString,200);<br>//&nbsp;&nbsp;&nbsp;&nbsp;strcat(dwcontext,"dddd");//dwtemp<br><br>//&nbsp;&nbsp;&nbsp;&nbsp;AfxMessageBox(CCtemp);<br>&nbsp;&nbsp;&nbsp;&nbsp;</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">URLDownloadToFile</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">(</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">NULL</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">,</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">CCtemp</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">,</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">NULL</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">,</font><font style="FONT: 10pt Fixedsys; COLOR: #800080">0</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">,</font><font style="FONT: 10pt Fixedsys; COLOR: #000000">NULL</font><font style="FONT: 10pt Fixedsys; COLOR: #000080">);<br></font></code>
<img src ="http://www.cppblog.com/fdsajhg/aggbug/125968.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/fdsajhg/" target="_blank">傅先生</a> 2010-09-06 06:03 <a href="http://www.cppblog.com/fdsajhg/archive/2010/09/06/125968.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Window知料整理</title><link>http://www.cppblog.com/fdsajhg/archive/2010/08/28/124992.html</link><dc:creator>傅先生</dc:creator><author>傅先生</author><pubDate>Fri, 27 Aug 2010 21:28:00 GMT</pubDate><guid>http://www.cppblog.com/fdsajhg/archive/2010/08/28/124992.html</guid><wfw:comment>http://www.cppblog.com/fdsajhg/comments/124992.html</wfw:comment><comments>http://www.cppblog.com/fdsajhg/archive/2010/08/28/124992.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/fdsajhg/comments/commentRss/124992.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/fdsajhg/services/trackbacks/124992.html</trackback:ping><description><![CDATA[<code><font style="font: 10pt Fixedsys; color: #000000; ">Window知料整理</font><font style="font: 10pt Fixedsys; color: #800080; ">2010</font><font style="font: 10pt Fixedsys; color: #000080; ">-</font><font style="font: 10pt Fixedsys; color: #800080; ">08</font><font style="font: 10pt Fixedsys; color: #000080; ">-</font><font style="font: 10pt Fixedsys; color: #800080; ">09&nbsp;19</font><font style="font: 10pt Fixedsys; color: #000080; ">:</font><font style="font: 10pt Fixedsys; color: #800080; ">17<br>
1</font><font style="font: 10pt Fixedsys; color: #000080; ">,<br>
<br>
</font><font style="font: 10pt Fixedsys; color: #800080; ">2</font><font style="font: 10pt Fixedsys; color: #000080; ">,<br>
<br>
</font><font style="font: 10pt Fixedsys; color: #800080; ">3</font><font style="font: 10pt Fixedsys; color: #000080; ">,<br>
<br>
</font><font style="font: 10pt Fixedsys; color: #000000; ">BOOL&nbsp;CALLBACK&nbsp;EnumWindowsProc</font><font style="font: 10pt Fixedsys; color: #000080; ">(</font><font style="font: 10pt Fixedsys; color: #000000; ">HWND&nbsp;hWnd</font><font style="font: 10pt Fixedsys; color: #000080; ">,&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">LPARAM&nbsp;lParam</font><font style="font: 10pt Fixedsys; color: #000080; ">)<br>
<br>
</font><font style="font: 10pt Fixedsys; color: #0000FF; ">int&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">main</font><font style="font: 10pt Fixedsys; color: #000080; ">(){<br>
<br>
</font><font style="font: 10pt Fixedsys; color: #000000; ">EnumWindows</font><font style="font: 10pt Fixedsys; color: #000080; ">(&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">EnumWindowsProc</font><font style="font: 10pt Fixedsys; color: #000080; ">,&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">NULL&nbsp;</font><font style="font: 10pt Fixedsys; color: #000080; ">);<br>
<br>
}<br>
<br>
</font><font style="font: 10pt Fixedsys; color: #000000; ">BOOL&nbsp;CALLBACK&nbsp;EnumWindowsProc</font><font style="font: 10pt Fixedsys; color: #000080; ">(</font><font style="font: 10pt Fixedsys; color: #000000; ">HWND&nbsp;hWnd</font><font style="font: 10pt Fixedsys; color: #000080; ">,&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">LPARAM&nbsp;lParam</font><font style="font: 10pt Fixedsys; color: #000080; ">)<br>
{<br>
</font><font style="font: 10pt Fixedsys; color: #0000FF; ">if</font><font style="font: 10pt Fixedsys; color: #000080; ">(::</font><font style="font: 10pt Fixedsys; color: #000000; ">GetWindowLong</font><font style="font: 10pt Fixedsys; color: #000080; ">(</font><font style="font: 10pt Fixedsys; color: #000000; ">hWnd</font><font style="font: 10pt Fixedsys; color: #000080; ">,</font><font style="font: 10pt Fixedsys; color: #000000; ">GWL_STYLE</font><font style="font: 10pt Fixedsys; color: #000080; ">)&nbsp;&&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">WS_VISIBLE</font><font style="font: 10pt Fixedsys; color: #000080; ">)<br>
{<br>
&nbsp;&nbsp;&nbsp;</font><font style="font: 10pt Fixedsys; color: #0000FF; ">char&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">sBuf</font><font style="font: 10pt Fixedsys; color: #000080; ">[</font><font style="font: 10pt Fixedsys; color: #800080; ">256</font><font style="font: 10pt Fixedsys; color: #000080; ">];<br>
&nbsp;&nbsp;&nbsp;</font><font style="font: 10pt Comic Sans MS; color: #008000; ">//获取窗口标题<br>
&nbsp;&nbsp;&nbsp;</font><font style="font: 10pt Fixedsys; color: #000080; ">::</font><font style="font: 10pt Fixedsys; color: #000000; ">GetWindowText</font><font style="font: 10pt Fixedsys; color: #000080; ">(&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">hWnd</font><font style="font: 10pt Fixedsys; color: #000080; ">,&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">sBuf</font><font style="font: 10pt Fixedsys; color: #000080; ">,&nbsp;</font><font style="font: 10pt Fixedsys; color: #800080; ">256&nbsp;</font><font style="font: 10pt Fixedsys; color: #000080; ">);<br>
&nbsp;&nbsp;&nbsp;</font><font style="font: 10pt Fixedsys; color: #0000FF; ">if&nbsp;</font><font style="font: 10pt Fixedsys; color: #000080; ">(&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">strcmp</font><font style="font: 10pt Fixedsys; color: #000080; ">(&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">sBuf</font><font style="font: 10pt Fixedsys; color: #000080; ">,&nbsp;</font><font style="font: 10pt Fixedsys; color: #808080; ">&quot;我的电脑&quot;&nbsp;</font><font style="font: 10pt Fixedsys; color: #000080; ">)&nbsp;==&nbsp;</font><font style="font: 10pt Fixedsys; color: #800080; ">0&nbsp;</font><font style="font: 10pt Fixedsys; color: #000080; ">)<br>
&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;</font><font style="font: 10pt Comic Sans MS; color: #008000; ">//在发现我的电脑时设置其标题为www.a3gs.com<br>
&nbsp;&nbsp;&nbsp;&nbsp;</font><font style="font: 10pt Fixedsys; color: #000080; ">::</font><font style="font: 10pt Fixedsys; color: #000000; ">SetWindowText</font><font style="font: 10pt Fixedsys; color: #000080; ">(&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">hWnd</font><font style="font: 10pt Fixedsys; color: #000080; ">,&nbsp;</font><font style="font: 10pt Fixedsys; color: #808080; ">&quot;www.a3gs.com&quot;&nbsp;</font><font style="font: 10pt Fixedsys; color: #000080; ">);<br>
&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;</font><font style="font: 10pt Fixedsys; color: #0000FF; ">char&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">sclassname</font><font style="font: 10pt Fixedsys; color: #000080; ">[</font><font style="font: 10pt Fixedsys; color: #800080; ">256</font><font style="font: 10pt Fixedsys; color: #000080; ">];<br>
&nbsp;&nbsp;&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">GetClassName</font><font style="font: 10pt Fixedsys; color: #000080; ">(<br>
&nbsp;&nbsp;&nbsp;&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">hWnd</font><font style="font: 10pt Fixedsys; color: #000080; ">,</font><font style="font: 10pt Fixedsys; color: #000000; ">sclassname</font><font style="font: 10pt Fixedsys; color: #000080; ">,</font><font style="font: 10pt Fixedsys; color: #800080; ">256<br>
&nbsp;&nbsp;&nbsp;&nbsp;</font><font style="font: 10pt Fixedsys; color: #000080; ">);<br>
&nbsp;&nbsp;&nbsp;</font><font style="font: 10pt Fixedsys; color: #0000FF; ">if</font><font style="font: 10pt Fixedsys; color: #000080; ">(</font><font style="font: 10pt Fixedsys; color: #000000; ">strcmp</font><font style="font: 10pt Fixedsys; color: #000080; ">(</font><font style="font: 10pt Fixedsys; color: #000000; ">sclassname</font><font style="font: 10pt Fixedsys; color: #000080; ">,</font><font style="font: 10pt Fixedsys; color: #808080; ">&quot;TXGuiFoundation&quot;</font><font style="font: 10pt Fixedsys; color: #000080; ">)==</font><font style="font: 10pt Fixedsys; color: #800080; ">0</font><font style="font: 10pt Fixedsys; color: #000080; ">)<br>
&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">printf</font><font style="font: 10pt Fixedsys; color: #000080; ">(&nbsp;</font><font style="font: 10pt Fixedsys; color: #808080; ">&quot;------------------------&nbsp;\n&quot;</font><font style="font: 10pt Fixedsys; color: #000080; ">);<br>
&nbsp;&nbsp;&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">printf</font><font style="font: 10pt Fixedsys; color: #000080; ">(&nbsp;</font><font style="font: 10pt Fixedsys; color: #808080; ">&quot;%s&nbsp;--&nbsp;%d\n&nbsp;--%s---%s&nbsp;\n&quot;</font><font style="font: 10pt Fixedsys; color: #000080; ">,&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">sBuf&nbsp;</font><font style="font: 10pt Fixedsys; color: #000080; ">,</font><font style="font: 10pt Fixedsys; color: #000000; ">hWnd&nbsp;</font><font style="font: 10pt Fixedsys; color: #000080; ">,</font><font style="font: 10pt Fixedsys; color: #000000; ">lParam</font><font style="font: 10pt Fixedsys; color: #000080; ">,</font><font style="font: 10pt Fixedsys; color: #000000; ">sclassname&nbsp;</font><font style="font: 10pt Fixedsys; color: #000080; ">);<br>
&nbsp;&nbsp;&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">printf</font><font style="font: 10pt Fixedsys; color: #000080; ">(&nbsp;</font><font style="font: 10pt Fixedsys; color: #808080; ">&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&quot;&nbsp;</font><font style="font: 10pt Fixedsys; color: #000080; ">);<br>
&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">m_hwndFind</font><font style="font: 10pt Fixedsys; color: #000080; ">[</font><font style="font: 10pt Fixedsys; color: #000000; ">m_num</font><font style="font: 10pt Fixedsys; color: #000080; ">]&nbsp;=&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">hWnd</font><font style="font: 10pt Fixedsys; color: #000080; ">;<br>
&nbsp;&nbsp;&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">m_num</font><font style="font: 10pt Fixedsys; color: #000080; ">++;<br>
}<br>
</font><font style="font: 10pt Fixedsys; color: #0000FF; ">return&nbsp;</font><font style="font: 10pt Fixedsys; color: #800080; ">1</font><font style="font: 10pt Fixedsys; color: #000080; ">;<br>
}<br>
<br>
</font><font style="font: 10pt Fixedsys; color: #000000; ">HWND&nbsp;hWnd&nbsp;</font><font style="font: 10pt Fixedsys; color: #000080; ">=&nbsp;</font><font style="font: 10pt Fixedsys; color: #000000; ">GetForegroundWindow</font><font style="font: 10pt Fixedsys; color: #000080; ">();</font><font style="font: 10pt Comic Sans MS; color: #008000; ">//GetActiveWindow();&nbsp;//'得到活动窗口的句柄<br>
<br>
</font><font style="font: 10pt Fixedsys; color: #000000; ">GetWindowText</font><font style="font: 10pt Fixedsys; color: #000080; ">(</font><font style="font: 10pt Fixedsys; color: #000000; ">hWnd</font><font style="font: 10pt Fixedsys; color: #000080; ">,</font><font style="font: 10pt Fixedsys; color: #000000; ">s_Buf</font><font style="font: 10pt Fixedsys; color: #000080; ">,</font><font style="font: 10pt Fixedsys; color: #800080; ">255</font><font style="font: 10pt Fixedsys; color: #000080; ">);<br>
<br>
</font><font style="font: 10pt Fixedsys; color: #000000; ">printf</font><font style="font: 10pt Fixedsys; color: #000080; ">(</font><font style="font: 10pt Fixedsys; color: #808080; ">&quot;tttt&nbsp;&nbsp;&nbsp;%s&nbsp;\n&quot;</font><font style="font: 10pt Fixedsys; color: #000080; ">,</font><font style="font: 10pt Fixedsys; color: #000000; ">s_Buf</font><font style="font: 10pt Fixedsys; color: #000080; ">);<br>
&nbsp;<br>
</font></code><img src ="http://www.cppblog.com/fdsajhg/aggbug/124992.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/fdsajhg/" target="_blank">傅先生</a> 2010-08-28 05:28 <a href="http://www.cppblog.com/fdsajhg/archive/2010/08/28/124992.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>内核函数接口类</title><link>http://www.cppblog.com/fdsajhg/archive/2010/08/20/124062.html</link><dc:creator>傅先生</dc:creator><author>傅先生</author><pubDate>Fri, 20 Aug 2010 01:41:00 GMT</pubDate><guid>http://www.cppblog.com/fdsajhg/archive/2010/08/20/124062.html</guid><wfw:comment>http://www.cppblog.com/fdsajhg/comments/124062.html</wfw:comment><comments>http://www.cppblog.com/fdsajhg/archive/2010/08/20/124062.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/fdsajhg/comments/commentRss/124062.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/fdsajhg/services/trackbacks/124062.html</trackback:ping><description><![CDATA[`
<img src ="http://www.cppblog.com/fdsajhg/aggbug/124062.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/fdsajhg/" target="_blank">傅先生</a> 2010-08-20 09:41 <a href="http://www.cppblog.com/fdsajhg/archive/2010/08/20/124062.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>