Page 1 of 1

I can bold highlighted word in Msgxxx ?

Posted: Fri Dec 03, 2021 5:18 am
by Claudio Ricardo
Hola, Se puede resaltar en negrita parte del texto en un Msgxxx ?
For example: MsgStop ("You " + FontBold ("can't") + " leave the field empty !" , "Warning")
=> You can't leave the field empty !
Using standard Msg, without create owner box, If it's possible, how :?:
Thanks in advance !

Re: I can bold highlighted word in Msgxxx ?

Posted: Fri Dec 03, 2021 12:27 pm
by Pcmodula
No you can't Msgbox call system Messagebox API
From HMG Sources: c_msgbox.c
*/
#include "SET_COMPILE_HMG_UNICODE.ch"
#include "HMG_UNICODE.h"


#include <shlobj.h>
#include <windows.h>
#include "hbapi.h"

#include "hbthread.h"
extern HB_CRITICAL_T _HMG_Mutex; // global Mutex variable defined into c_Thread.c


HB_FUNC( C_MSGBOX )
{
MessageBox( GetActiveWindow(), HMG_parc( 1 ), HMG_parc( 2 ), MB_OK | MB_SYSTEMMODAL ) ;
}

Saludos
PcModula

Re: I can bold highlighted word in Msgxxx ?

Posted: Fri Dec 03, 2021 10:29 pm
by Claudio Ricardo
Hi,
That I had seen in the libraries but I thought there was some "trick" to make it possible,
perhaps by modifying the string that is sent to the function.
If I am forced to draw attention to a word, I will have to create a custom MsgBox.
Thank you very much for your answer !
Hola,
Eso habia visto en las librerias pero pensé que habia algun "truco" para hacerlo posible,
tal vez modificando el string que se le envia a la función.
Si me veo obligado a llamar la atención sobre una palabra, tendré que crear un custom MsgBox.
Muchas gracias por tu respuesta !

Re: I can bold highlighted word in Msgxxx ?

Posted: Sat Dec 04, 2021 7:14 am
by AUGE_OHR
hi,

you can Set Color when use "old Color" Constant

Code: Select all

#define COLOR_INFOTEXT          23
#define COLOR_INFOBK            24
you can use GetSysColor() / SetSysColor() but it work "System-wide" so ALL will use "your Color" as long as User are login
https://docs.microsoft.com/en-us/window ... etsyscolor
https://docs.microsoft.com/en-us/window ... tsyscolors

Re: I can bold highlighted word in Msgxxx ?

Posted: Sat Dec 04, 2021 9:08 am
by Claudio Ricardo
Thanks Jimmy for you answer and links,
But I needed to highlight only one or two words of the phrase, something like this:
Are you sure you want to delete ALL customer data?
I saw it in MsgBox of some programs, maybe under QT or in some web app. :cry:

Re: I can bold highlighted word in Msgxxx ?

Posted: Mon Dec 06, 2021 9:58 am
by danielmaximiliano
Hola muchachos :
msgbox tiene lo basico para un mensaje al usuario y msgboxIndirect tiene otras funciones agregadas pero no lo que necesitas.
yo en VFP necesitaba algo parecido pero no encontre la solución y solo me quedó hacer un FORM parecido para poder agregar un imagen dentro.
simple y efectivo...
espero que esten bien junto a sus familias.

Re: I can bold highlighted word in Msgxxx ?

Posted: Sun Dec 12, 2021 10:35 pm
by Claudio Ricardo
Muchas gracias Daniel, Si me es imprescindible hare asi como dices, incluso insertar un .rtf con bold y color !