forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Help: LIST REGVALS

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
MondoNuovo
Valued Newbie


Joined: 09 Jul 2001
Posts: 44
Location: Italy

PostPosted: Thu Mar 14, 2002 3:54 pm    Post subject: Help: LIST REGVALS Reply with quote

A little help.
How to do to remove a key one from the register as from a list?
You look at the following example.

Code:

Title Test
  DIALOG CREATE,Test,-1,0,393,196
  DIALOG ADD,LIST,LIST1,16,5,382,142,sorted,click
  DIALOG ADD,BUTTON,Exit,166,324,64,24,Exit
  %z = @sendmsg(@winexists(~list1),$0194,400,0)
  list regkeys,list1,curuser,software\microsoft\windows\currentversion\explorer\menuorder\start menu\&programs
  DIALOG SHOW
 
:Evloop
 wait event
 goto @event()
 
:list1click
dialog popup,Delete
goto evloop

:DeleteMenu
rem This command causes the elimination of all the key &Programs.
rem ATTENTION: Make a copy of the register if you click Delete.
registry delete,CURUSER,Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\&Programs\@item(list1)
rem I want only to remove a sub-key.
goto evloop

:ExitBUTTON
:Close
  exit


Please can someone help me?
Thanks in advance Very Happy
Back to top
View user's profile Send private message Send e-mail
Sylvester
Valued Newbie


Joined: 31 Jul 2000
Posts: 43
Location: Boston, MA USA

PostPosted: Thu Mar 14, 2002 10:47 pm    Post subject: Reply with quote

I'm sorry, MondoNuovo, but what did you say is wrong with this code?

Take a look at what I was running. It's still your basic code. I added a few minor items just to make it easier for me to follow things. Anyway, look it over and let me know what is happening with your code.

Code:

Title Test
  DIALOG CREATE,Test,-1,0,393,196
  DIALOG ADD,LIST,LIST1,16,5,382,142,sorted,click
  DIALOG ADD,BUTTON,Exit,166,324,64,24,Exit
  %z = @sendmsg(@winexists(~list1),$0194,400,0)
rem --  I intentionally created a &Programs key for testing purposes
  list regkeys,list1,CURUSER,Software\Microsoft\Windows\CurrentVersion\Explorer\Menuorder\Start Menu\&Programs
  DIALOG SHOW
 
:CancelMENU
:Evloop
  wait event
  goto @event()
 
:list1click
rem --  Added Cancel in case the user changes his/her mind
  dialog popup,Delete|Cancel
  goto evloop

:DeleteMenu
rem --  To be used later
  %%index = @index(list1)
rem --  The following is the code for Deleting that you posted -- What's wrong with it?  It works for me
rem --  It doesn't delete the entire &Programs, only the item selected when I tested it
  registry delete,CURUSER,Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\&Programs\@item(list1)
rem --  The rest of this is just cosmetic stuffs.  I had a lot of things in the list and I wanted to be able
rem --  to go back to where I had my test subkeys and see the results right away
  list clear,list1
  list regkeys,list1,CURUSER,Software\Microsoft\Windows\CurrentVersion\Explorer\Menuorder\Start Menu\&Programs
  if @greater(@count(list1),0)
    list seek,list1,@pred(%%index)
  end
  goto evloop

:ExitBUTTON
:Close
  exit


Sylvester

_________________
Sylvester

In the immortal words of the great philosopher, Homer ... "D'OH!!!" 8O
Back to top
View user's profile Send private message Send e-mail MSN Messenger
MondoNuovo
Valued Newbie


Joined: 09 Jul 2001
Posts: 44
Location: Italy

PostPosted: Fri Mar 15, 2002 1:48 am    Post subject: Reply with quote

Thanks Sylvester,
my code was not exact because I had omitted

%%index = @index(list1).

Your help is always big.

Thanks again.
Daniele Very Happy
Back to top
View user's profile Send private message Send e-mail
Sylvester
Valued Newbie


Joined: 31 Jul 2000
Posts: 43
Location: Boston, MA USA

PostPosted: Fri Mar 15, 2002 2:36 am    Post subject: Reply with quote

MondoNuovo wrote:
Thanks Sylvester,
my code was not exact because I had omitted

%%index = @index(list1).

Your help is always big.

Thanks again.
Daniele Very Happy


Hi Daniele,

Actually, %%index = @index(list1) is not needed in the code. The code will work fine without it. The reason I have it there is to use it in what I had marked as "cosmetic stuff" section.

Code:

rem --  The rest of this is just cosmetic stuffs.  I had a lot of things in the list and I wanted to be able
rem --  to go back to where I had my test subkeys and see the results right away
  list clear,list1
  list regkeys,list1,CURUSER,Software\Microsoft\Windows\CurrentVersion\Explorer\Menuorder\Start Menu\&Programs
  if @greater(@count(list1),0)
    list seek,list1,@pred(%%index)
  end
  goto evloop


My Programs key has a lot of items in it. I needed it to hold the location of the deleted item on the list so I can come back after reloading the list ("refresh") and place the highlight on the location just above where the deleted item used to be.

Nonetheless, I am happy you can find what I posted useful. Good luck with the rest of your code. Smile

Sylvester

_________________
Sylvester

In the immortal words of the great philosopher, Homer ... "D'OH!!!" 8O
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group