【求助】dos窗口和多线程问题
1.怎样隐藏dos窗口?例如:只弹出一个窗口
MessageBox(0,"h","w",0);
或者类似病毒一样后台运行
2.多线程怎样创建?
//unsigned long * p=NULL;
//CreateThread(0,0,(LPTHREAD_START_ROUTINE)Tread,0,0,p);
//LPTHREAD_START_ROUTINE怎么翻译?
#include <windows.h> int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { while(true) { ::MessageBox(NULL,"窗口隐藏","老杨",0); Sleep(10000);//后台运行 每十秒弹出一次窗口 } return 0; }
#include <stdio.h> #include <windows.h> #include <time.h> DWORD WINAPI ThreadProc(LPVOID p) { int i = 100; while(i>=1) { printf("%d ",i--); Sleep(500); } return 0; } main() { int i = 1,j; DWORD pid = 1000; CreateThread(NULL,0,ThreadProc,NULL,0,&pid); while(i<=100) { printf("%d ",i++); Sleep(500); system("cls"); } return 0; }