DLL plug-in inheriting ugly no-themed flat, squared GUI

Just starting out? Need help? Post your questions and find answers here.
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: DLL plug-in inheriting ugly no-themed flat, squared GUI

Post by Thunder93 »

I can reproduce simply by making DLL that has function to open Window with different controls to test. When making DLL, set in PB Compiler Options 'Enable modern theme support (for Windows XP and above)'

Then create main executable to call that function. This time making the executable with 'Enable modern theme support (for Windows XP and above)' feature in PB Compiler options unchecked.
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: DLL plug-in inheriting ugly no-themed flat, squared GUI

Post by Thunder93 »

Example used;

MainExec.pb

Code: Select all

If OpenLibrary(0, "DLL.dll")
  
  *DLLWin = GetFunction(0, "Win")
  If *DLLWin
    CallFunctionFast(*DLLWin)
  EndIf
  
  CloseLibrary(0)
EndIf
; IDE Options = PureBasic 5.31 (Windows - x64)
; Executable = MainExec.exe
; EnablePurifier

DLL.pbi

Code: Select all

ProcedureDLL Win()
;   Protected dt.INITCOMMONCONTROLSEX  
;   dt.INITCOMMONCONTROLSEX\dwSize = SizeOf(INITCOMMONCONTROLSEX) 
;   dt\dwICC = #ICC_STANDARD_CLASSES  
;   IsComCon.b = InitCommonControlsEx_(@dt) 
  
  WinHandle = OpenWindow(0, 0, 0, 300, 420, "Window from DLL", #PB_Window_SystemMenu| #PB_Window_ScreenCentered |#PB_Window_SizeGadget)
  If WinHandle
   
    CalendarGadget(1, 10, 15, 280, 210)

    ButtonGadget(2,35, 338,80, 25,"Test 1")    
    ButtonGadget(3,35, 370,80, 25,"Test 2")

    StringGadget(4, 35, 260,200,25, "TEST 3")
    TextGadget(5, 35, 230,200,25,"IsComCon: "+Str(IsComCon))
       
    Repeat : Event = WaitWindowEvent() : Until Event = #PB_Event_CloseWindow
  EndIf
EndProcedure

; Win()

; IDE Options = PureBasic 5.31 (Windows - x64)
; ExecutableFormat = Shared Dll
; CursorPosition = 3
; Folding = -
; EnableXP
; Executable = DLL.dll
; EnablePurifier
; AddResource = DLL.rc
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
PyroStrex
User
User
Posts: 61
Joined: Mon Mar 22, 2010 3:08 pm

Re: DLL plug-in inheriting ugly no-themed flat, squared GUI

Post by PyroStrex »

With the example you had given, I can simply inject 24:1:1033 resource to the main application to enable the xp style. But based on what you asked for, since the application are digitally signed and can't be injected with anything, your way of doing it might be the only way to make it works (SetWindowTheme) or use the app.manifest way (but this is also a no-go for you).
Post Reply