Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MESSAGEBOX Right Align Problem
Message
 
To
29/09/2005 09:02:57
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:
01054552
Views:
21
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform