设为首页 加入收藏

TOP

子视窗控制项(五十九)
2010-12-30 21:12:42 】 浏览:46671
Tags:视窗 控制
Buffer, TEXT ("\\")) ;
SetWindowText (hwndText, lstrcat (szBuffer, szFile)) ;
}
else
{
bValidFile = FALSE ;
szBuffer [lstrlen (szBuffer) - 1] = '\0' ;

// If setting the directory doesn't work, maybe it's
// a drive change, so try that.

if (!SetCurrentDirectory (szBuffer + 1))
{
szBuffer [3] = ':' ;
szBuffer [4] = '\0' ;
SetCurrentDirectory (szBuffer + 2) ;
}

// Get the new directory name and fill the list box.

GetCurrentDirectory (MAX_PATH + 1, szBuffer) ;
SetWindowText (hwndText, szBuffer) ;
SendMessage (hwndList, LB_RESETCONTENT, 0, 0) ;
SendMessage (hwndList, LB_DIR, DIRATTR,
(LPARAM) TEXT ("*.*")) ;
}
InvalidateRect (hwnd, NULL, TRUE) ;
}
return 0 ;
case WM_PAINT :
if (!bValidFile)
break ;

if (INVALID_HANDLE_VALUE == (hFile = CreateFile (szFile,
GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL)))
{
bValidFile = FALSE ;
break ;
}

ReadFile (hFile, buffer, MAXREAD, &i, NULL) ;
CloseHandle (hFile) ;

// i now equals the number of bytes in buffer.
// Commence getting a device context for displaying text.

hdc = BeginPaint (hwnd, &ps) ;
Sele
首页 上一页 56 57 58 59 60 61 下一页 尾页 59/61/61
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇功能表及其他资源 下一篇计时器

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目