Font Requester - name and size only
Font Requester - name and size only
I would like to offer a font selector that only permits selection of fontname and size. Just a way to allow a default font selection and I would prefer they not be picking bold, underline, etc.
Is this possible without completely building my own? I've searched msdn but have not seen any combination of options that would accomplish this.
cheers
Is this possible without completely building my own? I've searched msdn but have not seen any combination of options that would accomplish this.
cheers
Testted and working on XP.
Code: Select all
Procedure CFHookProc(hwnd, msg, wParam, lParam)
;- disable style combo
hStyle = GetDlgItem_(hwnd, 1137)
EnableWindow_(hStyle, 0)
;- Return 0 to process msg
;- Return 1 to ignore msg
ProcedureReturn 0
EndProcedure
hdc = CreateDC_(@"DISPLAY", 0, 0, 0)
logPixSY = GetDeviceCaps_(hdc, #LOGPIXELSY)
DeleteDC_(hdc)
cf.CHOOSEFONT
cf\lStructSize = SizeOf(cf)
lf.LOGFONT
;- Default font size
pointSize = 12
lf\lfHeight = (pointSize * logPixSY) / 72
;- Default font
FontName$ = "Courier New"
CopyMemory(@FontName$, @lf\lfFaceName, Len(FontName$))
cf\flags = #CF_INITTOLOGFONTSTRUCT | #CF_SCREENFONTS | #CF_ENABLEHOOK | #CF_USESTYLE
;- HookProc to disable choosing of styles
cf\lpfnHook = @CFHookProc()
;- lf.LOGFONT contains default font properties
cf\lpLogFont = @lf
;- Get language text for various styles
hLib = OpenLibrary(0, "comdlg32.dll")
style$ = Space(260)
;- Regular
LoadString_(hLib, 1284, @style$, 64)
;- Bold
;LoadString_(hLib, 1285, @style$, 64)
;- Italic
;LoadString_(hLib, 1286, @style$, 64)
;- Bold Italic
;LoadString_(hLib, 1287, @style$, 64)
;-(none)
;LoadString_(hLib, 1288, @style$, 64)
CloseLibrary(0)
cf\lpszStyle = @style$
If ChooseFont_(@cf)
MessageRequester("Font chosen:", "Name: " + PeekS(@lf\lfFaceName) + #CRLF$ + "Size: " + Str(cf\iPointSize/10) + #CRLF$ + "Style: " + style$, #PB_MessageRequester_Ok | #MB_ICONINFORMATION)
EndIf
Last edited by Sparkie on Sat Feb 28, 2009 9:08 pm, edited 1 time in total.
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
- Kwai chang caine
- Always Here
- Posts: 5494
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Somebody call KCC SHIPMENT 24/24 hours at your service !!!
It's a little bit to late for the shipment of a rose
But KCC have always a good solution for his hero SPARKIE
KCC have found that

Yes i know i know......it's not a rose
But this tongs is pink no ???? :roll:
And my hero is surelly very nice with this great shoes
I say at everybody that my hero know all to do, it's for that, that is the KCC hero
And like all the true and great hero, he have a very good and devoted assistant, who be always behind him, i have nominate KCCSKIE.
It's a mystery, but nobody know who is he ???? because he is hidden behind a mask

Perhaps a day KCCSKIE take off his mask ????
Surelly the day where his hero take off it too

It's a little bit to late for the shipment of a rose

But KCC have always a good solution for his hero SPARKIE
KCC have found that

Yes i know i know......it's not a rose

But this tongs is pink no ???? :roll:
And my hero is surelly very nice with this great shoes

I say at everybody that my hero know all to do, it's for that, that is the KCC hero

And like all the true and great hero, he have a very good and devoted assistant, who be always behind him, i have nominate KCCSKIE.
It's a mystery, but nobody know who is he ???? because he is hidden behind a mask


Perhaps a day KCCSKIE take off his mask ????
Surelly the day where his hero take off it too

Last edited by Kwai chang caine on Sun Mar 01, 2009 1:18 am, edited 5 times in total.

Not a destination
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
- Kwai chang caine
- Always Here
- Posts: 5494
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Ayaaaai !!!! it's the day, it's good !!!!! ...the shop is open in france at this time
And a client is a client....and KCC don't want loose any client
Then KCC SHIPMENT 24/24 hours at your service, have run everywhere, and found the real command for his client.
And i'm sure that this time.....SPARKIE been proud of his devoted assistant

If you have another command.....don't forget.... one name only :
KCC SHIPMENT 24/24 hours at your service

And a client is a client....and KCC don't want loose any client

Then KCC SHIPMENT 24/24 hours at your service, have run everywhere, and found the real command for his client.
And i'm sure that this time.....SPARKIE been proud of his devoted assistant

If you have another command.....don't forget.... one name only :
KCC SHIPMENT 24/24 hours at your service


Not a destination
- Kwai chang caine
- Always Here
- Posts: 5494
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
- Kwai chang caine
- Always Here
- Posts: 5494
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Thank you very much, this is one of the more good day of my lifeKCC, I'm proud to have you as my assistant

I have at last, find somebody who want me in assistant

This sentence proof another time, that you are not only great for the knowledge....but also for the heart

Don't worry....KCC have do all that is possible, for serve his master, for that, always my hero, as proud of the little KCC

Yes you are right, but i had an imperative, remember you the sentence of rstsMaybe something in bat black would be more of a fashion statement
rsts wrote:I'll see if I can get kwai to send you a rose
And i don't know if you know that, but in france a rose it's the same word that the color pink (Rose the color = Rose the flower)
So when rsts call KCC SHIPMENT 24/24 hours at your service then it's to late for shopping because all the flower shop in france is closed

Then KCC have an idea

This is the explain of this story

But don't worry....you don't put this shoes for do your dangerous mission of BATMAN.....no no no :roll:
And surelly the spectator of movie laugh if he see the pink shoes replace the black boots

And KCC don't want the spectator jeer of his hero

It's just when you are in your home or in vacancy with your nice dog

Oh... i have forgotten the other day to ask you, the name of your devoted assistant at four foot ??? :roll:
This mines is "PERLE" and "SOURIS" in english it's "PEARL" and "MOUSE".
But she don't know the english, if you call her like this "PEARL" and "MOUSE" perhaps she are unnerve


Not a destination