I'm stuck again. In one of the previous topics(recently, 2-3 days ago), I already wrote about jumping to the desired registry subkey(editing the "Lastkey" parameter). That method is fine, but only when regedit hasn't been opened yet. So, I need a second method that won't restart regedit every time I change the key. Otherwise it will be very flickering and annoying. And again the problem is related to win8.1 x64. I don't have this system on my home PC, so debugging is very slow. And every time I get another surprise.
I found some old code that does what I'm talking about. But not for win8.1 x64. I was very surprised because it works great on my win7 x86. I don't understand what else I need to do to make this work? After all, there is nothing supernatural here.
Can someone test this code on their x64 OS? And if that doesn't work, then fix it, please. Let me know. I just can't finish one of my small programs. I don't want it to be so raw.
By the way, Mark Russinovich uses the same approach, if I'm not mistaken. And he is a Windows expert(works for MS).
Here is the code:
Code: Select all
hReg = FindWindow_("Regedit_Regedit", 0)
Debug hReg
If hReg
ShowWindow_(hReg, #SW_SHOWNORMAL)
SetForegroundWindow_(hReg)
hTree = FindWindowEx_(hReg, 0, "SysTreeView32", 0)
Debug hTree
If hTree
idx = SendMessage_(hTree, #TVM_GETNEXTITEM, #TVGN_ROOT, 0)
Sleep_(50)
Debug idx
If idx
SendMessage_(hTree, #TVM_SELECTITEM, #TVGN_CARET, idx)
Sleep_(50)
sKey.s = "HKEY_CLASSES_ROOT\exefile\Excelxmlss"
Debug sKey
lKeyLen = Len(sKey)
sChar.s = ""
For idx = 1 To lKeyLen
sChar = Mid(sKey, idx, 1)
If sChar = "\"
SendMessage_(hTree, #WM_KEYDOWN, #VK_RIGHT, $014D0001)
SendMessage_(hTree, #WM_KEYUP, #VK_RIGHT, $C14D0001)
Else
SendMessage_(hTree, #WM_CHAR, Asc(sChar), $00230001)
EndIf
Sleep_(5)
Next
EndIf
EndIf
EndIf
Thank you in advance.