Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Status Bar in VFP 8
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00743179
Message ID:
00755315
Views:
18
Rick,

> It doesn't work with themes so now we have these cool XP style forms in 8 and a toolbar that stuck in 90's. Yeah, looks matter.

Does this code chunk help with the theme aware problems of the common controls?
*typedef struct tagINITCOMMONCONTROLSEX {
*    DWORD dwSize;             // size of this structure
*    DWORD dwICC;              // flags indicating which classes to be initialized
*} INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX;
#define ICC_LISTVIEW_CLASSES   0x00000001 && listview, header
#define ICC_TREEVIEW_CLASSES   0x00000002 && treeview, tooltips
#define ICC_BAR_CLASSES        0x00000004 && toolbar, statusbar, trackbar, tooltips
#define ICC_TAB_CLASSES        0x00000008 && tab, tooltips
#define ICC_UPDOWN_CLASS       0x00000010 && updown
#define ICC_PROGRESS_CLASS     0x00000020 && progress
#define ICC_HOTKEY_CLASS       0x00000040 && hotkey
#define ICC_ANIMATE_CLASS      0x00000080 && animate
#define ICC_WIN95_CLASSES      0x000000FF
#define ICC_DATE_CLASSES       0x00000100 && month picker, date picker, time picker, updown
#define ICC_USEREX_CLASSES     0x00000200 && comboex
#define ICC_COOL_CLASSES       0x00000400 && rebar (coolbar) control
#define ICC_INTERNET_CLASSES   0x00000800
#define ICC_PAGESCROLLER_CLASS 0x00001000   && page scroller
#define ICC_NATIVEFNTCTL_CLASS 0x00002000   && native font control

set procedure to convertapi.prg additive

declare integer InitCommonControlsEx in comctl32.dll string @ tagINITCOMMONCONTROLSEX

lcBuffer = ToLong( 4 + 4 ) + ToLong( ICC_TREEVIEW_CLASSES  )

InitCommonControlsEx( @lcBuffer )


* ConvertAPI.prg 08-Oct-97 

* these functions convert to/from internal binary storage

function ToWord( pnNumber )
local lnMSB, lnLSB
lnMSB = int( pnNumber / 256 )  && most significant byte
lnLSB = pnNumber % 256  && least significant byte
return chr( lnLSB ) + chr( lnMSB )

function ToLong( pnNumber )
local lnMSW, lnLSW
lnMSW = int( pnNumber / 65536 )  && most significant word
lnLSW = pnNumber % 65536  && least significant word
return ToWord( lnLSW ) + ToWord( lnMSW )

function FromWord( pcBuffer )
return asc( substr( pcBuffer, 2, 1 ) ) * 256 + asc( left( pcBuffer, 1 ) )

function FromLong( pcBuffer )
return FromWord( substr( pcBuffer, 3, 2 ) ) * 65536 + FromWord( left( pcBuffer, 2 ) )
It needs to be called with the proper set of flags for the controls being used, it does seem to work for getting the Treeview themed.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform