摘要:
#include#includeusing namespace std;class Parents{ public: virtual void vir_func(char a='x',char b='y',char c='z'); //虚函数 Parents(... 阅读全文
摘要:
#include#includeusing namespace std;class Parents{ public: virtual void Pure_vir_func() = 0; //纯虚函数 void Work(); void Run(... 阅读全文
只有注册用户登录后才能阅读该文。 阅读全文
摘要:
#include <stdio.h>#include <windows.h>#define MAX 128int main(int argc, char* argv[]) { // 根键、子键名称、和到子键的句柄 HKEY hRoot = HKEY_LOCAL_MACHINE; char *szSubKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Run"; HKEY hKey; // 打开指定子键 DWORD dwDisposition = REG_OPENED_EXISTING_KEY; 阅读全文
摘要:
#include <stdio.h>#include <stdlib.h>#include <string.h>#define MAX 10int main(int argc, char* argv[]){ int count=0; int i; char temp[64]="192.168.1."; char arr[4]; char szIP[MAX][32]; for(i=0;i<MAX;i++) { memset(arr,0,4); strcpy(temp,"192.168.1."); itoa(i+.. 阅读全文
摘要:
#include <windows.h>#include "resource.h"#define IDT_TIMER 3000BOOL __stdcall DlgProc(HWND, UINT, WPARAM, LPARAM);int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int){ int nResult = ::DialogBoxParam( hInstance, // 实例句柄 (LPCTSTR)IDD_MAIN, // 对话框资源ID号 NU... 阅读全文
摘要:
#include <windows.h>#include "resource.h"BOOL __stdcall DlgProc(HWND, UINT, WPARAM, LPARAM);HICON g_hIcon; // 对话框图标句柄int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int){ /*从资源中加载图标,这些工作也可以在WM_INITDIALOG消息中进行*/ g_hIcon = ::LoadIcon(hInstance, (LPCTSTR)IDI_MAIN); int nRes 阅读全文
摘要:
case IDC_RADIO: { char sz[256]="选中了单选框Radio"; static int i=0; i++; // 是否选中单选按钮 UINT bChecked = ::IsDlgButtonChecked(hDlg, IDC_RADIO); //选中并且是第i次单击时 (i=1,3,5,7...) if(BST_CHECKED==bChecked&&(i%2==1... 阅读全文
摘要:
//WM_CREATE消息里创建:::CreateWindowEx(0, "button", "radio button", WS_CHILD|WS_VISIBLE|BS_RADIOBUTTON,50, 350, 110, 30, hwnd, (HMENU)ID_RADIO, GetModuleHandle(NULL), NULL);//选中时响应 case ID_RADIO: { // 是否选中单选按钮 BOOL bChecked = ::IsDlgButtonChecked(hwnd, ID_RADIO); ... 阅读全文
摘要:
在窗口回调函数MainWndProc里添加:case WM_SYSKEYDOWN: { if(LOWORD(wParam)==VK_F4) return 0; }键盘虚拟码对照表:http://www.cnblogs.com/del/archive/2007/12/07/987364.html 阅读全文