Does someone have a piece of code showing how to implement popup windows like the one in the picture able to show plain and bold text?
Thanks a lot
Eros
Thanks a lot
Eros

#compile exe #debug display #include "win32api.inc" '------------------------------------------------------------------------------ callback function ShowhelpProc() static hparent as dword static htext as string static pSQL as string ptr static s as string local l as long local r, rEdit, rUS as RECT static szText as asciiz * 2048 local hfont, hfont2, px, py, x, y as long local hDC as dword local ps as paintstruct local pstr as string ptr, RV&, hBrush as long select case as long cbmsg case %wm_initdialog ' Initialization handler pstr = getprop(cbhndl, "TEXT") sztext = @pstr ' store in static variable getwindowrect cbhndl, r x=r.nLeft y=r.nTop getClientrect cbhndl, r hDC=GetDC(cbhndl) SaveDC hDC hfont = SendMessage(cbhndl, %WM_GETFONT, 0, 0) hfont2 = SelectObject(hDC, hfont) DrawText hDC, szText, len(szText), r, %DT_CALCRECT or %DT_LEFT or %DT_WORDBREAK SelectObject hDC, hfont2 RestoreDC hDC, -1 ReleaseDC cbhndl, hDC SetWindowPos cbhndl, 0, x, y, R.nRight, R.nBottom, %SWP_NOACTIVATE or %SWP_NOCOPYBITS or %SWP_NOMOVE or %SWP_NOOWNERZORDER or %SWP_NOREDRAW or %SWP_NOZORDER case %wm_lbuttondown SendMessage cbhndl, %wm_nclbuttondown, %HTCAPTION, byval %NULL ' force drag case %wm_mousemove ' the dialog has been dragged case %WM_ERASEBKGND hDC = cbwparam SaveDC hDC hBrush = SendMessage(cbhndl, %WM_CTLCOLORDLG, hDC, cbhndl) SelectObject hDC, hBrush getclientrect cbhndl, r PatBlt hDC, 0,0, R.nRight, R.nBottom, %PATCOPY hfont = SendMessage(cbhndl, %WM_GETFONT, 0, 0) hfont2 = SelectObject(hDC, hfont) DrawText hDC, szText, len(szText), r, %DT_LEFT or %DT_WORDBREAK SelectObject hDC, hfont2 RestoreDC hDC, -1 function=1 exit function end select end function '------------------------------------------------------------------------------ ' display expanded version of archived query function Showhelp(byval hParent as dword, s as string) as long local lRslt as long static sSQL as string local hDlg as dword dialog new hParent, "", , , 190, 50, %ws_popup or %ws_clipsiblings or %ws_visible to hDlg dialog set color hDlg, 0, rgb(155, 255,155) setprop hdlg, "TEXT", byval varptr(s) dialog show modeless hDlg, call ShowhelpProc to lRslt function = lRslt end function '------------------------------ callback function maincb select case cb.msg case %wm_initdialog showhelp ( cb.hndl, "this is an example!" + $cr + "here in the green box!") end select end function '------------------------------ function pbmain local hDlg as dword dialog new 0,"",0,0,0,0,%ws_sysmenu, to hDlg dialog show modal hDlg call mainCB sleep 5000'? "wait" end function
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment