VC/MFC/Win32程序员技术测试三--使用C++封装类进行Windows编程

糊糊 2005-05-18 01:34:19
VC/MFC/Win32程序员技术测试三--使用C++封装类进行Windows编程
在 --VC/MFC/Win32程序员技术测试一--学习Windows编程的第一步,一定要走好
http://community.csdn.net/Expert/TopicView.asp?id=4005888

和VC/MFC/Win32程序员技术测试二--使用Windowsx.h进行消息分流 中
http://community.csdn.net/Expert/TopicView1.asp?id=4013100

我相信,你自己已经用Win32 SDK,做出来了一个结构紧凑的,纯粹用C语言写的Win32应用程序。
下面就考验你用C++语言来进行Win32编程。

要求:
用一个C++类封装一个WinApp类,实现应用程序的初始化功能。
用一个C++类来封装Window类,实现窗口类的注册和窗口的创建和显示。

提示1:
大家知道在控制台下面,我们必须有一个main函数,因为它是可执行文件的入口函数,在windows下,必须有一个WinMain()函数,它应该也是可执行文件的入口函数。

知道在控制台下,可以先定义C++类,然后在main()函数中使用类的对象实现程序的运行过程,比如
class Obj
{
public :
Obj(void)
{
cout << “Construction” << endl;
}
~Obj(void)
{
cout << “DeConstruction” << endl;
}
void Initialize(void)
{
cout << “Initialization Started” << endl;
}
void Destroy(void)
{
cout << “Destroy Started” << endl;
}
};
然后我们在main()函数中可以这样用
main()
{
Obj* a=new Obj;
a->Initialize();
a->Destroy()
delete a;

exit(0);

}

同样的,在WinMain()函数中,也可以创建定义好的C++类对象,来实现程序的运行过程。

------
提示2 把LRESULT CallBack WinProc()在类定义中定义为静态的(static)

参考:
我的Blog中的:
面向对象的Windows编程实战(上)(使用C++和Win32 API)
面向对象的Windows编程实战(下)
对面向对象的Windows编程实战的一些补充说明
http://blog.csdn.net/huyoo/archive/2004/10/13/135168.aspx
http://blog.csdn.net/huyoo/archive/2004/10/14/135589.aspx
http://blog.csdn.net/huyoo/archive/2004/10/14/135612.aspx

Blog上不去的话,可以到文档中心去找:
http://dev.csdn.net/user/huyoo

或者使用百度和google搜索,很多网站都转了上面三篇文章。
--------------------
再一次说要求:

要求:
用一个C++类封装一个WinApp类,实现应用程序的初始化功能。
用一个C++类来封装Window类,实现窗口类的注册和窗口的创建和显示。

希望大家能够由此步入C++之旅,进而学习好MFC基础类库。
或者开始学wxWindows这个跨平台的C++的GUI类库。
我的Blog上有介绍,http://blog.csdn.net/huyoo

wxWindows,即wxWidgets,已经有一个wxWindgets中国爱好者网站:
http://wxWindgets.cn wxWindgets中国爱好者网站

我已经是其中一员,参与目前的三个里程碑的文档翻译工作。
目前我主要在翻译XRC部分,感兴趣的人和好友,可以去协同参加翻译工作。

我们诚心期待您的加盟,为中国的wxWidgets文档翻译做贡献。
...全文
304 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangyangcheng 2005-06-03
  • 打赏
  • 举报
回复
ding...
wu_xiaoer 2005-06-03
  • 打赏
  • 举报
回复
我刚学MFC
不太懂,
我先VC生成了一个“Hello World ”的程序
我到里加了两个MessageBox函数,结果竞然也搞出来了,不知道这样算不算
wu_xiaoer 2005-06-03
  • 打赏
  • 举报
回复
#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);

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
MSG msg;
HACCEL hAccelTable;

// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_MY04, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);

// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}

hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_MY04);

// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}

return msg.wParam;
}



//
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
//
// COMMENTS:
//
// This function and its usage is only necessary if you want this code
// to be compatible with Win32 systems prior to the 'RegisterClassEx'
// function that was added to Windows 95. It is important to call this function
// so that the application will get 'well formed' small icons associated
// with it.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;

wcex.cbSize = sizeof(WNDCLASSEX);

wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_MY04);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = (LPCSTR)IDC_MY04;
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);

return RegisterClassEx(&wcex);
}

//
// FUNCTION: InitInstance(HANDLE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function, we save the instance handle in a global variable and
// create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;

hInst = hInstance; // Store instance handle in our global variable

hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

if (!hWnd)
{
return FALSE;
}

ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);

return TRUE;
}

//
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
TCHAR szHello[MAX_LOADSTRING];
LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);

switch (message)
{
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDM_ABOUT:
DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
break;
case IDM_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_CREATE:
MessageBox(NULL,"创建窗口消息","",0);
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code here...
RECT rt;
GetClientRect(hWnd, &rt);
DrawText(hdc, szHello, strlen(szHello), &rt, DT_CENTER);
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
MessageBox(NULL,"退出程序","",0);

PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}

// Mesage handler for about box.
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
return TRUE;

case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
break;
}
return FALSE;
}
糊糊 2005-06-02
  • 打赏
  • 举报
回复
没有时间来顶了
greenteanet 2005-05-20
  • 打赏
  • 举报
回复
loveghb(温柔的毒药)棒啊,我学习VC也有一段时间啦,但是自己却总是认为自己学的不够,没有怎么做项目,所以进步得很慢..请大家给我点经验啊..谢谢啦..
糊糊 2005-05-19
  • 打赏
  • 举报
回复
哇,一下被你砸这么大个坑!!

你实在是太棒了, loveghb(温柔的毒药)棒!
loveghb 2005-05-19
  • 打赏
  • 举报
回复

2:用一个C++类封装一个WinApp类,实现应用程序的初始化功能。
#ifndef _MCL_BASIC
#define _MCL_BASIC

#include <windows.h>

class CWindow;
class CWinApp;

int APIENTRY afxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow);
HINSTANCE AfxGetInstanceHandle( );
CWinApp* AfxGetApp();
CWindow* AfxGetMainWnd();
HINSTANCE afxInstance;
CWinApp *afxCurrentWinApp;
CWindow *afxMainWnd;

class CWinApp
{
public:
CWinApp();
virtual void initApplication(void);
virtual WPARAM run(int nCmdShow);
};


class CWindow
{
public:
CWindow(void);
virtual ~CWindow(void);
virtual bool CreateEx(DWORD dwExStyle, LPCTSTR lpszClass, LPCTSTR lpszName,
DWORD dwStyle, int x, int y, int nWidth, int nHeight,
HWND hParent, HMENU hMenu, HINSTANCE hInst);
bool RegisterClass(LPCTSTR lpszClass, HINSTANCE hInst);
virtual WPARAM MessageLoop(void);
int ShowWindow(int nCmdShow) const;
int UpdateWindow(void) const;
virtual LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
virtual void GetWndClassEx(WNDCLASSEX &wc);
int MessageBox(LPCTSTR lpszText, LPCTSTR lpszCaption = NULL, UINT nType = MB_OK);
int SetWindowText(LPCTSTR lpString);
int GetWindowText(LPTSTR lpString, int nMaxCount);
void GetClientRect( LPRECT lpRect ) const;
void InvalidateRect( LPCRECT lpRect, BOOL bErase = TRUE );

public:
HWND m_hWnd;
WNDPROC m_OldProc;

};



#endif





#include <assert.h>
#include <string.h>
#include "MCL_BASIC.h"

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
return afxWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
}

int APIENTRY afxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
afxInstance = hInstance;
AfxGetApp()->initApplication();
return AfxGetApp()->run(nCmdShow);
}

HINSTANCE AfxGetInstanceHandle( )
{
return afxInstance;
}

CWinApp* AfxGetApp( )
{
return afxCurrentWinApp;
}

CWindow* AfxGetMainWnd()
{
return afxMainWnd;
}


//CWinApp
CWinApp::CWinApp()
{
afxCurrentWinApp = this;
}

void CWinApp::initApplication(void)
{

}

WPARAM CWinApp::run(int nCmdShow)
{
CWindow *pMainWnd;
if ( (pMainWnd = AfxGetMainWnd()) != NULL ) {
pMainWnd->ShowWindow(nCmdShow);
pMainWnd->UpdateWindow();

return pMainWnd->MessageLoop();
}

return 0;
}


//CWindow

CWindow::CWindow(void)
{
m_hWnd = NULL;
}

CWindow::~CWindow(void)
{

}

bool CWindow::CreateEx(DWORD dwExStyle, LPCTSTR lpszClass, LPCTSTR lpszName,
DWORD dwStyle, int x, int y, int nWidth, int nHeight,
HWND hParent, HMENU hMenu, HINSTANCE hInst)
{
if ( !RegisterClass(lpszClass, hInst) )
return false;

MDICREATESTRUCT mdic;
memset(&mdic, 0, sizeof(mdic));
mdic.lParam = (LPARAM)this;
m_hWnd = ::CreateWindowEx(dwExStyle, lpszClass, lpszName, dwStyle, x, y,
nWidth, nHeight, hParent, hMenu, hInst, &mdic);

return m_hWnd != NULL;
}

bool CWindow::RegisterClass(LPCTSTR lpszClass, HINSTANCE hInst)
{
WNDCLASSEX wc;

if ( !GetClassInfoEx(hInst, lpszClass, &wc) ) {
GetWndClassEx(wc);
wc.hInstance = hInst;
wc.lpszClassName = lpszClass;
if ( !::RegisterClassEx(&wc) )
return false;
}

return true;
}

WPARAM CWindow::MessageLoop(void)
{
MSG msg;

while ( ::GetMessage(&msg, NULL, 0, 0) )
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}

return msg.wParam;
}

int CWindow::ShowWindow(int nCmdShow) const
{
return ::ShowWindow(m_hWnd, nCmdShow);
}

int CWindow::UpdateWindow(void) const
{
return ::UpdateWindow(m_hWnd);
}

LRESULT CWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_DESTROY:
::PostQuitMessage(0);
return 0;
case WM_PAINT:
PAINTSTRUCT ps;
HDC hdc;
hdc = BeginPaint(hWnd, &ps);
RECT rt;
GetClientRect(&rt);
DrawText(hdc, "对象化的窗口", 12, &rt, DT_CENTER);
EndPaint(hWnd, &ps);
return 0;
default:
break;
}

return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
}

LRESULT CALLBACK CWindow::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
CWindow *pWindow;

if(uMsg == WM_NCCREATE){
MDICREATESTRUCT *pMDIC = (MDICREATESTRUCT *)((LPCREATESTRUCT)lParam)->lpCreateParams;
pWindow = (CWindow *)(pMDIC->lParam);

::SetWindowLong(hWnd, GWL_USERDATA, (LONG)pWindow);
}
else {
pWindow = (CWindow *)::GetWindowLong(hWnd, GWL_USERDATA);
}

// pWindow = (CWindow *)::GetWindowLong(hWnd, GWL_USERDATA);

if (pWindow)
return pWindow->WndProc(hWnd, uMsg, wParam, lParam);
else
return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
}

void CWindow::GetWndClassEx(WNDCLASSEX &wc)
{
memset(&wc, 0, sizeof(wc));

wc.cbSize = sizeof(WNDCLASSEX);
wc.style = 0;
wc.lpfnWndProc = WindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = NULL;
wc.hIcon = NULL;
wc.hCursor = ::LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)::GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = NULL;
wc.hIconSm = NULL;
}


int CWindow::MessageBox(LPCTSTR lpszText, LPCTSTR lpszCaption, UINT nType)
{
return ::MessageBox(m_hWnd, lpszText, lpszCaption, nType);
}

int CWindow::SetWindowText(LPCTSTR lpString)
{
return ::SetWindowText(m_hWnd, lpString);
}

int CWindow::GetWindowText(LPTSTR lpString, int nMaxCount)
{
return ::GetWindowText(m_hWnd, lpString, nMaxCount);
}

void CWindow::GetClientRect(LPRECT lpRect) const
{
::GetClientRect(m_hWnd, lpRect);
}

void CWindow::InvalidateRect(LPCRECT lpRect, BOOL bErase)
{
::InvalidateRect(m_hWnd, lpRect, bErase);
}




// sample.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "MCL_BASIC.cpp"


class CMyApp : public CWinApp
{
public:
virtual void initApplication(void);

public:
CWindow window;
};

void CMyApp::initApplication(void)
{
afxMainWnd = &window;
window.CreateEx(0, "window", "window", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, AfxGetInstanceHandle());
}


CMyApp app;


都可以运行,如果楼主有空间,我可以把代码传给你,让大家帮我提出不足。
消息分流我也做了,但是做的不好。暂时不贴上来,而且最近很忙,根本没时间去SDK写代码
loveghb 2005-05-19
  • 打赏
  • 举报
回复
我学VC也3个月了。把自己写的代码贴上来吧
1:用一个C++类来封装Window类,实现窗口类的注册和窗口的创建和显示。
#ifndef _MCL_BASIC
#define _MCL_BASIC

#include <windows.h>

class CWindow
{
public:
CWindow(void);
virtual ~CWindow(void);
virtual bool CreateEx(DWORD dwExStyle, LPCTSTR lpszClass, LPCTSTR lpszName,
DWORD dwStyle, int x, int y, int nWidth, int nHeight,
HWND hParent, HMENU hMenu, HINSTANCE hInst);
bool RegisterClass(LPCTSTR lpszClass, HINSTANCE hInst);
virtual WPARAM MessageLoop(void);
int ShowWindow(int nCmdShow) const;
int UpdateWindow(void) const;
virtual LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
virtual void GetWndClassEx(WNDCLASSEX &wc);
int MessageBox(LPCTSTR lpszText, LPCTSTR lpszCaption = NULL, UINT nType = MB_OK);
int SetWindowText(LPCTSTR lpString);
int GetWindowText(LPTSTR lpString, int nMaxCount);
void GetClientRect( LPRECT lpRect ) const;
void InvalidateRect( LPCRECT lpRect, BOOL bErase = TRUE );

public:
HWND m_hWnd;
WNDPROC m_OldProc;

};



#endif




#include <assert.h>
#include <string.h>
#include "StdAfx.h"
#include "MCL_BASIC.h"

//CWindow

CWindow::CWindow(void)
{
m_hWnd = NULL;
}

CWindow::~CWindow(void)
{

}

bool CWindow::CreateEx(DWORD dwExStyle, LPCTSTR lpszClass, LPCTSTR lpszName,
DWORD dwStyle, int x, int y, int nWidth, int nHeight,
HWND hParent, HMENU hMenu, HINSTANCE hInst)
{
if ( !RegisterClass(lpszClass, hInst) )
return false;

MDICREATESTRUCT mdic;
memset(&mdic, 0, sizeof(mdic));
mdic.lParam = (LPARAM)this;
m_hWnd = ::CreateWindowEx(dwExStyle, lpszClass, lpszName, dwStyle, x, y,
nWidth, nHeight, hParent, hMenu, hInst, &mdic);

return m_hWnd != NULL;
}

bool CWindow::RegisterClass(LPCTSTR lpszClass, HINSTANCE hInst)
{
WNDCLASSEX wc;

if ( !GetClassInfoEx(hInst, lpszClass, &wc) ) {
GetWndClassEx(wc);
wc.hInstance = hInst;
wc.lpszClassName = lpszClass;
if ( !::RegisterClassEx(&wc) )
return false;
}

return true;
}

WPARAM CWindow::MessageLoop(void)
{
MSG msg;

while ( ::GetMessage(&msg, NULL, 0, 0) )
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}

return msg.wParam;
}

int CWindow::ShowWindow(int nCmdShow) const
{
return ::ShowWindow(m_hWnd, nCmdShow);
}

int CWindow::UpdateWindow(void) const
{
return ::UpdateWindow(m_hWnd);
}

LRESULT CWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_DESTROY:
::PostQuitMessage(0);
return 0;
case WM_PAINT:
PAINTSTRUCT ps;
HDC hdc;
hdc = BeginPaint(hWnd, &ps);
RECT rt;
GetClientRect(&rt);
DrawText(hdc, "对象化的窗口", 12, &rt, DT_CENTER);
EndPaint(hWnd, &ps);
return 0;
default:
break;
}

return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
}

LRESULT CALLBACK CWindow::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
CWindow *pWindow;

if(uMsg == WM_NCCREATE){
MDICREATESTRUCT *pMDIC = (MDICREATESTRUCT *)((LPCREATESTRUCT)lParam)->lpCreateParams;
pWindow = (CWindow *)(pMDIC->lParam);

::SetWindowLong(hWnd, GWL_USERDATA, (LONG)pWindow);
}
else {
pWindow = (CWindow *)::GetWindowLong(hWnd, GWL_USERDATA);
}

// pWindow = (CWindow *)::GetWindowLong(hWnd, GWL_USERDATA);

if (pWindow)
return pWindow->WndProc(hWnd, uMsg, wParam, lParam);
else
return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
}

void CWindow::GetWndClassEx(WNDCLASSEX &wc)
{
memset(&wc, 0, sizeof(wc));

wc.cbSize = sizeof(WNDCLASSEX);
wc.style = 0;
wc.lpfnWndProc = WindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = NULL;
wc.hIcon = NULL;
wc.hCursor = ::LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)::GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = NULL;
wc.hIconSm = NULL;
}


int CWindow::MessageBox(LPCTSTR lpszText, LPCTSTR lpszCaption, UINT nType)
{
return ::MessageBox(m_hWnd, lpszText, lpszCaption, nType);
}

int CWindow::SetWindowText(LPCTSTR lpString)
{
return ::SetWindowText(m_hWnd, lpString);
}

int CWindow::GetWindowText(LPTSTR lpString, int nMaxCount)
{
return ::GetWindowText(m_hWnd, lpString, nMaxCount);
}

void CWindow::GetClientRect(LPRECT lpRect) const
{
::GetClientRect(m_hWnd, lpRect);
}

void CWindow::InvalidateRect(LPCRECT lpRect, BOOL bErase)
{
::InvalidateRect(m_hWnd, lpRect, bErase);
}
糊糊 2005-05-18
  • 打赏
  • 举报
回复
网站我打字打错了,是 http://wxWidgets.cn
pomelowu 2005-05-18
  • 打赏
  • 举报
回复
http://wxWindgets.cn
打不开

呵呵~~已经知道楼主的思路了。帮顶帮顶~~
糊糊 2005-05-18
  • 打赏
  • 举报
回复
欢迎wxWidgets爱好者和C++学习者加入邮件列表,为文档翻译做贡献。

16,551

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧