Thanks for advertising

Moderator: gnozal
Thanks for advertising
Yes, all my apps / libs / tools are 32bits (x86) only.superloupiot wrote:OK, I have remove the 64-bit version of PureBasic and installed the32-bit version.
I can observe that on my computer, PureCOLOR work with the 32-bit version but not with the 64-bit version.
Code: Select all
Global textBackground = CreateSolidBrush_(#red)
Global textForeground = #White
Procedure WinProc(hwnd,msg,wParam,lParam)
result = #PB_ProcessPureBasicEvents
If msg=#WM_CTLCOLORSTATIC And lParam=GadgetID(1)
SetBkMode_(wParam, #TRANSPARENT)
SetTextColor_(wParam, textForeground)
result = textBackground
EndIf
ProcedureReturn result
EndProcedure
OpenWindow(0,0,0,200,100,"Frame3DGadget Color",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
Frame3DGadget(1,20,20,150,70,"Some text")
SetWindowCallback(@WinProc())
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
DeleteObject_(textBackground)
Big thanks gnozalgnozal wrote:To set colors without PureCOLOR, this should work I guess (tested on XP x86 (themes disabled)) :Some other code : http://www.purebasic.fr/english/viewtopic.php?t=24919Code: Select all
Global textBackground = CreateSolidBrush_(#red) Global textForeground = #White Procedure WinProc(hwnd,msg,wParam,lParam) result = #PB_ProcessPureBasicEvents If msg=#WM_CTLCOLORSTATIC And lParam=GadgetID(1) SetBkMode_(wParam, #TRANSPARENT) SetTextColor_(wParam, textForeground) result = textBackground EndIf ProcedureReturn result EndProcedure OpenWindow(0,0,0,200,100,"Frame3DGadget Color",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) Frame3DGadget(1,20,20,150,70,"Some text") SetWindowCallback(@WinProc()) Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow DeleteObject_(textBackground)
Code: Select all
Window_Main = OpenWindow(#PB_Any, 200, 200, 300, 60, "Test", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_TitleBar|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget)
If Window_Main
SmartWindowRefresh(Window_Main, #True)
TestButton1 = ButtonGadget(#PB_Any, 10, 10, 135, 40, "Long long long text", #PB_Button_MultiLine)
TestButton2 = ButtonGadget(#PB_Any, 155, 10, 140, 40, "Long long long text", #PB_Button_MultiLine)
PureRESIZE_SetGadgetResize(TestButton1, 1, 0, 0, 1)
PureRESIZE_SetGadgetResize(TestButton2, 1, 0, 0, 1)
SetGadgetFont(TestButton1, LoadFont(0, "Arial", 8, 272))
SetGadgetFont(TestButton2, LoadFont(1, "Arial", 8, 272))
PureCOLOR_SetButtonColor(TestButton1, #PureCOLOR_SystemColor, $18A784)
PureCOLOR_SetButtonColor(TestButton2, #PureCOLOR_SystemColor, $20B3B7)
EndIf
DisableGadget(TestButton1, 1)
DisableGadget(TestButton2, 1)
Repeat
Delay (10)
i+1
If i = 100
DisableGadget(TestButton1, 0)
DisableGadget(TestButton2, 0)
ElseIf i = 200
DisableGadget(TestButton1, 1)
DisableGadget(TestButton2, 1)
i=0
EndIf
Until WindowEvent() = #PB_Event_CloseWindow
Code: Select all
; PureCOLOR_SetButtonColor(TestButton1, #PureCOLOR_SystemColor, $18A784)
; PureCOLOR_SetButtonColor(TestButton2, #PureCOLOR_SystemColor, $20B3B7)