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: 1773
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

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

Post 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.
ʽʽ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
Danilo
Addict
Addict
Posts: 3010
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

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

Post by Danilo »

You could try to put a .manifest beside the non-themed app. AppName.exe + AppName.exe.manifest
User avatar
Thunder93
Addict
Addict
Posts: 1773
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

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

Post by Thunder93 »

Thanks. I tried, per your suggestion. It was a no - go.
ʽʽ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: 1773
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 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. :?
ʽʽ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
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4108
Joined: Sun Apr 12, 2009 6:27 am

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

Post 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
Egypt my love
User avatar
Thunder93
Addict
Addict
Posts: 1773
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

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

Post 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.
ʽʽ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
Danilo
Addict
Addict
Posts: 3010
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

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

Post 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.
User avatar
Thunder93
Addict
Addict
Posts: 1773
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

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

Post 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:
ʽʽ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
Danilo
Addict
Addict
Posts: 3010
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

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

Post 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.
User avatar
Thunder93
Addict
Addict
Posts: 1773
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

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

Post by Thunder93 »

manifesting a program executable which I never made. It doesn't want to comply with the manifesting procedure. :evil:
ʽʽ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
Danilo
Addict
Addict
Posts: 3010
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

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

Post 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)
User avatar
Thunder93
Addict
Addict
Posts: 1773
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

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

Post 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. '
ʽʽ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 »

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
User avatar
Thunder93
Addict
Addict
Posts: 1773
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

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

Post by Thunder93 »

Thanks but I already went down that avenue. To no avail.
ʽʽ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 »

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 :).
Post Reply