Hello,
I want to call api to change registry in ppc because in CF.Net have not class to do this. I tried many idea for a long time. But also get a System.NotSupportedExcepion. Where have error?
This is my code.And running in Ppc Emu 2002.
Code:
Imports System
Imports System.Runtime.InteropServices
Public Class Form1
Inherits System.Windows.Forms.Form
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
--Windows Form Designer generated code--
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MsgBox(OpenMySubKey)
End Sub
<DllImport("coredll.dll", SetLastError:=True)> _
Public Shared Function RegOpenKey(ByVal hkey As IntPtr, ByVal lpSubKey As String, _
ByRef hkeyResult As IntPtr) As Long
End Function
Public Function OpenMySubKey() As Long
Dim HKEY_CLASSES_ROOT As IntPtr = New IntPtr(&H80000001)
Dim hkey As IntPtr = IntPtr.Zero
Return RegOpenKey(HKEY_CLASSES_ROOT, "MySubKey", hkey) 'When running here,i get System.NotSupportedException.
End Function 'OpenMySubKey
End Class
Please help me...