• Welcome to PlanetSquires Forums.
 

Codetips

Started by Paul Squires, August 31, 2017, 09:00:10 PM

Previous topic - Next topic

Paul Squires

Here is something that could interest one of you enterprising programmers out there.... :)

Time is always at a premium so I have not yet been able to get at the whole WinFBE Codetip support too much. What is needed is an automated program that can read the win api include files and transform them into files in some type of format that can be read by WinFBE to present the codetip for each function (and elements of any TYPE structures).

WinFBE would read the codetip files on startup. During parsing of any source code, WinFBE could determine if UNICODE is enabled so the codetips would have to present both ANSI and Unicode versions.

The output could be something like this:


''
''  Codetips definition file for WinAPI
''
''  Format:
''  1st character:  U=UNICODE, A=ANSI, B=BOTH
''  2nd character:  F=FUNCTION, T=TYPE
''  3rd character:  colon.
''  TYPE elements are separated by | pipe symbol
''

BT:RECT|left as long|top as long|right as long|bottom as long
BT:INITCOMMONCONTROLSEX|dwSize as DWORD|dwICC as DWORD
BF:InitCommonControlsEx(byval as const INITCOMMONCONTROLSEX ptr) as WINBOOL
BT:COLORSCHEME|dwSize as DWORD|clrBtnHighlight as COLORREF|clrBtnShadow as COLORREF
BF:HANDLE_WM_NOTIFY(hwnd, wParam, lParam, fn)
BF:FORWARD_WM_NOTIFY(hwnd, idFrom, pnmhdr, fn)
BT:NMTOOLTIPSCREATED|hdr as NMHDR|hwndToolTips as HWND
BT:NMCLICK|hdr as NMHDR|dwItemSpec as DWORD_PTR|dwItemData as DWORD_PTR|pt as POINT|dwHitInfo as LPARAM
BT:NMOBJECTNOTIFY|hdr as NMHDR|iItem as long|piid as const IID ptr|pObject as any ptr|hResult as HRESULT|dwFlags as DWORD
BT:NMKEY|hdr as NMHDR|nVKey as UINT|uFlags as UINT
BT:NMCHAR|hdr as NMHDR|ch as UINT|dwItemPrev as DWORD|dwItemNext as DWORD
BT:NMCUSTOMTEXT|hdr as NMHDR|hDC as HDC|lpString as LPCWSTR|nCount as long|lpRect as LPRECT|uFormat as UINT|fLink as WINBOOL
BT:NMCUSTOMDRAW|hdr as NMHDR|dwDrawStage as DWORD|hdc as HDC|rc as RECT|dwItemSpec as DWORD_PTR|uItemState as UINT|lItemlParam as LPARAM
BT:NMTTCUSTOMDRAW|nmcd as NMCUSTOMDRAW|uDrawFlags as UINT
BT:NMCUSTOMSPLITRECTINFO|hdr as NMHDR|rcClient as RECT|rcButton as RECT|rcSplit as RECT
BT:IMAGELISTDRAWPARAMS|cbSize as DWORD|himl as HIMAGELIST|i as long|hdcDst as HDC|x as long|y as long|cx as long|cy as long|xBitmap as long|yBitmap as long|rgbBk as COLORREF|rgbFg as COLORREF|fStyle as UINT|dwRop as DWORD|fState as DWORD|Frame as DWORD|crEffect as COLORREF
BF:ImageList_Create(byval cx as long, byval cy as long, byval flags as UINT, byval cInitial as long, byval cGrow as long) as HIMAGELIST
BF:ImageList_Destroy(byval himl as HIMAGELIST) as WINBOOL
BF:ImageList_GetImageCount(byval himl as HIMAGELIST) as long
BF:ImageList_SetImageCount(byval himl as HIMAGELIST, byval uNewCount as UINT) as WINBOOL
BF:ImageList_Add(byval himl as HIMAGELIST, byval hbmImage as HBITMAP, byval hbmMask as HBITMAP) as long
BF:ImageList_ReplaceIcon(byval himl as HIMAGELIST, byval i as long, byval hicon as HICON) as long
BF:ImageList_SetBkColor(byval himl as HIMAGELIST, byval clrBk as COLORREF) as COLORREF
BF:ImageList_GetBkColor(byval himl as HIMAGELIST) as COLORREF
BF:ImageList_SetOverlayImage(byval himl as HIMAGELIST, byval iImage as long, byval iOverlay as long) as WINBOOL
BF:ImageList_AddIcon(himl, hicon)
BF:ImageList_ReplaceIcon(himl, -1, hicon)
BF:ImageList_Draw(byval himl as HIMAGELIST, byval i as long, byval hdcDst as HDC, byval x as long, byval y as long, byval fStyle as UINT) as WINBOOL
BF:ImageList_Replace(byval himl as HIMAGELIST, byval i as long, byval hbmImage as HBITMAP, byval hbmMask as HBITMAP) as WINBOOL
BF:ImageList_AddMasked(byval himl as HIMAGELIST, byval hbmImage as HBITMAP, byval crMask as COLORREF) as long
BF:ImageList_DrawEx(byval himl as HIMAGELIST, byval i as long, byval hdcDst as HDC, byval x as long, byval y as long, byval dx as long, byval dy as long, byval rgbBk as COLORREF, byval rgbFg as COLORREF, byval fStyle as UINT) as WINBOOL
BF:ImageList_DrawIndirect(byval pimldp as IMAGELISTDRAWPARAMS ptr) as WINBOOL
BF:ImageList_Remove(byval himl as HIMAGELIST, byval i as long) as WINBOOL
BF:ImageList_GetIcon(byval himl as HIMAGELIST, byval i as long, byval flags as UINT) as HICON
BF:ImageList_LoadImageA(byval hi as HINSTANCE, byval lpbmp as LPCSTR, byval cx as long, byval cGrow as long, byval crMask as COLORREF, byval uType as UINT, byval uFlags as UINT) as HIMAGELIST
BF:ImageList_LoadImageW(byval hi as HINSTANCE, byval lpbmp as LPCWSTR, byval cx as long, byval cGrow as long, byval crMask as COLORREF, byval uType as UINT, byval uFlags as UINT) as HIMAGELIST
UF:ImageList_LoadImage(byval hi as HINSTANCE, byval lpbmp as LPCWSTR, byval cx as long, byval cGrow as long, byval crMask as COLORREF, byval uType as UINT, byval uFlags as UINT) as HIMAGELIST
AF:ImageList_LoadImage(byval hi as HINSTANCE, byval lpbmp as LPCSTR, byval cx as long, byval cGrow as long, byval crMask as COLORREF, byval uType as UINT, byval uFlags as UINT) as HIMAGELIST
BF:ImageList_Copy(byval himlDst as HIMAGELIST, byval iDst as long, byval himlSrc as HIMAGELIST, byval iSrc as long, byval uFlags as UINT) as WINBOOL
BF:ImageList_BeginDrag(byval himlTrack as HIMAGELIST, byval iTrack as long, byval dxHotspot as long, byval dyHotspot as long) as WINBOOL
BF:ImageList_DragEnter(byval hwndLock as HWND, byval x as long, byval y as long) as WINBOOL
BF:ImageList_DragLeave(byval hwndLock as HWND) as WINBOOL
BF:ImageList_DragMove(byval x as long, byval y as long) as WINBOOL
BF:ImageList_SetDragCursorImage(byval himlDrag as HIMAGELIST, byval iDrag as long, byval dxHotspot as long, byval dyHotspot as long) as WINBOOL
BF:ImageList_DragShowNolock(byval fShow as WINBOOL) as WINBOOL
BF:ImageList_GetDragImage(byval ppt as POINT ptr, byval pptHotspot as POINT ptr) as HIMAGELIST
BF:ImageList_RemoveAll(himl)
BF:ImageList_Remove(himl, -1)
BF:ImageList_ExtractIcon(hi, himl, i)
BF:ImageList_GetIcon(himl, i, 0)
BF:ImageList_LoadBitmap(hi, lpbmp, cx, cGrow, crMask)
BF:ImageList_LoadImage(hi, lpbmp, cx, cGrow, crMask, IMAGE_BITMAP, 0)
BF:ImageList_Read(byval pstm as LPSTREAM) as HIMAGELIST
BF:ImageList_Write(byval himl as HIMAGELIST, byval pstm as LPSTREAM) as WINBOOL
BF:ImageList_ReadEx(byval dwFlags as DWORD, byval pstm as LPSTREAM, byval riid as const IID const ptr, byval ppv as PVOID ptr) as HRESULT
BF:ImageList_WriteEx(byval himl as HIMAGELIST, byval dwFlags as DWORD, byval pstm as LPSTREAM) as HRESULT
BT:IMAGEINFO|hbmImage as HBITMAP|hbmMask as HBITMAP|Unused1 as long|Unused2 as long|rcImage as RECT
BF:ImageList_GetIconSize(byval himl as HIMAGELIST, byval cx as long ptr, byval cy as long ptr) as WINBOOL
BF:ImageList_SetIconSize(byval himl as HIMAGELIST, byval cx as long, byval cy as long) as WINBOOL
BF:ImageList_GetImageInfo(byval himl as HIMAGELIST, byval i as long, byval pImageInfo as IMAGEINFO ptr) as WINBOOL
BF:ImageList_Merge(byval himl1 as HIMAGELIST, byval i1 as long, byval himl2 as HIMAGELIST, byval i2 as long, byval dx as long, byval dy as long) as HIMAGELIST
BF:ImageList_Duplicate(byval himl as HIMAGELIST) as HIMAGELIST
BF:HIMAGELIST_QueryInterface(byval himl as HIMAGELIST, byval riid as const IID const ptr, byval ppv as any ptr ptr) as HRESULT
AT:HD_TEXTFILTERA|pszText as LPSTR|cchTextMax as INT_
UT:HD_TEXTFILTERW|pszText as LPWSTR|cchTextMax as INT_
AT:HD_ITEM|mask as UINT|cxy as long|pszText as LPSTR|hbm as HBITMAP|cchTextMax as long|fmt as long|lParam as LPARAM|iImage as long|iOrder as long|as UINT type|pvFilter as any ptr|state as UINT
UT:HD_ITEM|mask as UINT|cxy as long|pszText as LPWSTR|hbm as HBITMAP|cchTextMax as long|fmt as long|lParam as LPARAM|iImage as long|iOrder as long|as UINT type|pvFilter as any ptr|state as UINT


This is obviously a lot of work to do by hand but if it could be automated then it would be a huge victory. The problem is that the include files contain a lot of conditional defines.
 
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer