SETGET_FUNCTION 替代 get set 函数
admin | C++ | 2015-03-24
C++
#define SETGET_FUNCTION(type, set_fuctionname, get_fuctionname) \
public: \
const type get_fuctionname(){ return m_##get_fuctionname; } \
void set_fuctionname(const type newValue){ m_##get_fuctionname= newValue; } \
private: \
type m_##get_fuctionname; \
123456... [阅读全文]
win32 设置本地ICON
admin | win32 | 2015-03-16
C++
//设置本地icon 图像为程序ICON
HICON t = (HICON) LoadImage( NULL,g_IconName,IMAGE_ICON,0,0,LR_LOADFROMFILE|LR_DEFAULTSIZE|LR_SHARED);
SendMessage(g_pFrame->GetHWND(), WM_SETICON, ICON_SMALL, (LPARAM)t);
SendMessage(g_pFrame->GetHWND(), WM_SETICON, ICON_BIG, (LPARAM)t);
... [阅读全文]
Mac OS下Android Studio的Java not found问题
admin | andriod | 2015-02-14
Android Studio正式版已经发布一段时间了,使用Mac版的Android Studio可能与遇到Java not found:Android Studio was unable to find a valid JVM问题。 解决这个问题: 首先要确定mac系统上有没有安装jdk,并查看自己的jdk版本,可以在终端上输入命令 java -version查看。如果没有安装jdk请先安装jdk,安装方法就不多说了,可以去Oracle官网上下载安装... [阅读全文]
手机号匹配
admin | 正则 | 2015-02-11
C++
/^((1[3,5,8][0-9])|(14[5,7])|(17[0,6,7,8]))\d{8}$/
1
/^((1[3,5,8][0-9])|(14[5,7])|(17[0,6,7,8]))\d{8}$/
C++
^13[0-9]{9}|15[012356789][0-9]{8}|18[0-9]{9}|14[579][0-9]{8}|17[0-9]{9}$
1
... [阅读全文]
Coding for High-DPI Displays in Windows
admin | win32 | 2015-02-03
Deliver crisp text and images on all Windows monitors, regardless of settings.
In the first article in this two-part series on coding for high-DPI displays on the Windows desktop, I explained high-DPI configurations in Windows 8.1 and their effect on the three different kinds of applications: DPI-unaware, system-DPI aware, a... [阅读全文]
查询端口是否被占用,并找出占用端口的进程
admin | Windows api | 2015-01-29
windows下的一个查询端口是否被占用的函数,若端口被占用,则输出占用该端口的进程。
检测TCP端口占用状态的函数
C++
bool CheckPortState( IN unsigned num)
{
PMIB_TCPTABLE_OWNER_PID pTcpTable;
pTcpTable = new MIB_TCPTABLE_OWNER_PID;
//获取所需要的内存大小
DWORD tmpSize = sizeof(MIB_TC... [阅读全文]
查询CPU的个数
admin | win32 | 2015-01-29
C++
void ShowProcessors()
{
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION pbuffer = NULL;
DWORD dwSize = 0;
DWORD procCoreCount;
BOOL bResult = GetLogicalProcessorInformation(pbuffer, &dwSize);
if(GetLastError() != ERROR_INSUFFICIENT_BUFFER)
{
_tprintf(TEXT("Impos... [阅读全文]
禁用USB win32
admin | win32 | 2015-01-29
C++
#include "stdafx.h"
#include <iostream>
#include <initguid.h>
#include <windows.h>
#include <setupapi.h>
#include <usbiodef.h>
#include <Usbioctl.h>
#include <cfgmgr32.h>
#include <cstring>
#include <stdlib.h>
#include <malloc.h>... [阅读全文]
用WinInet远程下载文件的示例代码
admin | net work | 2015-01-29
C++
#include<windows.h>
#include<wininet.h>
#include<iostream>
#include <tchar.h>
using namespace std;
#pragma comment(lib,"wininet.lib")
void main()
{
DWORD byteread=0;
char buffer[100];
memset(buffer,0,100);
HINTERNET inte... [阅读全文]
c++获取电驴首页推荐 示例代码
C++
/*******************************************************************************
* @file
* @author def< qq group: 324164944 >
* @blog http://www.cnblogs.com/itdef/
* @brief
/*******************************************************************************/
... [阅读全文]