📄 fillbox.c
字号:
#include "fillbox.h"#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <string.h>#include <sys/stat.h>#include <sys/time.h>#include <sys/types.h>#include <unistd.h>#include <pwd.h>#include <errno.h>void fill_box(HWND hDlg, const char* path, int boxid){ struct dirent* dir_ent; DIR* dir; struct stat ftype; char fullpath[PATH_MAX+1];// SendDlgItemMessage (hDlg, boxid, LB_RESETCONTENT, 0, (LPARAM)0); if ((dir = opendir (path)) == NULL) return; while ((dir_ent = readdir(dir)) != NULL) { strncpy(fullpath, path, PATH_MAX); strcat(fullpath, "/"); strcat(fullpath, dir_ent->d_name); if(stat(fullpath, &ftype) < 0) continue; // if (S_ISDIR(ftype.st_mode))// SendDlgItemMessage (hDlg, IDL_, LB_ADDSTRING, 0, (LPARAM)dir_ent->d_name); if (S_ISREG (ftype.st_mode)) { LISTBOXITEMINFO lbii; lbii.string = dir_ent->d_name; lbii.cmFlag = CMFLAG_BLANK; lbii.hIcon = 0; SendDlgItemMessage (hDlg, boxid, LB_ADDSTRING, 0, (LPARAM)&lbii); } } closedir (dir); }char* itoa(int i, char* a){ if(a == NULL) return NULL; sprintf(a, "%d", i); return a;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -