I can bold highlighted word in Msgxxx ?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

I can bold highlighted word in Msgxxx ?

Post 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 !
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
Pcmodula
Posts: 37
Joined: Thu Nov 22, 2012 6:00 pm

Re: I can bold highlighted word in Msgxxx ?

Post 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
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: I can bold highlighted word in Msgxxx ?

Post 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 !
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: I can bold highlighted word in Msgxxx ?

Post 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
have fun
Jimmy
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: I can bold highlighted word in Msgxxx ?

Post 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:
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
User avatar
danielmaximiliano
Posts: 2763
Joined: Fri Apr 09, 2010 4:53 pm
DBs Used: DBF
Location: Argentina
Contact:

Re: I can bold highlighted word in Msgxxx ?

Post 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.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Telegram invitation https://t.me/HMGWorkspace
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: I can bold highlighted word in Msgxxx ?

Post by Claudio Ricardo »

Muchas gracias Daniel, Si me es imprescindible hare asi como dices, incluso insertar un .rtf con bold y color !
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
Post Reply