Code: Select all
#classmemory.ahk
StringToHex(String)
{
local Old_A_FormatInteger, CharHex, HexString
If !String
Return 0
Old_A_FormatInteger := A_FormatInteger
SetFormat, INTEGER, H
Loop, Parse, String
{
CharHex := Asc(A_LoopField)
StringTrimLeft, CharHex, CharHex, 2
HexString .= CharHex . ","
}
SetFormat, INTEGER, %Old_A_FormatInteger%
Return HexString
}
GuiControlGet,name ; < Edit Get. For example, "Michael"
winwait,ahk_class notepad
winget,pid,pid,ahk_class notepad
global pid
notepad := new _ClassMemory("ahk_pid" pid, "", hProcessCopy)
var1=% StringToHex(name) ; << 0x4d,0x69,0x63,0x68,0x61,0x65,0x6c, (Hex value of Michael, And end exist a comma)
StringTrimright,Pattern,var1,1 ; << 0x4d,0x69,0x63,0x68,0x61,0x65,0x6c (Remove the comma at the end)
stringAddress :=var.processPatternScan(,,Pattern) ; << Not recognized.
if stringAdress > 0
{
msgbox found !
}
else
{
msgbox Not Found!
}
stringAddress :=var.processPatternScan(,,Pattern) is not recognized.
and,
aPattern := [ 0x4d,0x69,0x63,0x68,0x61,0x65,0x6c ]
stringAddress := notepad.processPatternScan(,, aPattern*)
This method is not available to me.
because, my case, hex is a variable.
I need help . Please
Below is unsuccessful ones.
stringAddress :=var.processPatternScan(,,Pattern*)
stringAddress :=var.processPatternScan(,,"Pattern")
stringAddress :=var.processPatternScan(,,(Pattern))