通常在要绑定变量的编辑框控件上右键添加变量就可以。 绑定变量分value和control两种,value是赋值用的,control是控制用的。 对于编辑框的赋值,共分几种方法 1. 不用绑定变量的方法 GetDlgItem(IDC_EDIT1)->GetWindowText(变量); 如果是数组->GetWindowText(数组名,长度) GetDlgItem(IDC_EDIT1)->SetWindowText(变量); 2. 绑的是value型变量
Browsing the archives for the vc tag
The LoadIcon function loads the specified icon resource from the executable (.exe) file associated with an application instance.
Note This function hase been superseded by the LoadImage function.
Syntax
HICON LoadIcon(
HINSTANCE hInstance,
LPCTSTR lpIconName
);
Parameters
在vc2005中,调用setwindowtext时,第二个参数用char[]会出错,建议使用TCHAR,因为vc2005默认为unicode。
如果是Unicode编程的话建议你使用TCHAR(16位w_char),不要用char,实际上是不是Unicode编程都好,使用TCHAR是个好习惯。 如果你想转换到Unicode的话可以用,MultiByteToWideChar函数。
The WNDCLASSEX structure contains window class information. It is used with the RegisterClassEx and GetClassInfoEx functions.
//WNDCLASSEX结构包含了window 类信息。 它被RegisterClassEx 和GetClassInfoEx函数所使用。
The WNDCLASSEX structure is similar to the WNDCLASS structure.
There are two differences. WNDCLASSEX includes the cbSize member,which specifies the size of the structure, and the hIconSm member,which contains a handle to a small icon associated with the window class.
BOOL ShowWindow( int nCmdShow ) throw(); Example //The following example attaches an HWND to the CWindow object and //calls CWindow::ShowWindow() to show the window in its maximized state CWindow myWindow; myWindow.Attach(hWnd); myWindow.ShowWindow(SW_SHOWMAXIMIZED); Requirements Header: atlwin.h
一、关于MessageBox
消息框是个很常用的控件,属性比较多,本文列出了它的一些常用方法,及指出了它的一些应用场合。
1.MessageBox("这是一个最简单的消息框!");
2.MessageBox("这是一个有标题的消息框!","标题");
3.MessageBox("这是一个确定 取消的消息框!","标题", MB_OKCANCEL );
4.MessageBox("这是一个警告的消息框!","标题", MB_ICONEXCLAMATION );
5.MessageBox("这是一个两种属性的消息框!","标题", MB_ICONEXCLAMATION|MB_OKCANCEL );
6.if(MessageBox("一种常用的应用","标题",MB_ICONEXCLAMATION|MB_OKCANCEL)==IDCANCEL)
return;
Windows使用两种字符集ANSI和UNICODE, 前者就是通常使用的单字节方式,但这种方式处理象中文这样的双字节字符不方便,容易出现半个汉字的情况。 而后者是双字节方式,方便处理双字节字符。 Windows NT的所有与字符有关的函数都提供两种方式的版本,而Windows 9x只支持ANSI方式。_T一般同字常数相关,如_T("Hello")。如果你编译一个程序为ANSI方式,_T实际不起任何作用。 而如果编译一个程序为UNICODE方式,则编译器会把"Hello"字符串以UNICODE方式保存。 _T()和_L()的区别在于,_L不管你是以什么方式编译,一律以以 UNICODE方式保存
今天发现微软已经提供了专业版的试用版, 换个号就可以变正式版了。需要的朋友就下载了。 http://download.microsoft.com/do ... rialCHSX1435983.iso 序列号:XMQ2Y-4T3V6-XJ48Y-D3K2V-6C4WT Visual Studio 2008简体中文试用版(90天)变成永久正式版的两种方法: 法一、先安装试用版,然后在“添加或删除程序”里找到VS2008,点“更改/删除”就会看到一个输入序列号的地方,把序列号输进去,点“升级”按钮即可,Team Suite和Professional通用。 法二、把安装盘下Setupsetup.sdb文件中的[Product Key]项中对应的序列号更改为正式版的序列号后再安装即可。此方法需要重新打包。 因为九十天试用版本已经是rtm版本。所以改变序列号以后的升级或者安装,就会变成正式版,不再有使用期限。
Windows GDI
WM_PAINT
The WM_PAINT message is sent when the system or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage function when the application obtains a WM_PAINT message by using the GetMessage or PeekMessage function.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_PAINT
WPARAM wParam, // not used
LPARAM lParam // not used
);
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Values
An application returns zero if it processes this message.
The TextOut function writes a character string at the specified location, using the currently selected font, background color, and text color.
BOOL TextOut(
HDC hdc, // handle to DC
int nXStart, // x-coordinate of starting position
int nYStart, // y-coordinate of starting position
LPCTSTR lpString, // character string
int cbString // number of characters
);
Parameters
hdc
[in] Handle to the device context.
nXStart
[in] Specifies the x-coordinate, in logical coordinates, of the reference point that the system uses to align the string.
nYStart
[in] Specifies the y-coordinate, in logical coordinates, of the reference point that the system uses to align the string.
lpString
[in] Pointer to the string to be drawn. The string does not need to be zero-terminated, since cbString specifies the length of the string.
cbString
[in] Specifies the length of the string pointed to by lpString.Windows 95/98/Me: This value may not exceed 8192.