Win32 SetWindowLong函数的第二个参数是一个整型,可以取不同的值,根据此值设置窗口的不同的属性;如果设为 GWL_WNDPROC 则可以为窗口设置一个另外的窗口过程;
VC6新建一个win32项目,类型选为 典型helloworld 程序;
资源中添加一个菜单,
总的代码如下;
// setproc.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "resource.h"
#define MAX_LOADSTRING 100
// Global Variables:
HINSTANCE hInst; // current instance
TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text
// Foward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
LRE