<?xml version="1.0" encoding="gbk"?>
<rss version="2.0">
  <channel>
    <title>曲径通幽论坛 - Functions</title>
    <link>http://www.groad.net/bbs/forum.php?mod=forumdisplay&amp;fid=119</link>
    <description>Latest 20 threads of Functions</description>
    <copyright>Copyright(C) 曲径通幽论坛</copyright>
    <generator>Discuz! Board by Comsenz Inc.</generator>
    <lastBuildDate>Fri, 10 Apr 2026 21:44:45 +0000</lastBuildDate>
    <ttl>60</ttl>
    <image>
      <url>http://www.groad.net/bbs/static/image/common/logo_88_31.gif</url>
      <title>曲径通幽论坛</title>
      <link>http://www.groad.net/bbs/</link>
    </image>
    <item>
      <title>GetExceptionCode() --- 获得异常代码</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8260</link>
      <description><![CDATA[在异常发生后，应该立刻获取异常代码，以确切知道发生了什么异常，__except 块或者过滤表达式可以通过使用 GetExceptionCode() 函数来做到这一点。
需要注意的是，编译器会强制过滤函数本身不能调用 GetExceptionCode()，比如：



通常的做法是在过滤表达式中调用 ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Thu, 23 Jan 2014 07:19:23 +0000</pubDate>
    </item>
    <item>
      <title>SetConsoleCtrlHandler() -- 设置控制台信号处理函数</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8253</link>
      <description><![CDATA[当你在命令行里工作时，经常会输入 Ctrl-C 这个组合键以停止程序的运行。SetConsoleCtrlHandler() 函数可以让一个或多个特定函数在接收到 Ctrl-C, Ctrl-break 这些与控制台有关的信号时得到执行。函数有两个参数，第 1 个参数是要安装的信号处理函数，当第 2 个参数 Add ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Mon, 20 Jan 2014 05:40:36 +0000</pubDate>
    </item>
    <item>
      <title>Beep() --- 设置主板扬声器</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8252</link>
      <description><![CDATA[可用 Beep() 函数让主板上的扬声器发声，函数的执行与声音的发生是同步的，同时还可以更改声音的频率以及发声的持续时间。Beep() 函数原型为：第 1 个参数 dwFreq 是声音的频率，可设置的值的范围是 37 到 32,767 （0x25 ~ 0x7FFF）。
第  2 个参数 dwDuration 表示声 ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Sat, 18 Jan 2014 13:44:25 +0000</pubDate>
    </item>
    <item>
      <title>TerminateProcess() -- 结束进程</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7900</link>
      <description><![CDATA[TerminateProcess() 函数用来结束一个进程，原型如下：

hProcess 是输入参数，是一个要结束进程的句柄。该句柄必须具有 PROCESS_TERMINATE 访问权限才能使指定进程结束。

uExitCode 是输入参数，它指定了一个退出代码。可以使用 GetExitCodeProcess 函数来获取进程的 ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Mon, 15 Jul 2013 11:08:33 +0000</pubDate>
    </item>
    <item>
      <title>OpenProcess() -- 打开一个进程对象</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7899</link>
      <description><![CDATA[OpenProcess() 函数用以打开一个存在的本地进程对象，原型如下：


dwDesiredAccess 是输入参数，指定访问进程对象的权限，该权限包括“标准访问权限”以及“进程特定权限”。这些详细的权限取值参考 MSDN 文档。

bInheritHandle  是输入参数，为布尔类型，如果为 TRUE ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Mon, 15 Jul 2013 10:53:48 +0000</pubDate>
    </item>
    <item>
      <title>Process32Next() -- 从快照中依次获取进程信息</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7898</link>
      <description><![CDATA[Process32Next() 函数可以从快照中依次获取进程信息，原型如下：

它的两个参数的含义和 Process32First()  的一样。
 
测试代码可参考：http://www.groad.net/bbs/read.php?tid-7894.html 。]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Mon, 15 Jul 2013 07:32:31 +0000</pubDate>
    </item>
    <item>
      <title>Process32First() -- 获取快照中的第一个进程信息</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7895</link>
      <description><![CDATA[获取进程快照使用  CreateToolhelp32Snapshot()  函数，而 Process32First() 则是用来获得快照中的第一个进程的信息，原型如下：


hSnapshot  是输入参数，它是 CreateToolhelp32Snapshot() 函数返回的快照句柄（调用 CreateToolhelp32Snapshot 时第 1 个参数使用的是  ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Sun, 14 Jul 2013 15:37:40 +0000</pubDate>
    </item>
    <item>
      <title>CreateToolhelp32Snapshot() -- 获取进程快照</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7894</link>
      <description><![CDATA[CreateToolhelp32Snapshot() 函数可获取系统中进程的快照，或指定进程的快照，包括堆，线程，模块等，原型如下：

dwFlags 是输入参数，表示想要获取的快照信息，有不同的取值：TH32CS_INHERIT，TH32CS_SNAPALL，TH32CS_SNAPHEAPLIST，TH32CS_SNAPMODULE，TH32CS_SNAPMO ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Sun, 14 Jul 2013 14:22:22 +0000</pubDate>
    </item>
    <item>
      <title>GetWindowsDirectory() -- 获取 Windows 系统安装目录</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7887</link>
      <description><![CDATA[Windows 的系统目录在安装的时候确定，在不同的主机上运行的系统可能不同。此外，不同的 Windows 版本它们的系统目录默认情况也不尽相同。

获取 Windows 系统的安装目录使用 GetWindowsDirectory 函数，其原型如下：


参数：
lpBuffer ：输出参数，用来保存系统路径的 ...]]></description>
      <category>Functions</category>
      <author>easy</author>
      <pubDate>Thu, 11 Jul 2013 14:37:33 +0000</pubDate>
    </item>
    <item>
      <title>RegSetValueEx() -- 设置键值</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7740</link>
      <description><![CDATA[RegSetValueEx() 函数用来设置注册表中的键值，其原型如下：

第 1 个参数 hKey 是输入参数，是一个已打开键的句柄，该键必须以 KEY_SET_VALUE 的权限打开。该句柄由 RegCreateKeyEx , RegCreateKeyTransacted, RegOpenKeyEx  或 RegOpenKeyTransacted 函数返回，也可以 ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Thu, 18 Apr 2013 04:17:52 +0000</pubDate>
    </item>
    <item>
      <title>RegCreateKeyEx()/RegCreateKey() -- 新建子键</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7739</link>
      <description><![CDATA[RegCreateKeyEx() 函数用来新建一个键，如果该键已经存在，那么就打开该键。注意，键名大小写不敏感。原型如下：

第 1 个参数 hKey 是个输入参数，是一个已经打开键的句柄。之前被打开的键必须要以 KEY_CREATE_SUB_KEY 的访问权限打开，这样在调用该函数时才能创建一个 ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Wed, 17 Apr 2013 16:14:47 +0000</pubDate>
    </item>
    <item>
      <title>RegOpenKeyEx() -- 打开已经存在的键</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7731</link>
      <description><![CDATA[RegOpenKeyEx() 函数用来打开注册表已经存在的键，其原型如下：

第 1 个参数 hKey 是输入参数，表示要打开的键，可以是 RegCreateKeyEx() 或者是 RegOpenKeyEx() 等函数的返回值。它还可以是下面几个预定义键之一：


第 2 个参数 lpSubKey 是个输入参数，表示的是子键 ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Tue, 16 Apr 2013 02:43:39 +0000</pubDate>
    </item>
    <item>
      <title>FreeEnvironmentStrings() -- 释放环境变量字符串内存块</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=6400</link>
      <description><![CDATA[FreeEnvironmentStrings() 原型如下：

函数用来释放环境变量字符串内存块，这个内存块由函数 GetEnvironmentStrings()  获得。

测试代码参考：http:/ ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Sun, 04 Mar 2012 07:49:18 +0000</pubDate>
    </item>
    <item>
      <title>GetEnvironmentStrings() --获取当前进程环境变量</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=6399</link>
      <description><![CDATA[GetEnvironmentStrings() 原型如下：

该函数用来获取当前进程环境变量。

测试代码：
[mw_shl_code=cpp,true]#include \&quot;stdafx.h\&quot;
#include 

int _tmain(int argc, _TCHAR* argv[])
{ ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Sun, 04 Mar 2012 07:41:47 +0000</pubDate>
    </item>
    <item>
      <title>GetProcessHandleCount() -- 获取属于指定进程的已打开句柄数</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=6392</link>
      <description><![CDATA[GetProcessHandleCount() 原型如下：

该函数用来获取属于指定进程的已打开的句柄数。

第 1 个参数 hProcess 是输入参数， ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Sun, 04 Mar 2012 02:45:09 +0000</pubDate>
    </item>
    <item>
      <title>GetSystemDirectory() -- 获取系统路径</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=6391</link>
      <description><![CDATA[GetSystemDirectory() 函数原型如下：

该函数返回系统目录，系统目录就是包含了系统所需的动态链接库以及驱动程序等文件的目录，一般的就在  C ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Sun, 04 Mar 2012 02:04:44 +0000</pubDate>
    </item>
    <item>
      <title>GetPriorityClass()/SetPriorityClass() -- 获取/设置指定进程优先级类</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=6390</link>
      <description><![CDATA[GetPriorityClass() 和 SetPriorityClass() 函数原型分别如下：

GetPrior ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Sat, 03 Mar 2012 20:06:31 +0000</pubDate>
    </item>
    <item>
      <title>GetCurrentProcess() -- 获取当前进程的虚句柄</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=6369</link>
      <description><![CDATA[GetCurrentProcess() 原型如下：

函数没有参数，返回值是当前进程的虚句柄。

一个虚句柄是一个特别的常数，对于目前来说，值为 -1 ，也就是说如果将 -1 当成是一个句柄，那么就表示当前 ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Fri, 02 Mar 2012 17:00:40 +0000</pubDate>
    </item>
    <item>
      <title>GetCurrentProcessId() -- 获得当前进程的 PID</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=6368</link>
      <description><![CDATA[GetCurrentProcessId() 原型如下：

函数的返回值是调用进程的 PID 值，没有参数。

测试代码：
[mw_shl_code=cpp,true]#include \&quot;stdafx.h\&quot;
#include 

int _tmain(int argc, _TCHAR* ar ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Fri, 02 Mar 2012 16:26:55 +0000</pubDate>
    </item>
    <item>
      <title>CreateProcess() -- 创建新的进程</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=6367</link>
      <description><![CDATA[CreateProcess() 函数原型如下：
[mw_shl_code=cpp,true]BOOL WINAPI CreateProcess(
&#160;&#160;__in_opt&#160;&#160;&#160;&#160; LPCTSTR lpApplicationName,
&#160;&#160;__inout_opt&#160;&#160;LPTSTR lpCommandLine,
&#160;&#160;__in_opt&#160;&#160;&#160;&amp;#1 ...]]></description>
      <category>Functions</category>
      <author>beyes</author>
      <pubDate>Fri, 02 Mar 2012 12:39:30 +0000</pubDate>
    </item>
  </channel>
</rss>