?? winapi.h
字號:
/*******************************************************************************
CW: Character Windows
winapi.h : Windows compatible API's.
21-May-91 MWP : Created. For inclusion in BROADSWORD only.
******************************************************************************/
#ifdef BROADSWORD
typedef unsigned short HANDLE;
typedef unsigned short HMODULE;
// The following code is intended to provide mapping between Windows and
// CW constructs.
// For Windows compatability, we need a HDC type. For CW, DC's don't
// really exist, so we use the PWND instead.
typedef WORD HICON;
typedef WORD HCURSOR;
typedef struct _point
{
int x;
int y;
} POINT;
typedef POINT *PPOINT;
typedef POINT NEAR *NPOINT;
typedef POINT FAR *LPPOINT;
typedef DWORD COLORREF;
#define RGB(r,g,b) ((DWORD)(((BYTE)(r) | ((WORD)((g) & 0xffL ) << 8) ) | (((DWORD)(BYTE)((b) & 0xffL))<<16)))
#define GetRValue(rgb) ((BYTE)(rgb))
#define GetGValue(rgb) ((BYTE)(((WORD)(rgb)) >> 8))
#define GetBValue(rgb) ((BYTE)((rgb)>>16))
typedef struct tagCREATESTRUCT
{
LPSTR lpCreateParams;
HANDLE hInstance;
HANDLE hMenu;
HWND hwndParent;
int cy;
int cx;
int y;
int x;
WORD style;
LPSTR lpszName;
LPSTR lpszClass;
WORD dwExStyle;
} CREATESTRUCT;
typedef CREATESTRUCT FAR *LPCREATESTRUCT;
#ifndef NOSCROLL
// Scroll Bar Constants
#define SB_HORZ 0
#define SB_VERT 1
#define SB_CTL 2
#define SB_BOTH 3
#endif
#ifndef NOSYSMETRICS
/* GetSystemMetrics() codes */
#define SM_CXSCREEN 0
#define SM_CYSCREEN 1
#define SM_CXVSCROLL 2
#define SM_CYHSCROLL 3
#define SM_CYCAPTION 4
#define SM_CXBORDER 5
#define SM_CYBORDER 6
#define SM_CXDLGFRAME 7
#define SM_CYDLGFRAME 8
#define SM_CYVTHUMB 9
#define SM_CXHTHUMB 10
#define SM_CXICON 11
#define SM_CYICON 12
#define SM_CXCURSOR 13
#define SM_CYCURSOR 14
#define SM_CYMENU 15
#define SM_CXFULLSCREEN 16
#define SM_CYFULLSCREEN 17
#define SM_CYKANJIWINDOW 18
#define SM_MOUSEPRESENT 19
#define SM_CYVSCROLL 20
#define SM_CXHSCROLL 21
#define SM_DEBUG 22
#define SM_SWAPBUTTON 23
#define SM_RESERVED1 24
#define SM_RESERVED2 25
#define SM_RESERVED3 26
#define SM_RESERVED4 27
#define SM_CXMIN 28
#define SM_CYMIN 29
#define SM_CXSIZE 30
#define SM_CYSIZE 31
#define SM_CXFRAME 32
#define SM_CYFRAME 33
#define SM_CXMINTRACK 34
#define SM_CYMINTRACK 35
#define SM_CMETRICS 36
int FAR PASCAL GetSystemMetrics(int);
#endif /* NOSYSMETRICS */
/************
#define SM_CXSCREEN 80 // (VideoInfo.width)
#define SM_CYSCREEN 25 // (VideoInfo.length)
#define SM_MOUSEPRESENT TRUE // (IsMouseInstalled())
#define SM_RESTOREDIR FALSE // (bRestoreDirectory)
#define SM_CXVSCROLL 1
#define SM_CYHSCROLL 1
#define SM_CYCAPTION 1
#define SM_CXBORDER 1
#define SM_CYBORDER 1
#define SM_CXDLGFRAME 1
#define SM_CYDLGFRAME 1
#define SM_CYVTHUMB 1
#define SM_CXHTHUMB 1
#define SM_CXICON 8
#define SM_CYICON 4
#define SM_CXCURSOR 1
#define SM_CYCURSOR 1
#define SM_CYMENU 1
#define SM_CXFULLSCREEN SM_CXSCREEN
#define SM_CYFULLSCREEN SM_CYSCREEN-SM_CYMENU
#define SM_CYKANJIWINDOW SM_CYSCREEN
#define SM_CYVSCROLL 1
#define SM_CXHSCROLL 1
#define SM_DEBUG 0
#define SM_SWAPBUTTON 0
#define SM_CXMIN 1
#define SM_CYMIN 1
#define SM_CXSIZE 1
#define SM_CYSIZE 1
#define SM_CXFRAME 1
#define SM_CYFRAME 1
#define SM_CXMINTRACK 1
#define SM_CYMINTRACK 1
#define SM_RESERVED1 24
#define SM_RESERVED2 25
#define SM_RESERVED3 26
#define SM_RESERVED4 27
*************/
#define GetSystemMetrics(x) (x)
#define OLD_API 1
#define CW_USEDEFAULT 0xffff
// A whole wack of Edit stuff.
#define WM_CLEAR 0x800b
#define WM_UNDO 0x800c
#define WM_SYSCOMMAND 0x800d
#ifdef FULL_EDIT
/* Edit Control Styles */
#define ES_LEFT 0x0000
#define ES_CENTER 0x0001
#define ES_RIGHT 0x0002
#define ES_MULTILINE 0x0004
#define ES_UPPERCASE 0x0008
#define ES_LOWERCASE 0x0010
#define ES_PASSWORD 0x0001
#define ES_AUTOVSCROLL 0x0002
#define ES_AUTOHSCROLL 0x0004
#define ES_NOHIDESEL 0x0008
// #define ES_OEMCONVERT 0x0010
/* Edit Control Notification Codes */
#define EN_SETFOCUS 0x0100
#define EN_KILLFOCUS 0x0200
#define EN_CHANGE 0x0300
#define EN_UPDATE 0x0400
#define EN_ERRSPACE 0x0500
#define EN_MAXTEXT 0x0501
#define EN_HSCROLL 0x0601
#define EN_VSCROLL 0x0602
#ifndef NOWINMESSAGES
/* Edit Control Messages */
#define EM_GETSEL (WM_USER+0)
#define EM_SETSEL (WM_USER+1)
#define EM_GETRECT (WM_USER+2)
#define EM_SETRECT (WM_USER+3)
#define EM_SETRECTNP (WM_USER+4)
#define EM_SCROLL (WM_USER+5)
#define EM_LINESCROLL (WM_USER+6)
#define EM_GETMODIFY (WM_USER+8)
#define EM_SETMODIFY (WM_USER+9)
#define EM_GETLINECOUNT (WM_USER+10)
#define EM_LINEINDEX (WM_USER+11)
#define EM_SETHANDLE (WM_USER+12)
#define EM_GETHANDLE (WM_USER+13)
#define EM_GETTHUMB (WM_USER+14)
#define EM_LINELENGTH (WM_USER+17)
#define EM_REPLACESEL (WM_USER+18)
#define EM_SETFONT (WM_USER+19)
#define EM_GETLINE (WM_USER+20)
#define EM_LIMITTEXT (WM_USER+21)
#define EM_CANUNDO (WM_USER+22)
#define EM_UNDO (WM_USER+23)
#define EM_FMTLINES (WM_USER+24)
#define EM_LINEFROMCHAR (WM_USER+25)
#define EM_SETWORDBREAK (WM_USER+26)
#define EM_SETTABSTOPS (WM_USER+27)
#define EM_SETPASSWORDCHAR (WM_USER+28)
#define EM_EMPTYUNDOBUFFER (WM_USER+29)
#define EM_MSGMAX (WM_USER+30)
#endif /* NOWINMESSAGES */
typedef WORD ICH;
typedef struct tagED
{
char * hText; // Block of text we are editing
ICH cchAlloc; // Number of chars we have allocated for hText
ICH cchTextMax; // Max number bytes allowed in edit control
ICH cch; // Current number of bytes of actual text
int cLines; // Number of lines of text
BYTE charPasswordChar; // If non null, display this character instead
// of the real text. So that we can implement
// hidden text fields.
BYTE chFillDialog;
HBRUSH hbrDisabled; // Disabled color brush.
HBRUSH hbrEbBk; // Background color brush.
HBRUSH hbrHiliteText; // Hilite color brush
ICH ichMinSel; // Selection extent. MinSel is first selected char
ICH ichMaxSel; // MaxSel is first unselected character
ICH ichCaret; // Caret location. Caret is on left side of char
int iCaretLine; // The line the caret is on. So that if word
// wrapping, we can tell if the caret is at end
// of a line of at beginning of next line...
ICH screenStart; // Index of left most character displayed on
// screen for sl ec and index of top most line
// for multiline edit controls
int ichLinesOnScreen; // Number of lines we can display on screen
WORD xOffset; // x (horizontal) scroll position in pixels
// (for multiline text horizontal scroll bar)
WORD cPasswordCharWidth;// Width of password char
HWND hwnd; // Window for this edit control
RECT rcFmt; // Client rectangle
HWND hwndParent; // Parent of this edit control window
// These vars allow us to automatically scroll
// when the user holds the mouse at the bottom
// of the multiline edit control window.
POINT ptPrevMouse; // Previous point for the mouse for system timer
WORD prevKeys; // Previous key state for the mouse
WORD fSingle : 1; // Single line edit control? (or multiline)
WORD fNoRedraw : 1; // Redraw in response to a change?
WORD fMouseDown : 1; // Is mouse button down? when moving mouse
WORD fFocus : 1; // Does ec have the focus ?
WORD fDirty : 1; // Modify flag for the edit control
WORD fDisabled : 1; // Window disabled?
WORD fNonPropFont : 1; // Fixed width font?
WORD fBorder : 1; // Draw a border?
WORD fAutoVScroll : 1; // Automatically scroll vertically
WORD fAutoHScroll : 1; // Automatically scroll horizontally
WORD fNoHideSel : 1; // Hide sel when we lose focus?
WORD fKanji : 1;
WORD fFmtLines : 1; // For multiline only. Do we insert CR CR LF at word wrap breaks?
WORD fWrap : 1; // Do word wrapping?
WORD fCalcLines : 1; // Recalc ped->chLines array? (recalc line breaks? )
WORD fEatNextChar : 1; // Hack for ALT-NUMPAD stuff with combo boxes.
// If numlock is up, we want to eat the next
// character generated by the keyboard driver
// if user enter num pad ascii value...
WORD fStripCRCRLF:1; // CRCRLFs have been added to text. Strip them
// before doing any internal edit control
// stuff
WORD fInDialogBox:1; // True if the ml edit control is in a dialog
// box and we have to specially treat TABS and ENTER
int *chLines; // index of the start of each line
WORD format; // Left, center, or right justify multiline text
LPSTR (FAR *lpfnNextWord)(); // Next word function
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -