This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*-coding: utf8 -*- | |
import win32gui | |
import win32process | |
import win32con | |
import win32api | |
from ctypes import * | |
# 雷区最大行列数 | |
MAX_ROWS = 24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LPCTSTR GetLastErrorMessage() | |
{ | |
static TCHAR buffer[MAX_PATH+1]; | |
DWORD errCode = GetLastError(); | |
TCHAR *err; | |
if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, | |
NULL, errCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // default language | |
(LPTSTR) &err, 0, NULL)) | |
return _T(""); | |
_tcsncpy (buffer, err, MAX_PATH); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LRESULT CALLBACK WindowProcXP (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | |
{ | |
//TRACKMOUSEEVENT Tme; | |
static HWND hWndPrevious = NULL; | |
switch (uMsg) | |
{ | |
case WM_MOUSEMOVE: | |
// | |
//Tme.cbSize = sizeof (TRACKMOUSEEVENT); | |
//Tme.dwFlags = TME_LEAVE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///////////////////////////////////////////////////////////////////////////// | |
// CSeparator message handlers | |
// http://www.codeproject.com/Articles/77/Enhanced-Line-Drawing-Class-with-Text | |
// This function draws the horizontal line, followed by the text. The general | |
// idea for the line drawing comes from Hans Buehler's article at | |
// http://www.codeguru.com/staticctrl/draw_bevel.shtml | |
// | |
// Note that this class is intended to be just a simple separator, so the | |
// only static styles I implement here are SS_LEFT, SS_CENTER, SS_RIGHT, and | |
// SS_NOPREFIX. Also note that the line is always drawn vertically centered |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 摘自:Programming Windows Embedded CE 6.0 Developer Reference | |
// 作者:Douglas Boling | |
// HelloCE.cpp | |
// —————————————————————————————————————— | |
//================================================================== | |
// HelloCE - A simple application for Windows CE | |
// Written for the book Programming Windows CE | |
// Copyright (C) 2007 Douglas Boling | |
//================================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stdafx.h" | |
#include "toclip.h" | |
/**************************************************************** | |
* toClipboard | |
* Inputs: | |
* CWnd * wnd: Window whose contents are to be sent | |
* to the clipboard | |
* BOOL FullWnd: TRUE for entire window, | |
* FALSE for client area | |
* Result: void |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void SaveDIBitmap(CDC* dc, const CRect& rcSave, LPCSTR filename) | |
{ | |
int nWidth = rcSave.Width(); | |
int nHeight = rcSave.Height(); | |
int nBitCount = 24; | |
int nWidthBytes = ((nWidth * (nBitCount>>3) + 3) >> 2) << 2; | |
HDC hMemDC = ::CreateCompatibleDC(dc->m_hDC); | |
BITMAPINFO bminfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void EnumerateBits(LPBYTE pBits, int nBitCount, int nWidth, int nHeight) | |
{ | |
int nPixels = nWidth * nHeight; | |
WORD wByteCount = nBitCount / 8; | |
if(wByteCount == 0) | |
wByteCount = 1; | |
int nBytes = nPixels * wByteCount; | |
for(int i = 0; i < nBytes; i += wByteCount) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#ifdef __BORLANDC__ | |
#pragma argsused | |
#endif | |
//--------------------------------------------------------------------------- | |
const char *ClsName = "WndProperties"; | |
const char *WndName = "Popup Window"; | |
//--------------------------------------------------------------------------- | |
LRESULT CALLBACK WndProcedure(HWND hWnd, UINT uMsg, | |
WPARAM wParam, LPARAM lParam); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> |
NewerOlder