Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 10
#Compile Exe
#Dim All
%Unicode = 1
#Include "Win32API.inc"
Global hDlg As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "PowerBASIC",300,300,200,200, %WS_OverlappedWindow To hDlg
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Select Case Cb.Msg
Case %WM_InitDialog : Dialog Post hDlg, %WM_User+500, 0, 0
Case %WM_User+500
Local cf As ChooseFontAPI
cf.lstructSize = SizeOf(cf)
cf.Flags = %CF_Both Or %CF_Effects Or %CF_EnableHook
cf.lpfnhook = CodePtr(FontHookProc)
ChooseFont(cf)
End Select
End Function
Function FontHookPRoc (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long ) As Long
Select Case As wMsg
Case %WM_InitDialog
Local x,y As Long
Dialog Get Loc hDlg To x,y
SetWindowPos hWnd, %HWND_TOP, x+100,y+100, %NULL, %NULL, %SWP_NOSIZE
End Select
End Function
'gbs_01427
'Date: 10-17-2014
http://www.garybeene.com/sw/gbsnippets.htm