': Here is a code sample to demonstrate the functions from CATFOOD Software "RLIB.dll" ': You have to create an import library first for the RLIB.DLL ': ': Development Status : Two functions seems to work corectly ATM $main $include "windowssdk.inc" $use "rlib.lib" TYPE MBUTTON_DATA UINT dwSize INT hStatic INT hInstRes ': Identifies the instance of the module whose executable file contains the bitmap to be loaded. UINT dwImageOff UINT dwImageOn UINT dwImageClick UINT crTrans INT bTrans INT hWndTarget UINT dwCommand ENDTYPE MBUTTON_DATA pmbd TYPE ACLOCK_DATA UINT dwSize INT hStatic UINT crBack UINT crFore UINT uiUpdate FLOAT fTZ ENDTYPE ACLOCK_DATA pacd UINT hBmp0 = LoadImage(1000, @IMGBITMAP) ': Button normal state image UINT hBmp1 = LoadImage(1001, @IMGBITMAP) ': Button hot state image UINT hBmp2 = LoadImage(1002, @IMGBITMAP) ': Button pressed state image declare import,HyperlinkSubclassStatic(hnd:int),int declare import,TBitBlt(hdcDest:INT,nXDest:INT,nYDest:INT,nWidth:INT,nHeight:INT,hdcSrc:INT,nXSrc:INT,nYSrc:INT,crTrans:INT),INT DECLARE IMPORT,TStretchBlt(hdc:INT,nXOriginDest:INT,nYOriginDest:INT,nWidthDest:INT,nHeightDest:INT,hdcSrc:INT,nXOriginSrc:INT,nYOriginSrc:INT,nWidthSrc:INT,nHeightSrc:INT,crTrans:INT),INT declare import,AClockSubclassStatic(pacd:ACLOCK_DATA),int declare import,MButtonSubclassStatic(pmbd:MBUTTON_DATA),int CONST SS_NOTIFY = 0x100 const static_1 = 1 const static_2 = 2 const static_3 = 3 window mywnd OpenWindow mywnd, 0, 0, 320, 240, @NOAUTODRAW|@MINBOX|@SYSMENU, 0, "Test CatFood RLIB",&mywnd_handler SetWindowColor mywnd, RGB(240,240,240) CONTROL mywnd, @STATIC,"https://duckduckgo.com/",20,20,100,10, @TABSTOP,static_1 SETCONTROLCOLOR mywnd, static_1, RGB(192, 192, 192), RGB(240,240,240) MODIFYSTYLE (mywnd,SS_NOTIFY, 0, static_1) ': Control must have notify style to act as an hyperlink ': its text must be a url CONTROL mywnd, @STATIC,"Analog Clock",20,120,100,50, @TABSTOP,static_2 CONTROL mywnd, @STATIC,"MButton",140,120,100,20, @TABSTOP,static_3 Uint hstatic1, hstatic2, hstatic3 hstatic1 = GETCONTROLHANDLE(mywnd,static_1) hstatic2 = GETCONTROLHANDLE(mywnd,static_2) hstatic3 = GETCONTROLHANDLE(mywnd,static_3) ': ': Transform the first static control into an hyperlink ': HyperlinkSubclassStatic(hstatic1) ': ': Transform the second static control into an analog clock ': pacd.dwsize = len(pacd) pacd.hstatic = hstatic2 pacd.crback = 0x000000 ': Black pacd.crfore = 0x00FF00 ': Green pacd.uiUpdate = 5000 pacd.fTZ = 1 AClockSubclassStatic(pacd) ': ': TODO : mButton function ': don't know how to do to make it load pictures ': pmbd.dwSize = len(pmbd) pmbd.hStatic = hstatic3 pmbd.hInstRes = NULL pmbd.dwImageOff = hBmp0 pmbd.dwImageOn = hBmp1 pmbd.dwImageClick = hBmp2 pmbd.crTrans = NULL pmbd.bTrans = NULL pmbd.hWndTarget = mywnd.hwnd pmbd.dwCommand = NULL MButtonSubclassStatic(pmbd) ': ': GDI functions ': GDIMagic() WaitUntil mywnd = 0 End ': ': Main loop ': Sub mywnd_handler(), int Select @Message CASE @IDCREATE CENTERWINDOW mywnd Case @IdCloseWindow CloseWindow mywnd Case @IDCONTROL Select @CONTROLID Case 1 EndSelect EndSelect Return 0 EndSub Sub GDIMagic() ': ': We first need a bitmap to print on our window ': Let's make a new one ! ': Create an off-screen DC for double-buffering ': Int ftsize, ftweight, hdc, hdcMem, hbmMem, oldBmp, oldBrush, /*oldPen,*/ TextH, TextW String ftface, Text$ Text$ = "Transparent BitBlt Function" ': ': Set specific font ': ftface = "Verdana" ftsize = 10 ftweight = 700 SETFONT mywnd, ftface, ftsize, ftweight, 0 GETTEXTSIZE(mywnd, "A", textW, textH) ': Find the desired text Height hdc = GetDC(mywnd.hwnd) hdcMem = CreateCompatibleDC(0) hbmMem = CreateCompatibleBitmap(hdc, textW*len(Text$), textH) oldBmp = SelectObject(hdcMem, hbmMem) oldBrush = SelectObject(hdcMem, CreateSolidBrush(RGB /*(192, 192, 192)*/(255, 0, 255))) ': Pink Background oldFont = SelectObject(hdcMem, CreateFont(textH,0,0,0,ftweight, 0,0,0,0,0,0,0,0, ftface)) SetTextColor(hdcMem, RGB (0,0,0)) ': Black Text Color SetBkMode(hdcMem, TRANSPARENT) SetTextAlign(hdcMem,TA_UPDATECP) ': ': draw filled rectangle ': Rectangle(hdcMem, 0, -1, (textW+1)*len(Text$), textH+1) ': ': Print some text with frontpen ( = Text$) ': MoveToEx(hdcMem, 0, 0, NULL) TextOut(hdcMem, 0, 0, Text$, len(Text$)) ': ': Okay, we now have a BITMAP ! ': Transfer this BMP on our window canvas using RLIB bitblt function ': INT result=TBitBlt(hdc,1,40,textW*len(Text$),textH,hdcMem, 0, 0, 0xFF00FF) ': Transparent color is Pink ': ': now another BITMAP for the Tstretchblt function ': Text$ = "Transparent StretchBlt Function" ': ': draw filled rectangle ': Rectangle(hdcMem, 0, -1, (textW+1)*len(Text$), textH+1) ': ': Print some text with frontpen ( = Text$) ': MoveToEx(hdcMem, 0, 0, NULL) TextOut(hdcMem, 0, 0, Text$, len(Text$)) ': ': Transfer this BMP on our window canvas using RLIB stretchblt function ': TStretchBlt(hdc, 1, 60, textW*len(Text$), textH*3, hdcMem, 0, 0, textW*len(Text$), textH, 0xFF00FF) ': ': Free-up the off-screen DC ': DeleteObject(SelectObject(hdcMem, oldFont)) DeleteObject(SelectObject(hdcMem, oldBrush)) DeleteObject(SelectObject(hdcMem, oldBmp)) DeleteObject(hbmMem) ReleaseDC(mywnd.hwnd, hdc) DeleteDC(hdcMem) EndSub