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 


Hotkey & Regread

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Tue Jun 14, 2005 7:52 pm    Post subject: Hotkey & Regread Reply with quote

I wannna set a hotkey for a program. Works, but if I use REGREAD to poll for a registry key that does not exist yet,
HOTKEY fails. Try this:

Code:
DIALOG CREATE,New Dialog,-1,0,240,160
DIALOG SHOW
 
REM Hotkey fails íf the next line is run
    %%regkey = @equal(@REGREAD(CURUSER,SOFTWARE\somecompany\key,value,1),1)
    HOTKEY ADD,Ctrl+F9
    if @not(@ok())
      warn Hotkey not activated!
    end


If the registry key is there, no problem.

Greetz
Dr. Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Wed Jun 15, 2005 3:43 am    Post subject: Reply with quote

%%regkey = @equal(@REGREAD(CURUSER,SOFTWARE\somecompany\key,value,1),1)

The above statement is false

Try
Code:

DIALOG CREATE,New Dialog,-1,0,240,160
  DIALOG SHOW

  If @regexists(CURUSER,SOFTWARE\somecompany\key,value)
    if @not(@equal(@REGREAD(CURUSER,SOFTWARE\somecompany\key,value,1),1))
     warn Key value not 1
    end
   else
     warn Key doesn't exist
   end
  HOTKEY ADD,Ctrl+F9
  if @not(@ok())
    warn Hotkey not activated!
  end
  exit
Back to top
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Wed Jun 15, 2005 6:07 am    Post subject: Reply with quote

Aslan wrote:
%%regkey = @equal(@REGREAD(CURUSER,SOFTWARE\somecompany\key,value,1),1)

The above statement is false


Aaah, yeah. Forgot to remove the @equal() part when simplifying things for the example.
So it should be something like this.

Code:
  DIALOG CREATE,New Dialog,-1,0,240,160
  DIALOG SHOW

  rem Hotkey fails íf the next line is run
  %%regkey = @REGREAD(CURUSER,SOFTWARE\somecompany\key,value,1)
  HOTKEY ADD,Ctrl+F9
  if @not(@ok())
    warn Hotkey not activated!
  else
    info Hotkey OK!
  end


It is probably a good idea to use REGEXISTS to check the key in advance. But I still think that it
is a bug when you cannot use REGREAD directly coz it actually is supplied with the default value 1 to be
returned if the specified key does not exist.

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports 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