Page 1 of 2

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

Posted: Thu Mar 26, 2015 5:26 am
by Thunder93
DLL plug-in inheriting ugly no-themed flat, squared GUI from the parent process on Windows 7. Is there way to force It on my GUI from the plugin file without needing to SetWindowTheme() on each and every gadget? Or is that mandatory? Thanks.

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

Posted: Thu Mar 26, 2015 9:02 am
by Danilo
You could try to put a .manifest beside the non-themed app. AppName.exe + AppName.exe.manifest

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

Posted: Thu Mar 26, 2015 12:19 pm
by Thunder93
Thanks. I tried, per your suggestion. It was a no - go.

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

Posted: Thu Mar 26, 2015 1:29 pm
by Thunder93
I haven't had the need to use manifest until now. I tried using it with my DLL plug-in file, not having any luck. I am calling InitCommonControlsEx_(), and this seems to work alright for an executable I make. :?

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

Posted: Thu Mar 26, 2015 2:30 pm
by RASHAD
You solved it already
See if SetThemeAppProperties_(1) at the beginning will be of any help

Code: Select all

  SetThemeAppProperties_(1)
  
  OpenWindow(0, 0, 0, 300, 420, "Window_0", #PB_Window_SystemMenu| #PB_Window_ScreenCentered |#PB_Window_SizeGadget)
  SetThemeAppProperties_(1)
  CalendarGadget(1, 35, 15, 230, 165)
  
  SetThemeAppProperties_(2)
  ButtonGadget(2,35, 188,80, 25,"Test 1")    
  ButtonGadget(3,35, 370,80, 25,"Test 2")
  StringGadget(4, 35, 220,200,25, "RASHAD TEST")
  TextGadget(5, 35, 250,200,25,"Another TEST")
  
  SetThemeAppProperties_(1)
  LoadImage(0, "g:\girl24.bmp")
  ButtonImageGadget(6, 35,280, 80, 80, ImageID(0))     
      
Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow
      Quit = 1
      
  EndSelect
Until Quit = 1

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

Posted: Thu Mar 26, 2015 3:09 pm
by Thunder93
Thanks RASHAD. Unfortunately that was also a no - go. I even sent a WM_THEMECHANGED message in hopes your suggestion would work.

It just doesn't want to work under a PureBasic DLL, even though the manifest is right.

On a executable file, no problem to use a manifest file.

I thought initially might be something with the parent executable I'm plugging into. However, for testing I've made my own PB parent executable with no themes set and calling PB DLL that is suppose to be using the manifest. I'm experiencing the same issue, so I know it isn't with the third-party application that my PB plug-in DLL file plugs into.

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

Posted: Thu Mar 26, 2015 3:33 pm
by Danilo
- ButtonTest.zip (x86 manifest, doesn't work with x64)

With external manifest it's themed. Delete the manifest and it is Win9x style.
Sometimes you have to move .exe + .manifest to new directory. Looks like
Windows sometimes caches the manifest info.

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

Posted: Thu Mar 26, 2015 3:53 pm
by Thunder93
To make it both x86 & x64 manifest file, simply edit the file and use wildcard for both processorArchitecture values.

My problem isn't with manifesting an executable, my problem is with manifesting PB DLLs plugged into executable that's not set to be using modern theme support. :wink:

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

Posted: Thu Mar 26, 2015 3:59 pm
by Danilo
Thunder93 wrote:My problem isn't with manifesting an executable, my problem is with manifesting PB DLLs plugged into executable that's not set to be using modern theme support. :wink:
That's what I'm talking about. You need to manifest the main .exe because the plug-in DLL is loaded into the same process.
The plug-in DLL uses the same manifest as the main .exe.

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

Posted: Thu Mar 26, 2015 4:09 pm
by Thunder93
manifesting a program executable which I never made. It doesn't want to comply with the manifesting procedure. :evil:

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

Posted: Thu Mar 26, 2015 4:46 pm
by Danilo
Thunder93 wrote:manifesting a program executable which I never made. It doesn't want to comply with the manifesting procedure. :evil:
Does it work when using the manifest tool (VisualStudio or Windows SDK) to embed the manifest directly?
call D:\VS2010\VC\vcvarsall.bat x86
mt.exe -nologo -manifest "ButtonTest2.exe.manifest" -outputresource:"ButtonTest.exe"
pause
(Backup before manipulating the EXE)

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

Posted: Thu Mar 26, 2015 5:45 pm
by Thunder93
Thanks. Unfortunately that's a no - go. I tried, however this application is digitally signed and I think that makes a difference. After including the manifest I receive error upon execution attempt ' _ is not a valid Win32 application. '

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

Posted: Mon Apr 20, 2015 4:30 am
by PyroStrex
I am not sure if you are still trying to figure out this. But after like days of searching for the answer, this post here answered my question.

http://www.purebasic.fr/english/viewtop ... 16#p102716

The weird thing was, I did saw that post and read it like 3 times then I went to msdn to get a clue and everything. Then I go back to that post and tried it, it does work.

1. I used a resource hacker to rename the manifest folder to 2 instead of 1
More on this what i saw was (24:1:1033), thus I changed it to (24:2:1033)
2. I extract all resource to rc format using the same resource hacker (it will extract only the manifest since that is all what I have in my resources)
3. I add it to the project via the resources import tab (compiler settings).
4. compile and use your dll.

Edit:
I just create a new thread for the solution in tips and tricks section so that it will help whoever in need in the future.
http://www.purebasic.fr/english/viewtop ... 12&t=62111

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

Posted: Mon Apr 20, 2015 1:58 pm
by Thunder93
Thanks but I already went down that avenue. To no avail.

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

Posted: Mon Apr 20, 2015 2:13 pm
by PyroStrex
Well if it is still a no go, then the only way to help you now is by knowing that target application. If you can't tell us the exact target application, at least find another application that have the same issue and let us try to find a way to help you :).