关闭DOS窗口
2008-03-08 12:41:54 来源:WEB开发网核心提示://http://nowcan.yeah.net#include <windows.h>void __fastcall KillPRocess(HWND hWnd){DWord* pPid;DWORD result;void *hg;hg = GlobalAlloc(GMEM_SHARE, sizeof(D
//http://nowcan.yeah.net
#include <windows.h>
void __fastcall KillPRocess(HWND hWnd)
{
DWord* pPid;
DWORD result;
void *hg;
hg = GlobalAlloc(GMEM_SHARE, sizeof(DWORD));
pPid =(DWORD *)GlobalLock(hg);
result = GetWindowThreadProcessId(hWnd, pPid);
if(result)
{
HANDLE ps = OpenProcess(1, false, *pPid);
TerminateProcess(ps, -9);
GlobalUnlock(hg);
GlobalFree(hg);
}
}
void __fastcall CloseDosWindow()
{
HWND hWnd=FindWindow("ConsoleWindowClass",NULL);//这个是2000的,98下用"tty"
KillProcess(hWnd);
return;
}
int main()
{
CloseDosWindow();
}
- 中查找“关闭DOS窗口”更多相关内容
- 中查找“关闭DOS窗口”更多相关内容
- 上一篇:黒白棋
- 下一篇:关机代码
更多精彩
赞助商链接