in PB land..
- np


Code: Select all
Global Hook
Procedure FindText(hwnd, lParam)
cn$ = Space(#MAX_PATH)
GetClassName_(hwnd, @cn$, #MAX_PATH)
If UCase(cn$) = "STATIC"
If GetWindowLong_(hwnd, #GWL_STYLE) & #SS_BITMAP = 0
SendMessage_(hwnd, #WM_SETFONT, LoadFont(0, "Tahoma", 10, #PB_Font_Bold), 1)
ProcedureReturn 0
EndIf
EndIf
ProcedureReturn 1
EndProcedure
Procedure HookProc(nCode, wParam, lParam)
Static hWnd_MessageBox
Select nCode
Case #HCBT_CREATEWND
*pcbt.CBT_CREATEWND = lParam
*pcs.CREATESTRUCT = *pcbt\lpcs
Select *pcs\lpszClass
Case 32770
hWnd_MessageBox = wParam
EndSelect
Case #HCBT_ACTIVATE
EnumChildWindows_(hWnd_MessageBox, @FindText(), 0)
EndSelect
ProcedureReturn CallNextHookEx_(Hook, nCode, wParam, lParam)
EndProcedure
Hook = SetWindowsHookEx_(#WH_CBT, @HookProc(), #Null, GetCurrentThreadId_())
result = MessageRequester("Hello", "This is bold text ", #MB_ICONINFORMATION)
UnhookWindowsHookEx_(Hook)
Code: Select all
Procedure SetBoldMsgBox(*Title)
Repeat
hwnd = FindWindowEx_(FindWindow_(0, *Title), 0, @"Static", 0)
Until hwnd<>0
SendMessage_(hwnd, #WM_SETFONT, LoadFont(0, "Microsoft Sans Serif", 8, #PB_Font_Bold), 1)
EndProcedure
Title.s = "Bold Text example"
Text.s = "Sample text"
CreateThread(@SetBoldMsgBox(), @Title)
MessageRequester(Title, Text)