Registry problem

Frogger

Member
Licensed User
Longtime User
Can somebody tell me what's wrong with the following please?

B4X:
reg.New1
      reg.RootKey(reg.rtCurrentUser)
 reg.SetDWordValue("Software\Microsoft\Today\Items\HTC Sense", "Enabled", 1)

Thank you.
 
Last edited:

Frogger

Member
Licensed User
Longtime User
Hi, what is the error returned?

Thanks very much for the reply.

This is the error I get:

snapshot1y.jpg



Maybe the path is wrong or the Key is not created yet...

Nope, here's the key in the registry:

captureye.jpg


Anyone any ideas please?
 

Frogger

Member
Licensed User
Longtime User
Shouldn't your root key be "rtLocalMachine" as indicated on the status line of your screenshot?

Ah, :signOops: Yes, more than likely.

Sorry about that <embarrassed> I'll try again...

My only (poor) excuse is that I'm a total newbie to B4PPC.

Thank you.

EDIT: It's working now of course - no errors.

Now, can somebody tell me how to refresh the Today screen please?
 
Last edited:

Frogger

Member
Licensed User
Longtime User
Oh, another problem :(

I've just tried to switch HTC Sense off with:

B4X:
reg.New1
      reg.RootKey(reg.rtLocalMachine)
   reg.SetDWordValue("Software\Microsoft\Today\Items\HTC Sense", "Enabled", 0)

But it doesn't switch off. Why?
 

Frogger

Member
Licensed User
Longtime User
Try rebooting the device.

Yeah, that'd work but I really want to avoid that. I know that in Mortscript you can switch Sense off with that registry key, refresh the today screen and it switches off. B4PPC must be able to some how, mustn't it?
 

Frogger

Member
Licensed User
Longtime User
You can try sending the WM_SETTINGCHANGE message.
You should use the PostMessage method of dzt's library: http://www.b4x.com/forum/additional-libraries/384-useful-library-2.html#post2809
Call it with the following parameters:
B4X:
PostMessage(65535, 26, 0, 0)

I've just tried this:

B4X:
Sub RestartSense
reg.New1
      reg.RootKey(reg.rtLocalMachine)
      reg.SetDWordValue("Software\Microsoft\Today\Items\HTC Sense", "Enabled", 0)
          dzh.New1
        dzh.PostMessage(65535,26,0,0)
        End Sub

But it didn't shut down Sense :( Am I doing this right?

Many thanks
 

sitajony

Active Member
Licensed User
B4X:
PostMessage(65535, 26, 0, 0)
Maybe it's not the same Window Handler on your device...
Try to write this:
B4X:
If dzhw.PostMessage(65535, 26, 0, 0) Then
    Msgbox("Ok!")
Else
    Msgbox("Error...")
End If
If it return Error so the Window Handler field is not correct...
 

Frogger

Member
Licensed User
Longtime User
B4X:
PostMessage(65535, 26, 0, 0)
Maybe it's not the same Window Handler on your device...
Try to write this:
B4X:
If dzhw.PostMessage(65535, 26, 0, 0) Then
    Msgbox("Ok!")
Else
    Msgbox("Error...")
End If
If it return Error so the Window Handler field is not correct...

Thanks for your help. It returns "Ok!", but Sense still doesn't switch off :(

Any ideas?

Thank you.
 

Frogger

Member
Licensed User
Longtime User
Arrggh! There must be a way of doing this, but I've searched everywhere and can't find a solution :(
 
Top