shwapi.c
资源名称:VC++视频传输.rar [点击查看]
上传用户:hxb_1234
上传日期:2010-03-30
资源大小:8328k
文件大小:1k
源码类别:
VC书籍
开发平台:
Visual C++
- #include "stdafx.h"
- #include "globals.h"
- void path_add_backslash(char *path)
- {
- if (path[strlen(path) - 1] != '\')
- strcat(path, "\");
- }
- BOOL path_is_relative(const char *path)
- {
- char drive[_MAX_DRIVE];
- char dir[_MAX_DIR];
- char fname[_MAX_FNAME];
- char ext[_MAX_EXT];
- _splitpath(path, drive, dir, fname, ext);
- if (!*drive) {
- char buffer[MAX_PATH];
- char *position;
- strcpy(buffer, dir);
- if (buffer[0] == '\' && buffer[1] == '\') {
- position =
- strchr(strchr
- (strchr(strchr(buffer, '\') + 1, '\') +
- 1, '\') + 1, '\') + 1;
- *position = ' ';
- if (GetDriveType(buffer) == DRIVE_REMOTE)
- return FALSE;
- return TRUE;
- } else
- return TRUE;
- }
- return FALSE;
- }
- BOOL path_remove_filespec(LPTSTR path)
- {
- char drive[_MAX_DRIVE];
- char dir[_MAX_DIR];
- char fname[_MAX_FNAME];
- char ext[_MAX_EXT];
- _splitpath(path, drive, dir, fname, ext);
- _makepath(path, drive, dir, NULL, NULL);
- return TRUE;
- }
- void path_unquote(LPTSTR path)
- {
- char pathbuffer[MAX_PATH];
- int lengte;
- if (path[0] == '"') {
- strcpy(pathbuffer, path + 1);
- lengte = strlen(pathbuffer);
- pathbuffer[lengte - 1] = ' ';
- strcpy(path, pathbuffer);
- }
- }