Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MESSAGEBOX Right Align Problem
Message
From
29/09/2005 12:46:28
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01054437
Message ID:
01054556
Views:
29
Interesting; I thought it would not be possible.

But still, in a case like I would prefer, and suggest, that the developer create his own form.

>There is a way to control MessageBox font using Timer object and several API calls:
>CreateFont
>DeleteObject
>GetActiveWindow
>GetWindow
>GetWindowDC
>GetWindowText
>MessageBox
>ReleaseDC
>SelectObject
>SendMessage
>
>How to change font name and size in the MessageBox dialog (members area)
>http://www.news2news.com/vfp/?example=434&function=73
>
>
>...
>PROTECTED PROCEDURE SetMessageFont
>#DEFINE OUT_OUTLINE_PRECIS  8
>#DEFINE CLIP_STROKE_PRECIS  2
>#DEFINE PROOF_QUALITY       2
>#DEFINE WM_SETFONT          48
>
>	LOCAL hTarget, hDC
>	hTarget = THIS.GetTextWinHandle()
>
>	IF hTarget <> 0
>		hDC = GetWindowDC(m.hTarget)
>		THIS.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, THIS.hFont, 1)
>		= ReleaseDC(m.hTarget, m.hDC)
>	ENDIF
>...
>
>
>A bit ugly :) and requires some coding, still works.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform