Hi,
For stylistic reasons I would like to re-use the window close icon (The 'X' at top right of a Window()) that is in current use. Can anyone advise me how to locate it?
Thanks
RichardL
Locating the current 'window close' icon
-
gnozal
- PureBasic Expert

- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
I am not sure there is an available icon, I believe M$ uses the Marlett font : http://support.microsoft.com/kb/134861 .
This font is available on every windows version : http://www.microsoft.com/typography/fon ... x?FMID=146 (Marlett.ttf is usually a hidden file).
Code: Select all
If OpenWindow(0, 452, 199, 259, 263, "Marlett", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
ButtonGadget(0, 80, 110, 30, 30, "r")
ButtonGadget(1, 115, 110, 30, 30, "1")
ButtonGadget(2, 150, 110, 30, 30, "2")
SetGadgetFont(0, LoadFont(0, "Marlett", 16, 272))
SetGadgetFont(1, LoadFont(1, "Marlett", 16, 272))
SetGadgetFont(2, LoadFont(2, "Marlett", 16, 272))
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
CloseWindow(0)
Break
EndSelect
ForEver
EndIfFor free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
- Fluid Byte
- Addict

- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
With and without skins:
Code: Select all
OpenWindow(0,0,0,320,240,"void",#PB_Window_SystemMenu | #PB_Window_ScreenCentered)
SetRect_(frc.RECT,20,20,46,46)
hdc = StartDrawing(WindowOutput(0))
; Windows 2000 and lower
SetTextAlign_(hdc,0)
DrawFrameControl_(hdc,frc,#DFC_CAPTION,#DFCS_CAPTIONCLOSE)
; Windows XP and higher
lpBuffer = AllocateMemory(13)
PokeS(lpBuffer,"Window",-1,#PB_Unicode)
hTheme = OpenThemeData_(WindowID(0),lpBuffer)
OffsetRect_(frc,0,50)
DrawThemeBackground_(hTheme,hdc,18,1,frc,0)
OffsetRect_(frc,40,0)
DrawThemeBackground_(hTheme,hdc,18,2,frc,0)
OffsetRect_(frc,40,0)
DrawThemeBackground_(hTheme,hdc,18,3,frc,0)
CloseThemeData_(hTheme)
StopDrawing()
While WaitWindowEvent() ! #PB_Event_CloseWindow : WendWindows 10 Pro, 64-Bit / Whose Hoff is it anyway?
