edge: I liked your layout, it was logical and straight forward and I couldn't think of a reason to change it. Glad your ok about me using it
LEDWizGen is actually written in C#, but I'll give you the basic rundown of how it works..
1. Open controls.ini and enumerate all sections (using GetPrivateProfileString() API function with first 3 parameters as null returns all sections as a string array)
2. Create an outter loop that loops through this array of section strings
3. Enumerate the keys for each section and create an inner loop that loops through this array of keys. Again you use GetPrivateProfileString() but instead the first parameter is the section name from your outter loop and the next two parameters are null.
4. If the key matches one of the following, read them into a variable..
NumPlayers - so you know how many controls there are
P1_BUTTON1 to P1_BUTTON8 - if it has one of these then you know to light the LED for it
P1_JOYSTICK - check to see if this string exists in the key your reading. I think InStr() is what you use for VB6.
Do same as above for P1_TRACKBALL, P1_DIAL, P1_PADDLE and P1_AD_STICK. You need to use InStr() because they are not exact in the ini file (Eg. They may have P1_JOYSTICK_UP or P1_AD_STICK_X)
Now you know what controls are used and how many players for this game, you simply write the cfg file with the controls that are enabled in the GUI.
Hope this helps!
Headkaze,
Nice UI. I am flattered.
Is that in VB? I was working on the same exact functionality to add to the LEDWizard app. Instead of duplication, I can add another tab into the LEDWizard with your batch generator.
Let me know.