need help with WinXP OpenTheme function

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by wickedRush.

Hello, I would like to be able to draw an XP style button, etc. on a window ( similar to calling DrawFrameControl API function ) I have not been able to get the OpenTheme function to return a hTheme handle, only NULL

Code: Select all

hWnd=OpenWindow(1,100,100,400,300,#WS_SYSMENU,"UxTheme.dll Test")
OpenLibrary(1,"uxtheme.dll")
If CallFunction(1,"OpenThemeData",hWnd,@"Button")=0
 End
EndIf


Repeat
 event=WaitWindowEvent()
  Select event
   Case #PB_EventCloseWindow
    Select EventWindowID()
     Case 1
      quit=1
    EndSelect
  EndSelect
Until quit=1
assuming OpenTheme returns a handle the program does not exit. But it always returns NULL. I've tried all kinds of variations on this code with no luck. Please Help...
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by wickedRush.

Oh, never mind...I figured it out.



Edited by - wickedRush on 15 July 2002 00:20:44
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.
Oh, never mind...I figured it out.

Edited by - wickedRush on 15 July 2002 00:20:44
Nice to hear that, but where can the community find the 'how it goes...' for this


Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by wickedRush.

Good Point..
Solution to above problem: Read the MS docs very, very carefully. The class identifier string must be in widestring format not ANSI. The API has a function to convert a regular string. I will correct the above code soon
Post Reply