很菜的问题,OpenThread这个api的定义?
这个api似乎在Vc6中没有定义出来,新版本是有的,大家能发出来吗?还有这定义应该怎样插入到代码中?是修改头文件吗?还是用typedef来定义?我才刚学VC,很多问题都不明白的,希望大家指教!!
[解决办法]
OpenThread
The OpenThread function opens an existing thread object.
HANDLE OpenThread(
DWORD dwDesiredAccess,
BOOL bInheritHandle,
DWORD dwThreadId
);
Parameters
dwDesiredAccess
[in] Access to the thread object. This access right is checked against any security descriptor for the thread. This parameter can be one or more of the thread access rights.
bInheritHandle
[in] If this parameter is TRUE, the new process inherits the handle. If the parameter is FALSE, the handle is not inherited.
dwThreadId
[in] Identifier of the thread to be opened.
Return Values
If the function succeeds, the return value is an open handle to the specified process.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
Remarks
The handle returned by OpenThread can be used in any function that requires a handle to a thread, such as the wait functions, provided you requested the appropriate access rights. The handle is granted access to the thread object only to the extent it was specified in the dwDesiredAccess parameter.
When you are finished with the handle, be sure to close it by using the CloseHandle function.
Requirements
Client Requires Windows XP, Windows 2000 Professional, or Windows Me.
Server Requires Windows Server 2003 or Windows 2000 Server.
Header Declared in Winbase.h; include Windows.h.
Library Link to Kernel32.lib.
DLL Requires Kernel32.dll.
[解决办法]
Header Declared in Winbase.h; include Windows.h
你在代码开头 #include <windows.h> 就可以用了