RE:modificar un messagebox
Bueno ... revisa este ejemplo ....
Messagebox con características especiales
If Vartype(_Screen.msgboxtimer) <> "U"
_Screen.RemoveObject("msgboxtimer")
Endif
_Screen.AddObject("msgboxtimer", "Tmsgbox")
With _Screen.msgboxtimer
.FontName = "Times New Roman"
.FontSize = 24
* note carriage returns added to the end of the message
* to increase its height
.MsgBox("The MessageBox dialog with adjustable font. " +;
Repli(Chr(13),5), 64, "MessageBox")
Endwith
* end of main
Define Class Tmsgbox As Timer
#Define GW_HWNDFIRST 0
#Define GW_HWNDLAST 1
#Define GW_HWNDNEXT 2
#Define GW_CHILD 5
#Define GWL_ID -12
Interval=0
hDialog=0 && dialog window handle
DlgMessage=""
DlgTitle=""
DlgType=0
DlgResult=0
FontName="Arial"
FontSize=16
FontItalic=0
FontWeight=400
Procedure Init
Declare Integer GetActiveWindow In user32
Declare Integer GetWindow In user32 Integer HWnd, Integer wFlag
Declare Integer GetWindowLong In user32 Integer HWnd, Integer nIndex
Declare Integer ReleaseDC In user32 Integer HWnd, Integer hdc
Declare Integer DeleteObject In gdi32 Integer hObject
Declare Integer SelectObject In gdi32 Integer hdc, Integer hObject
Declare Integer GetWindowDC In user32 Integer HWnd
Declare Integer CreateFont In gdi32;
INTEGER nHeight, Integer nWidth, Integer nEscapement,;
INTEGER nOrientation, Integer fnWeight, Integer fdwItalic,;
INTEGER fdwUnderline, Integer fdwStrikeOut, Integer fdwCharSet,;
INTEGER fdwOutPrecis, Integer fdwClipPrecis, Integer fdwQuality,;
INTEGER fdwPitchAndFamily, String lpszFace
Declare Integer GetWindowText In user32;
INTEGER HWnd, String @lpString, Integer cch
Declare Integer SendMessage In user32;
INTEGER HWnd, Integer Msg, Integer wParam, Integer Lparam
Procedure MsgBox(cMsg, nType, cTitle)
With This
.DlgMessage = cMsg
.DlgType = m.nType
.DlgTitle = Iif(Vartype(cTitle)="C", m.cTitle, Version())
.Interval = 100
.DlgResult = Messageb(This.DlgMessage, .DlgType, .DlgTitle)
.hDialog = 0
Endwith
Return This.DlgResult
Procedure Timer
If This.hDialog = 0
If This.DialogFound()
This.SetMessageFont
Endif
This.Interval = 0
Endif
Protected Function DialogFound
Local hWindow, cTitle
hWindow = GetActiveWindow()
cTitle = This.GetWinText(hWindow)
This.hDialog = Iif(cTitle=This.DlgTitle, hWindow, 0)
Return (This.hDialog <> 0)
Protected Function GetWinText(hWindow)
Local nBufsize, cBuffer
nBufsize = 128
cBuffer = Repli(Chr(0), nBufsize)
nBufsize = GetWindowText(hWindow, @cBuffer, nBufsize)
Return Iif(nBufsize=0, "", Left(cBuffer, nBufsize))
Protected Procedure SetMessageFont
#Define OUT_OUTLINE_PRECIS 8
#Define CLIP_STROKE_PRECIS 2
#Define PROOF_QUALITY 2
#Define WM_SETFONT 48
Local hFirst, hWindow, hLast, hTarget, nId, hdc, hFont
hFirst = GetWindow(This.hDialog, GW_CHILD)
hWindow = GetWindow(hFirst, GW_HWNDFIRST)
hLast = GetWindow(hFirst, GW_HWNDLAST)
hTarget = 0
Do While .T.
nId = GetWindowLong(m.hWindow, GWL_ID)
cText = This.GetWinText(m.hWindow)
Do Case
Case m.cText = This.DlgMessage
hTarget = m.hWindow
Exit
Case hWindow = m.hLast
Exit
Endcase
hWindow = GetWindow(m.hWindow, GW_HWNDNEXT)
Enddo
If hTarget <> 0
hdc = GetWindowDC(m.hTarget)
hFont = CreateFont(This.FontSize,;
0, 0,0, This.FontWeight,This.FontItalic,0,0,;
0, OUT_OUTLINE_PRECIS, CLIP_STROKE_PRECIS,;
PROOF_QUALITY, 0, This.FontName)
= SendMessage (m.hTarget, WM_SETFONT, m.hFont, 1)
= ReleaseDC(m.hTarget, m.hdc)
= DeleteObject(hFont)
EndIf
EndDefine
Saludos
David Amador Tapia
WebMaster "La Web de Davphantom"
www.davphantom.net
Cartagena. Colombia