Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MESSAGEBOX Right Align Problem
Message
De
29/09/2005 12:46:28
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01054437
Message ID:
01054556
Vues:
30
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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform