Thanks Chip. I got it to work that way just fine.

Best regards from Ohio, U.S.A.,

Vic
E-mail: vic.beckl...@gmail.com

-----Original Message-----
From: Chip Orange [mailto:lists3...@comcast.net] 
Sent: Sunday, February 12, 2012 5:02 PM
To: gw-scripting@gwmicro.com
Subject: RE: Adding a new hotkey to an existing app

Hi Vic,

If you look at the register hotkeys subroutine generated by the WE Scripting
framework, you'll see a place where it tests for the number of hotkeys, and
if it's not what the program expects, then it writes all the hotkeys out
with their default settings.  I know you don't want to do this exactly, but,
you could modify this idea just slightly to get what you want.

First, you'd need to modify the number of hotkeys this section is looking
for to be 12 instead of 11; and you'll need to add a line for the newest
hotkey to be written along with it's default value to this portion of code.
Now, if it doesn't find 12 hotkeys it will write all twelve of them out to
the .ini file.

Now, make a copy of this portion, and insert it just before this code.  Set
it to test for the number of hotkeys equaling 11  instead of not equaling
12, and delete the lines which write out the first 11 hotkeys, leaving you
only the one line which writes out the newest one.  This way, for someone
with an .ini file which has only the original 11 defined, this code will add
the newest one with it's default value, bringing them up to 12.  For someone
who doesn't have any at all, they'll get all 12 written out new.

 hth,

Chip


> -----Original Message-----
> From: Vic Beckley [mailto:vic.beckl...@gmail.com] 
> Sent: Sunday, February 12, 2012 3:10 PM
> To: GW Scripting List
> Subject: Adding a new hotkey to an existing app
> 
> Hi all,
> 
> I have an app which has at present 11 hotkeys. I am wanting 
> to add at least one hotkey in addition to these. I really 
> don't want to delete the entire *.ini file because users 
> would lose any customizations they had made.
> 
> How can I test for the presence of key12 and add it if it 
> doesn't exist?
> 
> Jeff, I looked at your Winamp app but couldn't understand it. 
> It is too complicated for me and is way above my head.
> 
> Any help would be greatly appreciated. Thanks in advance.
> 
> 
> Best regards from Ohio, U.S.A.,
> 
> Vic
> E-mail: vic.beckl...@gmail.com
> 
> 

Reply via email to