首先创建一个Win32 Application 工程,然后就是敲入如下代码段:
1
/**//*
2
HINSTANCE__* lpHinstance = (HWND__*)lpHWnd;
3
//编译器检查类型
4
*/
5
#define DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name
6
7
DECLARE_HANDLE(HINSTANCE);
8
9
DECLARE_HANDLE(HWND);
10
11
typedef char* LPSTR;
12
13
typedef const char* LPCSTR;
14
15
typedef unsigned int UINT;
16
17
#define APIENTRY __stdcall
18
19
#define MB_OK 0x00000000L
20
21
#define NULL 0
22
23
extern "C"
24
{
25
int __stdcall MessageBoxA(HWND hWnd ,
26
LPCSTR lpText,
27
LPCSTR lpCaption,
28
UINT uType);
29
30
HWND __stdcall FindWindowA(
31
LPCSTR lpClassName ,
32
LPCSTR lpWindowName);
33
}
34
35
int APIENTRY WinMain(HINSTANCE hInstance,
36
HINSTANCE hPrevInstance,
37
LPSTR lpCmdLine,
38
int nCmdShow)
39
{
40
MessageBoxA(NULL,"Hello",(LPCSTR)"Title",MB_OK);
41
42
return 0;
43
}
44
45
46
47
posted on 2011-04-14 15:07
CrackerCS 阅读(556)
评论(0) 编辑 收藏 引用 所属分类:
MFC