Re: [問題] jmp ffff:0 不能用了
※ 引述《whitefox (八十萬定存宅男)》之銘言:
: 以前舊的windows系統可以用這方式關掉dos 視窗
: 現在的win7會跳出ntvdm.exe錯誤的訊息
: 而不會直接關掉cmd.exe的視窗
: 有可以取代的方法嗎
#include <windows.h>
#pragma comment(lib, "user32")
int main() {
HWND hp = GetForegroundWindow();
DWORD pid;
char str[256];
GetWindowThreadProcessId(hp, &pid);
printf("hp = %x, pid = %d\n", hp, pid);
sprintf(str, "hp = %x, pid = %d\n", hp, pid);
MessageBoxA(NULL, str, "", MB_OK);
sprintf(str, "taskkill /pid %d", pid);
system(str);
return 0;
}
在 Windows XP 可以用 taskkill 透過這個碗糕 PID 關掉 cmd.exe。
Windows 7 的話,那要等我買新電腦才能測。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 124.8.136.77
討論串 (同標題文章)
Programming 近期熱門文章
PTT數位生活區 即時熱門文章