Win32 App
TesWin
Windows EXE template
-
cao_cong, 2005
e-mail: cao_cong_hx@yahoo.com.cn
[*BEGINPRO*]
[*BEGINDEF*]
[MakeDef]
Menu=1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0
1=4,O,$B\BRCC32.EXE /v /32 /I"$I",1
2=3,O,$B\BCC32.EXE /c /tW /L"$L" /I"$I",2
3=5,O,$B\ILINK32.EXE /aa /c /x /Gn /L"$L" $3 $A\Lib\c0w32.obj|$5||import32.lib cw32.lib||$4
4=0,0,,5
5=
6=*.obj,O,$B\BCC32.EXE /O2 /W /O /L"$L" /I"$I",*.cpp
7=0,0,"$E\OllyDbg",5
11=4,O,$B\BRCC32.EXE /v /32 /I"$I",1
12=3,O,$B\BCC32.EXE /c /tW /L"$L" /I"$I",2
13=5,O,$B\ILINK32.EXE /aa /c /x /Gn /L"$L" $3 $A\Lib\c0w32.obj|$5||import32.lib cw32.lib||$4
14=0,0,,5
15=
16=*.obj,$B\BCC32.EXE /O2 /W /O /L"$L" /I"$I",*.cpp
17=0,0,"$E\OllyDbg",5
[MakeFiles]
0=TesWin.rap
1=TesWin.rc
2=TesWin.cpp
3=TesWin.obj
4=TesWin.res
5=TesWin.exe
6=TesWin.def
7=TesWin.dll
8=TesWin.txt
9=TesWin.lib
10=TesWin.mak
11=TesWin.c
12=TesWin.com
13=TesWin.ocx
14=TesWin.idl
15=TesWin.tlb
[Resource]
1=IDI_MAINICO,100,2,Res\MAINICO.ico
[StringTable]
[Accel]
[VerInf]
[Group]
Group=Added files,Assembly,Resources,Misc,Modules
1=2
2=2
3=3
4=
[*ENDDEF*]
[*BEGINTXT*]
TesWin.cpp
#include "windows.h"
#include "TesWin.h"
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
	static TCHAR szAppName[]=TEXT("HelloWin");
	HWND hwnd;
	MSG msg;
	WNDCLASS wndclass;
	wndclass.style=CS_HREDRAW|CS_VREDRAW;
	wndclass.lpfnWndProc=WndProc;
	wndclass.cbClsExtra=0;
	wndclass.cbWndExtra=0;
	wndclass.hInstance=hInstance;
	wndclass.hIcon=LoadIcon(hInstance,(LPCSTR) IDI_MAINICO);
	wndclass.hCursor=LoadCursor(NULL,IDC_ARROW);
	wndclass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
	wndclass.lpszMenuName=NULL;
	wndclass.lpszClassName=szAppName;

	if(!RegisterClass(&wndclass))
	{
		MessageBox(NULL,TEXT("This program requires Windows NT!"),szAppName,MB_ICONERROR);
		return 0;
	}
	hwnd=CreateWindow(szAppName,				
					  TEXT("The Hello Program"),
					  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;
}

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	HDC hdc;
	PAINTSTRUCT ps;
	RECT rect;

	switch(message)
	{
	case WM_CREATE:
		//Add your code here
		return 0;

	case WM_PAINT:
		hdc=BeginPaint(hwnd,&ps);
		GetClientRect(hwnd,&rect);

		DrawText(hdc,TEXT("Hello,RadASM!"),-1,&rect,DT_SINGLELINE|DT_CENTER|DT_VCENTER);
		EndPaint(hwnd,&ps);
		return 0;

	case WM_DESTROY:
		PostQuitMessage(0);
		return 0;
	}
	return DefWindowProc(hwnd,message,wParam,lParam);
}
[*ENDTXT*]
[*BEGINTXT*]
TesWin.h
#define IDI_MAINICO	            100
[*ENDTXT*]
[*BEGINTXT*]
TesWin.Rc
#include "Res/TesWinRes.rc"
[*ENDTXT*]
[*ENDPRO*]
[*BEGINBIN*]
Res\MAINICO.ico
0000010001002020100000000000E80200001600000028000000200000004000
0000010004000000000080020000000000000000000000000000000000000000
0000000080000080000000808000800000008000800080800000C0C0C0008080
80000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000019999910000001999991000000000001
9991199100001999119910000000001999000099100199900009910000000099
9100000990099910000099000000009991000000000999100000000000000099
9000000000099900000000000000009990000000000999000000000000000099
9000000000099900000000000000009991000000000999100000000000000019
9100000000019910000000000000001999000000000199900000000000000009
9910000000009991000000000000000199100000990019910000099000000000
1991000099100199100009910000000009990000991000999000099100000000
0099910999900009991099990000000000019999991000001999999100000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF83FC1FFF19F
8CFFE3CF1E7FC7E63F3FC7FE3FFFC7FE3FFFC7FE3FFFC7FE3FFFC7FE3FFFE7FF
3FFFE3FF1FFFE3FF1FFFF1F38F9FF9F3CF9FF8F3C79FFC61E30FFF03F81FFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
[*ENDBIN*]
[*BEGINTXT*]
Res\TesWinRes.rc
#define IDI_MAINICO			100
IDI_MAINICO		ICON      DISCARDABLE "Res/MAINICO.ico"
[*ENDTXT*]
