2012年(158)
分类: C/C++
2012-11-23 15:27:25
网友评论2012-11-23 15:31:26
周星星
#include <windows.h>
int main( void )
{
HWND hwnd = ::GetDesktopWindow();
HDC hdc = ::GetWindowDC(hwnd);
// 红,间隔透明
HPEN hpen1 = CreatePen( PS_DASH, 1, RGB(255,0,0) );
HGDIOBJ hPrePen = SelectObject( hdc, hpen1 );
int hPreMode = SetBkMode( hdc, TRANSPARENT );
MoveToEx( hdc, 0,10, NULL );
Line
网友评论2012-11-23 15:31:14
周星星
#include <windows.h>
#include <tchar.h>
#include <commctrl.h>
#pragma comment(lib,"comctl32.lib")
#include "resource.h"
LPCTSTR szTitle = TEXT("CPP22");
LPCTSTR szWindowClass = TEXT("CPP22");
HINSTANCE hInst;
HWND m_hwndTree;
HIMAGELIST m_hilTree;
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int __stdcall _tWin
网友评论2012-11-23 15:30:57
周星星
#include <windows.h>
DWORD FileCompare( LPCTSTR fn1, LPCTSTR fn2, BOOL& bOutput )
{
// 未做的优化步骤:将文件名转为绝对路径,再转为长文件名,比较两文件名是否相同,如果相同直接返回
HANDLE hFile1=INVALID_HANDLE_VALUE, hFile2=INVALID_HANDLE_VALUE;
__int64 qwLen1=0, qwLen2=0;
DWORD dwAG;
HANDLE hFileMapping1=NULL, hFileMapping2=NULL;
LPVOID lp1=NULL, lp2=NULL;
&n
网友评论2012-11-23 15:30:33
周星星
#define _WIN32_WINNT 0x0501
#include <windows.h>
#pragma comment( lib, "Msimg32" )
void MyFill( HDC hdc, const RECT& rt, COLORREF c1, COLORREF c2 )
{
TRIVERTEX rcVertex[2] = { {rt.left,rt.top,GetRValue(c1)<<8,GetGValue(c1)<<8,GetBValue(c1)<<8,0}, {rt.right,rt.bottom,GetRValue(c2)<<8,GetGValue(c2)<<8,GetBValue(c2)<<8,0} };
GRADIENT_RECT grect[1] = { {0,