设为首页 加入收藏

TOP

子视窗控制项(五十一)
2010-12-30 21:12:42 来源: 作者: 【 】 浏览:32820
Tags:视窗 控制
sName = szAppName ;

if (!RegisterClass (&wndclass))
{
MessageBox ( NULL, TEXT ("This program requires Windows NT!"),
szAppName, MB_ICONERROR) ;
return 0 ;
}

hwnd = CreateWindow ( szAppName, TEXT ("Environment List Box"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, hInstance, NULL) ;

ShowWindow (hwnd, iCmdShow) ;
UpdateWindow (hwnd) ;

while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
return msg.wParam ;
}

void FillListBox (HWND hwndList)
{
int iLength ;
TCHAR * pVarBlock, * pVarBeg, * pVarEnd, * pVarName ;

pVarBlock = GetEnvironmentStrings () ; // Get pointer to environment block

while (*pVarBlock)
{
if (*pVarBlock != '=') // Skip variable names beginning with '='
{
pVarBeg = pVarBlock ; // Beginning of variable name
while (*pVarBlock++ != '=') ; // Scan until '='
pVarEnd = pVarBlock - 1 ; // Points to '=' sign
iLength = pVarEnd - pVarBeg ; // Length of variable name

// Allocate memory for the variable name and terminating
// zero. Copy the variable name and append a zero.

pVarName = calloc (i
首页 上一页 48 49 50 51 52 53 54 下一页 尾页 51/61/61
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇功能表及其他资源 下一篇计时器

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: