请输入您要查询的百科知识:

 

词条 sysmets.h
释义

在学习windows编程时,在参考教程上的程序例时,可能都遇到过类似问题。实际上这是一个需要自己创建的头文件。在windows程序设计的前半部分有这个文件的代码,复制它,命名为'sysmets.h,并把它和源代码放到同一目录下,然后#include"sysmets.h"即可。(注意不是#include<sysmets.h>)

这个问题出现是因为sysmets.h不是VC或SDK的头文件。

首先建立头文件sysmets.h。代码如下:

#define NUMLINES ((int) (sizeof sysmetrics / sizeof sysmetrics [0]))

struct

{

int Index ;

TCHAR * szLabel ;

TCHAR * szDesc ;

}

sysmetrics [] =

{

SM_CXSCREEN, TEXT ("SM_CXSCREEN"),

TEXT ("Screen width in pixels"),

SM_CYSCREEN, TEXT ("SM_CYSCREEN"),

TEXT ("Screen height in pixels"),

SM_CXVSCROLL, TEXT ("SM_CXVSCROLL"),

TEXT ("Vertical scroll width"),

SM_CYHSCROLL, TEXT ("SM_CYHSCROLL"),

TEXT ("Horizontal scroll height"),

SM_CYCAPTION, TEXT ("SM_CYCAPTION"),

TEXT ("Caption bar height"),

SM_CXBORDER, TEXT ("SM_CXBORDER"),

TEXT ("Window border width"),

SM_CYBORDER, TEXT ("SM_CYBORDER"),

TEXT ("Window border height"),

SM_CXFIXEDFRAME,TEXT ("SM_CXFIXEDFRAME"),

TEXT ("Dialog window frame width"),

SM_CYFIXEDFRAME,TEXT ("SM_CYFIXEDFRAME"),

TEXT ("Dialog window frame height"),

SM_CYVTHUMB, TEXT ("SM_CYVTHUMB"),

TEXT ("Vertical scroll thumb height"),

SM_CXHTHUMB, TEXT ("SM_CXHTHUMB"),

TEXT ("Horizontal scroll thumb width"),

SM_CXICON, TEXT ("SM_CXICON"),

TEXT ("Icon width"),

SM_CYICON, TEXT ("SM_CYICON"),

TEXT ("Icon height"),

SM_CXCURSOR, TEXT ("SM_CXCURSOR"),

TEXT ("Cursor width"),

SM_CYCURSOR, TEXT ("SM_CYCURSOR"),

TEXT ("Cursor height"),

SM_CYMENU, TEXT ("SM_CYMENU"),

TEXT ("Menu bar height"),

SM_CXFULLSCREEN,TEXT ("SM_CXFULLSCREEN"),

TEXT ("Full screen client area width"),

SM_CYFULLSCREEN,TEXT ("SM_CYFULLSCREEN"),

TEXT ("Full screen client area height"),

SM_CYKANJIWINDOW,TEXT ("SM_CYKANJIWINDOW"),

TEXT ("Kanji window height"),

SM_MOUSEPRESENT, TEXT ("SM_MOUSEPRESENT"),

TEXT ("Mouse present flag"),

SM_CYVSCROLL, TEXT ("SM_CYVSCROLL"),

TEXT ("Vertical scroll arrow height"),

SM_CXHSCROLL, TEXT ("SM_CXHSCROLL"),

TEXT ("Horizontal scroll arrow width"),

SM_DEBUG, TEXT ("SM_DEBUG"),

TEXT ("Debug version flag"),

SM_CXSMICON, TEXT ("SM_CXSMICON"), TEXT ("Small icon width"),

SM_CYSMICON, TEXT ("SM_CYSMICON"),

TEXT ("Small icon height"),

} ; 而在源文件中写:#include "sysmets.h",而不是:#include <sysmets.h>.此外,网上有些头文件的代码有拼写错误而导致运行出错。在结构struct中的int Index 误写为int iIndex.

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/1/26 15:07:20