CommandButton
na tela principal:
Sub btnOnMainScreen_Click()
Dim flags: flags = 1 + 2 + 16 + 64 + 256 + 512 + 2048
Dim retval
Dim wsh
Set wsh = CreateObject("WScript.Shell")
Application.DoModal "NOME_TELA_MODAL??0", , , , , , , flags
On Error Resume Next
' Faz a leitura do registro '
retval = wsh.RegRead("HKCU\appname\section\key")
If Err Then
MsgBox "Falha ao tentar ler registro.", vbCritical
Else
' Retorno do input da tela modal com sucesso '
MsgBox retval
End If
End Sub
DrawString
na tela modal, onde o usuário entra com a nota de texto:
Sub txtUserInput_Validate(Cancel, NewValue)
Dim wsh
Set wsh = CreateObject("WScript.Shell")
wsh.RegWrite "HKCU\appname\section\key", NewValue
End Sub
