Page 1 of 1

Posted: Thu Jul 11, 2002 12:52 pm
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...

Posted: Sat Jul 13, 2002 12:56 pm
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

Posted: Mon Jul 15, 2002 7:28 pm
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.

Posted: Mon Jul 15, 2002 11:53 pm
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