返回首页

我试图移动一个文件,我的控制台应用程序的一个简单的定时器。计时器,似乎要工作,但该文件不动。任何帮助表示赞赏。 Thak。


// Phonebooth.cpp : Defines the entry point for the console application.

//



#include "stdafx.h"

#include <time.h>

#include <windows.h>

#include <iostream>

 

VOID CALLBACK TimerProc(

HWND hwnd, // handle to window

UINT uMsg, // WM_TIMER message

UINT_PTR idEvent, // timer identifier

DWORD dwTime // current system time

)

{

printf("Die, ****in' world\n");

rename("c:\\PASS\\airport.zip", "c:\\Users\\DS\\Downloads\\");

}

 

DWORD WINAPI ThreadProc(

LPVOID lpParameter // thread data

)

{

UINT uiTimer = ::SetTimer(NULL, 12354, 100, TimerProc);

	

	MSG msg;

	while (GetMessage(&msg, NULL, 0, 0))

	{

	// ranslateMessage(&msg);

		DispatchMessage(&msg);

	}

return 0;

}

 

int main()

{

HANDLE hThread = ::CreateThread(NULL, NULL, ThreadProc, NULL, NULL, NULL);

CloseHandle(hThread);

::Sleep(10000);

return 0;

}</iostream></windows.h></time.h>
:7766180 |会员:7766180 |会员

回答