了解WINDOWS API基本数据类型

代码:

 1 /*header file*/
 2 #include <Windows.h>
 3 #include <stdio.h>
 4 
 5 /*function windows data type demo*/
 6 
 7 int WINAPI WinMain(
 8     HINSTANCE hInstance,
 9     HINSTANCE hPrevInstance,
10     LPSTR lpCmdLine,
11     int nCmdShow
12     )
13 {
14     //define string
15     LPSTR szString = "Windows data type,string.";
16     //define char arry
17     CHAR lpString[120];
18     //define type of DWORD data
19     DWORD dwMax = 0xFFFFFFFF;
20     DWORD dwOne = 0x1;
21     //define int data
22     INT iMax = 0xFFFFFFFF;
23     INT iOne = 0x1;
24 
25     //display string
26     MessageBox(NULL,szString,"LPSTR",MB_OK);
27     //copy mem
28     CopyMemory(lpString,szString,lstrlen(szString)+1);
29     MessageBox(NULL,lpString,"CHAR[]",MB_OK);
30 
31     //compare DWORD and display result
32     if(dwMax>dwOne)
33     {
34         MessageBox(NULL,"DWORD type of data 0xFFFFFFFF > 0x1","DWORD",MB_OK);
35     }
36     //compare INT and display result
37     if(iMax<iOne)
38     {
39         MessageBox(NULL,"INT type of data 0xFFFFFFFF < 0x1","INT",MB_OK);
40     }
41     return 0;
42 }

 

测试截图:

转载于:https://www.cnblogs.com/aguncn/archive/2013/03/05/2944065.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值