跳到正文

个人记录

浅谈【windows.h】(4)

Dimly_dust约 3 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2026年6月9日
篇幅
约 3 分钟

版本

  1. v1当前

上期回顾:

  1. 浅谈【windows.h】(1)
  • FindWindow 函数

  • SendMessage 函数

  • WindowFromPoint 函数

  1. 浅谈【windows.h】(2)
  • GetCursorPos 函数

  • SetCursorPos 函数

  • ShowWindow 函数

  1. 浅谈【windows.h】(3)
  • GetClientRect 函数

  • GetCWindowRect 函数

  • Sleep 函数


此篇讲述关于文件的操作。

  1. CopyFile
  • 功能:CopyFile函数可以用来复制文件到指定目录。

函数原型:CopyFile("文件源目录","文件目标目录",TRUE or FALSE);

C++
void Copy(char File1[1024],char File2[1024])
{
	CopyFile(File1,File2,FALSE);
}
  1. DeleteFile
  • 功能:删除指定文件

函数原型:DeleteFile("要删除的文件路径和文件名");

C++
void Delet(char Dele[1024])
{
	DeleteFile(Dele);
}
  1. CreateDirectory
  • 功能:创建一个目录(注意:一次只能创建一级路径,而不能创建多级路径)

函数原型:CreateDirectory("文件夹路径名",NULL);

C++
void Delets(char file[1024])
{

	DeleteFile(file,NULL);

}
  1. RemoveDirectory
  • 功能:删除指定目录(注意:只能删除空目录)

函数原型:RemoveDirectory("目录路径名");

C++
void Remove(char file[1024])
{

	RemoveDirectory(file);

}

上一篇   ~~~下一篇

原文