📄 cwindows.h
字号:
#endif //BLADE
#endif //WIN_BTN
#ifdef BASED
typedef struct _framewnd _based(pWndSeg) WND_FRAME;
#else
typedef struct _framewnd WND_FRAME;
#endif
typedef WND_FRAME *PWND_FRAME;
typedef struct _framewnd
{
WORD id;
BITS style:14;
BITS fCursorOn:1;
BITS fEnabled:1;
WORD wExtStyle;
ARC arcWindow;
ARC arcClipping;
#ifdef BROADSWORD
ARC rrcInvalid;
BYTE hbrDraw; // Color for drawing.
BYTE hbrBackGround; // Color for background.
#else
RRC rrcInvalid;
#endif
PLFN_WNDPROC pfnWndProc;
PWND pwndParent;
PWND pwndSibling;
PWND pwndChild;
#ifdef BROADSWORD
WORD pcls;
#endif
BYTE axCursor;
BYTE ayCursor;
#ifndef BROADSWORD
BYTE wndBytes; // 31 bytes
#endif
BOOL fWinActive;
char *szFrameText;
VOID **hFrameMenu;
WORD axyLastPos;
WORD rxyLastPos;
BOOL fZoomFrame;
ARC arcMenuArc; // 16 bytes
WORD wFrameHeight;
PLFN_WNDPROC pfnClientWndProc;
};
#else // Non-Blade stuff follows
typedef PWND PWND_MLE;
typedef PWND PWND_SCROLL;
typedef PWND PWND_EDIT;
typedef PWND PWND_BTN;
typedef PWND PWND_DLG;
typedef PWND PWND_GEN;
typedef PWND PWND_STATIC;
typedef PWND PWND_LIST;
typedef PWND PWND_DROP_LIST;
typedef PWND PWND_DROP;
typedef PWND PWND_FRAME;
typedef PWND PWND_DESKTOP;
typedef PWND PWND_GROUP;
#define GetWindowWord(pwnd, iw) ((pwnd)->rgwExtra[(iw)])
#define SetWindowWord(pwnd, iw, w) {(pwnd)->rgwExtra[(iw)] = (w);}
// special edit window specific isa's
#define IsaEdit(pwnd) ((pwnd)->rgwExtra[3])
#define IsaSelEdit(pwnd) ((pwnd)->rgwExtra[4])
#define IsaDisabledEdit(pwnd) ((pwnd)->rgwExtra[13])
// Common portion of all dialog windows
#define cwExtraMin 1 // at least 1 field for all items
// not used for dialog box
#define aclDialog rgwExtra[0] // dialog accelerator
// Text info for : edit, static and button controls
#define cwExtraText (cwExtraMin+2) // 2 more for text controls
#define szDialog rgwExtra[1] // also Dialog Box caption
#define cchDialog rgwExtra[2] // edit, static & buttons
// flag indicating whether EndDialog has been
// called. Used to prevent multiple calls
// to PostQuitMessage
#define wParamEnd rgwExtra[2]
// sizes of rgwExtra for the various controls
#define cwExtraDialog (cwExtraMin+2) // szDialog + wParamEnd
#define cwExtraSdmDlg (cwExtraDialog+((sizeof(SDS)+1)/2)) // ... + sds
#define cwExtraMsgBox (cwExtraDialog+1) // ... + pmbs
#define cwExtraStatic (cwExtraText) // simple text
#define cwExtraButton (cwExtraText+2) // text + button state + next radio
#define cwExtraGroup (cwExtraText+2) // text
#define cwExtraEdit (cwExtraText+11) // see sedit.h for details
#define cwExtraEditAux (cwExtraEdit+1)
#define cwExtraGeneral (cwExtraMin+3) // see general.h for details
#ifndef LISTBOX_HORIZ
#define cwExtraListBox (cwExtraMin+15) // see _listbox.h for details
#else
#define cwExtraListBox (cwExtraMin+17) // see _listbox.h for details
#endif
#define cwExtraDropDown (cwExtraMin+9) // 10
#define cwExtraDropHolder (cwExtraMin+1) // 2
#define cwExtraDropButton (cwExtraMin) // 1
#define wButton rgwExtra[cwExtraText]
// flag word for button control
#define pwndButtonNext rgwExtra[cwExtraText+1] // next radio button
//#if cwExtraButton != cwExtraText+2
//.....
//#endif
// walking the list of radio buttons
#define PwndButtonNext(pwnd) ((PWND_BTN) (pwnd)->pwndButtonNext)
// is it a (radio) button?
#define FPwndIsButton(pwnd) (((pwnd)->style & WS_TYPE) == WS_BUTTON)
#define FButtonIsRadio(pwnd) (((pwnd)->style & WS_SUBSTYLE) == BS_RADIOBUTTON)
// bits :
// 0..1 '=> bst (button state)
// 2 => fButtonDown
// 3 => first in group
//
// button states
#define bstOff 0
#define bstOn 1
#define bstGreyed 2
#define bstMax 3
// Macros for bit accesses
#define BstOfWnd(pwnd) ((pwnd)->wButton & 3)
#define SetWndBst(pwnd, bst) (pwnd)->wButton = ((pwnd)->wButton & ~(3)) | (bst)
#define FButtonDown(pwnd) ((pwnd)->wButton & 4)
#define SetFButtonDown(pwnd, fDown) \
{if (fDown) (pwnd)->wButton |= 4; \
else (pwnd)->wButton &= ~4;}
#define FFirstButton(pwnd) ((pwnd)->wButton & 8)
#define SetFFirstButton(pwnd) (pwnd)->wButton = ((pwnd)->wButton |= 8)
#define SetNextGroupButton(pwnd, pwndNext ) (pwnd)->pwndButtonNext =(pwndNext)
#define cwExtraFrame (cwExtraText + 4)
#define fWinActive rgwExtra[1]
#define szFrameText rgwExtra[2]
#define hFrameMenu rgwExtra[3]
#define axyLastPos rgwExtra[4]
#define rxyLastPos rgwExtra[5]
#define fZoomFrame rgwExtra[6]
#define arcMenuArc rgwExtra[7]
// General window stuff
#define PwfnCtlGeneral(pwnd) (*((PWFN_CTL *) &pwnd->rgwExtra[cwExtraMin]))
#define WParamGeneral(pwnd) (pwnd->rgwExtra[cwExtraMin+2])
//#if cwExtraGeneral != cwExtraMin+3
//.....
//#endif
// General window stuff
//listbox stuff
// customization
// extra word usage
// 0,1,2 are listbox function and wParam (for on-demand)
#define iszTopLb rgwExtra[cwExtraMin+3] // first item in Display
#define cszLb rgwExtra[cwExtraMin+4] // # of strings in list in list
#define iszCurLb rgwExtra[cwExtraMin+5] // currently selected item
#define hmemMpiszoffLb rgwExtra[cwExtraMin+6] // array of offsets in string buffer
#define hmemGpszLb rgwExtra[cwExtraMin+7] // string buffer pool
#define offLb rgwExtra[cwExtraMin+8] // next string buffer pointer
#define offMaxLb rgwExtra[cwExtraMin+9] // size of string buffer
#define iszMacLb rgwExtra[cwExtraMin+10] // max isz before index buf is grown
#define fSelectedLb rgwExtra[cwExtraMin+11] // do we have a selection ?
#define isaColor rgwExtra[cwExtraMin+12] // colour of the listbox
#define isaHiliteColor rgwExtra[cwExtraMin+13] // colour of the listbox hilite
#define ctickRepLb rgwExtra[cwExtraMin+14] // scrolling rate
#ifndef LISTBOX_HORIZ
#define cwExtraNeeded (cwExtraMin+15)
#else
// Horizontal scrolling extra info
#define drxItemLb rgwExtra[cwExtraMin+15] // width of a single item (add 1 for space)
#define citemWidthLb rgwExtra[cwExtraMin+16] // max # of items wide
#define cwExtraNeeded (cwExtraMin+17)
#endif
//#if cwExtraListBox != cwExtraNeeded
//.....
//#endif
#define PwfnCtlLb(pwnd) (*((PWFN_CTL *) &pwnd->rgwExtra[cwExtraMin]))
#define WParamLb(pwnd) (pwnd->rgwExtra[cwExtraMin+2])
// special listbox window specific isa's
#define IsaListbox(pwnd) ((pwnd)->rgwExtra[13])
#define IsaHiliteListbox(pwnd) ((pwnd)->rgwExtra[14])
//listbox stuff
//Scrollbar defs
#define cwExtraScroll 5 // size of rgwExtra for scroll windows
// scroll bar definitions
#define ctickRepSb rgwExtra[0] // # of ticks to repeat
#define ptCurSb rgwExtra[1] // current position on scroll line
#define ptMinSb rgwExtra[2] // minimum position on scroll line
#define ptMaxSb rgwExtra[3] // end position on scroll line
#define ptElevatorSb rgwExtra[4] // elevator position (lower byte)
//Scrollbar defs
//Editbox defs
// extra word usage (filled by SDM)
#define isaEb rgwExtra[cwExtraText+0] // color
#define isaSelEb rgwExtra[cwExtraText+1] // selected color
#define chFillDialog rgwExtra[cwExtraText+2] // fill char for trailing spaces
#define ichMacEb rgwExtra[cwExtraText+3] // last character in edit buffer
#define ichLeftEb rgwExtra[cwExtraText+4] // leftmost character displayed
#define ichCursorEb rgwExtra[cwExtraText+5] // current cursor position, to the left of
// insertion point
#define ichSelEb rgwExtra[cwExtraText+6] // start of selection
#define fNoBracketEb rgwExtra[cwExtraText+7] // don't show brackets ??
#define wEb rgwExtra[cwExtraText+8] // random flags
#define cchMaxEb rgwExtra[cwExtraText+9] // for fixed length edit items
#define isaDisabledEb rgwExtra[cwExtraText+10]// disabled color
#define szWildCardEb rgwExtra[cwExtraText+11] // auxilary edit field
//#if cwExtraEdit != cwExtraText+11
//.....
//#endif
//#if cwExtraEditAux != cwExtraText+12
//.....
//#endif
//Editbox defs
// Message box defs
// this structure is defined only so that C will allocate enough extra
// words in the msg box window structures put on the stack
typedef struct _wndm
{
WND wnd;
WORD rgwExtraPlus[cwExtraMsgBox-1];
} WNDM;
// message box state
#define pmbsDialog rgwExtra[cwExtraDialog]
// Message box defs
// Dropdown defs
// dropdown rgwExtra aliases
#define wDropFlags rgwExtra[cwExtraMin]
#define pwndDropListBox rgwExtra[cwExtraMin+1]
#define pwndDropButton rgwExtra[cwExtraMin+2]
#define pwndDropEdit rgwExtra[cwExtraMin+3]
#define pwndDropHolder rgwExtra[cwExtraMin+4]
#define pfnDropListBoxProc rgwExtra[cwExtraMin+5] // actually two words
#define pfnDropEditProc rgwExtra[cwExtraMin+7] // actually two words
#define PwndDropListBox(pwnd) (*(PWND*)&((pwnd)->pwndDropListBox))
#define PwndDropButton(pwnd) (*(PWND*)&((pwnd)->pwndDropButton))
#define PwndDropEdit(pwnd) (*(PWND*)&((pwnd)->pwndDropEdit))
#define PwndDropHolder(pwnd) (*(PWND*)&((pwnd)->pwndDropHolder))
#define PfnDropListBoxProc(pwnd) (*(PLFN_WNDPROC*)&((pwnd)->pfnDropListBoxProc))
#define PfnDropEditProc(pwnd) (*(PLFN_WNDPROC*)&((pwnd)->pfnDropEditProc))
// dropdown holding window rgwExtra aliases and macros
#define pwndHolderDrop rgwExtra[cwExtraMin]
#define PwndHolderDrop(pwnd) (*(PWND*)&((pwnd)->pwndHolderDrop))
// Dropdown defs
extern PWND_DLG pwndDlg; // Again, app should never use
#endif // BLADE
extern PWND_DESKTOP PASCAL pwndDesktop;
typedef PWND HWND;
#ifdef BLADE
typedef PWND HDC;
#define HMENU void **
typedef struct _rect
{
BYTE left;
BYTE top;
BYTE right;
BYTE bottom;
}RECT;
typedef RECT *LPRECT;
typedef RRC PAINTSTRUCT;
typedef WORD HBRUSH;
#endif
#ifdef BROADSWORD
#include <winapi.h>
#endif //BROADSWORD
// #include "wndstruc.h"
#define HEAD 0
#define TAIL 1
#ifndef NOPROCS
BOOL FARPUBLIC InitDesktop ( VOID );
DWORD FARPUBLIC DesktopWndProc(PVOID, WORD, WORD, DWORD);
VOID FARPUBLIC RemoveChild (PVOID);
VOID FARPUBLIC EnableWindow (PVOID, BOOL);
VOID FARPUBLIC SetWindowStyle (PVOID, WORD);
VOID FARPUBLIC SetWindowSize (PVOID, BYTE, BYTE);
VOID FARPUBLIC DrawWindow (PVOID);
VOID FARPUBLIC TextOut (PVOID, RX, RY, char *, short, WORD);
VOID FARPUBLIC lpTextOut(PVOID, RX, RY, char far *, short, WORD); /*OPTIONAL*/
VOID FARPUBLIC DrawBorder2 (PVOID, BOX *, WORD, WORD, char *);
VOID FARPUBLIC DrawBorderAlign (PVOID, BOX *, WORD, WORD, char *, BOOL);
VOID FARPUBLIC CharOut (PVOID, RX, RY, ACHAR, WORD);
VOID FARPUBLIC CharOutBorder (PVOID, RX, RY, ACHAR, WORD);
VOID FARPUBLIC BltRrc (PVOID, RX, RY, BYTE, BYTE, RX, RY);
VOID FARPUBLIC BltRrcTop (PVOID, RX, RY, BYTE, BYTE, RX, RY); /*OPTIONAL*/
VOID FARPUBLIC EndPaint (PVOID, VOID FAR *);
VOID FARPUBLIC DrawBox (PVOID, NPRRC, BOX *, WORD);
VOID FARPUBLIC SaveRrc (PVOID, NPRRC, BYTE FAR *);
VOID FARPUBLIC RestoreRrc (PVOID, NPRRC, BYTE FAR *);
VOID FARPUBLIC EnableCursor (PVOID, BOOL);
VOID FARPUBLIC MoveCursor (PVOID, RX, RY);
VOID FARPUBLIC MoveWindow (PVOID, AX, AY);
BOOL FARPUBLIC IntersectRect (NPRRC, NPRRC, NPRRC);
VOID FARPUBLIC UnionRect (NPRRC, NPRRC, NPRRC);
BOOL FARPUBLIC IsRectEmpty (NPRRC);
VOID FARPUBLIC SetRect (NPRRC, RX, RY, RX, RY);
BOOL FARPUBLIC PtInRect (NPRRC, RX, RY);
WORD FARPUBLIC CwSizeRrc (NPRRC);
VOID FARPUBLIC ShadowArc (NPARC);
VOID FARPUBLIC EnableOverlap (BOOL, VOID *, WORD);
VOID FARPUBLIC ReplaceChild (PVOID, PVOID); /*OPTIONAL*/
VOID FARPUBLIC DrawOverlapShadow(PVOID); /*OPTIONAL*/
VOID FARPUBLIC RedrawDamagedRegions (void); /*OPTIONAL*/
BOOL FARPUBLIC FMoveSizeWithKeyboard (PVOID, BOOL); /*OPTIONAL*/
/* Listbox routines */
DWORD FARPUBLIC ListBoxWndProc (PVOID, WORD, WORD, DWORD); /*OPTIONAL*/
VOID FARPUBLIC InitListBox (PVOID, PWFN); /*OPTIONAL*/
VOID FARPUBLIC InitListBoxOriented (PVOID, PWFN, WORD *, WORD *); /*OPTIONAL*/
VOID FARPUBLIC GetListBoxOrientation(PVOID, WORD *, WORD *); /*OPTIONAL*/
VOID FARPUBLIC SetListBoxOrientation(PVOID, WORD *, WORD *);
/* Dropdown Listbox routines */
DWORD FARPUBLIC DropDownWndProc (PVOID, WORD, WORD, DWORD); /*OPTIONAL*/
DWORD FARPUBLIC DropHolderWndProc (PVOID, WORD, WORD, DWORD); /*OPTIONAL*/
DWORD FARPUBLIC DropListBoxWndProc (PVOID, WORD, WORD, DWORD); /*OPTIONAL*/
DWORD FARPUBLIC DropEditWndProc (PVOID, WORD, WORD, DWORD); /*OPTIONAL*/
DWORD FARPUBLIC DropButtonWndProc (PVOID, WORD, WORD, DWORD); /*OPTIONAL*/
VOID FARPUBLIC AddDropWindow (PVOID, PVOID, PVOID, PVOID, PVOID, PVOID, BOOL); /*OPTIONAL*/
VOID FARPUBLIC RemoveDropWindow (PVOID); /*OPTIONAL*/
DWORD FARPUBLIC ButtonWndProc (PVOID, WORD, WORD, DWORD); /*OPTIONAL*/
DWORD FARPUBLIC StaticWndProc (PVOID, WORD, WORD, DWORD); /*OPTIONAL*/
DWORD FARPUBLIC ScrollBarWndProc(PVOID, WORD, WORD, DWORD); /*OPTIONAL*/
DWORD FARPUBLIC InternalEditWndProc(PVOID, WORD, WORD, DWORD); /*OPTIONAL*/
BOOL FARPUBLIC RectEqual( NPRRC, NPRRC ); /*OPTIONAL*/
VOID FARPUBLIC EnumListBoxEntries ( PVOID, PWFN_ENUM ); /*OPTIONAL*/
VOID FARPUBLIC DrawTextJustified ( PVOID, char *, WORD, WORD, NPRRC ); /*OPTIONAL*/
VOID FARPUBLIC SetSeg ( VOID ); /*OPTIONAL*/
VOID FARPUBLIC DrawBoxText ( VOID *, AX, AX, AX ); /*OPTIONAL*/
VOID FARPUBLIC DrawBorderAlign3D ( PVOID, WORD, WORD, char *, BOOL, BOOL, WORD, WORD ); /*OPTIONAL*/
PWND FARPUBLIC TreeToTop ( PVOID ); /*OPTIONAL*/
#ifdef BLADE
PWND FARPUBLIC CreateWindow ( WORD, char *, WORD, WORD, WORD,WORD,WORD,WORD, PVOID, HMENU, LPSTR, WORD ); /*OPTIONAL*/
BOOL FARPUBLIC DestroyWindow ( PVOID ); /*OPTIONAL*/
BOOL FARPUBLIC RegisterWindows( VOID ); /*OPTIONAL*/
DWORD FARPUBLIC FrameWndProc(PVOID, WORD, WORD, DWORD); /*OPTIONAL*/
PWND FARPUBLIC WindowFromID ( PVOID,WORD ); /*OPTIONAL*/
DWORD FARPUBLIC DefDlgProc (PVOID, WORD, WORD, DWORD); /*OPTIONAL*/
VOID FARPUBLIC SiblingToTop (PVOID, BOOL); /*OPTIONAL*/
VOID FARPUBLIC DirtyShadow ( PVOID, ARC);
DWORD FARPUBLIC DlgDirWndProc ( PVOID, WORD, WORD, DWORD ); /*OPTIONAL*/
BOOL FARPUBLIC ShowWindow ( PVOID, WORD, BOOL ); /*OPTIONAL*/
VOID FARPUBLIC SetWindowText ( PVOID, char * ); /*OPTIONAL*/
WORD FARPUBLIC GetWindowText ( PVOID, char *, WORD ); /*OPTIONAL*/
WORD FARPUBLIC GetWindowTextLength ( PVOID ); /*OPTIONAL*/
DWORD FARPUBLIC GroupWndProc(PVOID, WORD, WORD, DWORD); /*OPTIONAL*/
PWND FARPUBLIC InternalWindowFromID ( PVOID, WORD ); /*OPTIONAL*/
VOID FARPUBLIC AddAChild(PVOID, PVOID, WORD); /*OPTIONAL*/
LONG FAR PASCAL DefWindowProc ( PVOID,WORD,WORD,DWORD ); /*OPTIONAL*/
#ifndef BROADSWORD //BLADE and NOT BROADSWORD def's.
/**** BLADE and NOT BROADSWORD def's. ****************/
WORD FARPUBLIC GetWindowWord ( PVOID, WORD ); /*OPTIONAL*/
WORD FARPUBLIC SetWindowWord ( PVOID, WORD, WORD ); /*OPTIONAL*/
BOOL FARPUBLIC RegisterClass ( WORD, WORD, WORD, WORD, WORD, PLFN_WNDPROC ); /*OPTIONAL*/
BOOL FARPUBLIC UnregisterClass ( WORD, HANDLE ); /*OPTIONAL*/
PWNDCLASS FARPUBLIC FindClass ( WORD ); /*OPTIONAL*/
#ifndef DATA_HANDLE
PWND FARPUBLIC CreateDlgDirCombo ( PVOID, PVOID, PVOID, PVOID, PVOID, char * );/*OPTIONAL*/
#else
PWND FARPUBLIC CreateDlgDirCombo ( PVOID, PVOID, PVOID, PVOID, PVOID, WORD ); /*OPTIONAL*/
#endif
#endif
#else // Non-Blade def's.
VOID FARPUBL
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -