Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Wed Mar 11, 2020 10:00 pm Post subject: FindWindow (user32.dll vs CE default) |
|
|
I try to implementing window API lib. user32.FindWindow() to compare with CE default FindWindow function.
Example:
Code: | function findwindow(sClassName, sAppName)
return executeCodeLocalEx('user32.FindWindow', sClassName, sAppName)
end
function setforegroundwindow(hWnd)
return executeCodeLocalEx('user32.SetForegroundWindow', hWnd)
end
function enumchildwindows(hWndParent, Delegate, lpEnumFunc, lParam)
return executeCodeLocalEx('user32.EnumChildWindows', hWndParent, Delegate, lpEnumFunc, lParam)
end
function getwindowtext(hWnd, s, nMaxCount) -- s = stringBuilder
return executeCodeLocalEx('user32.GetWindowText', hWnd, s, nMaxCount)
end
function getwindowtextlength(hWnd)
return executeCodeLocalEx('user32.GetWindowTextLength', hWnd)
end
function getgesktopwindow()
EntryPoint="GetDesktopWindow"
return executeCodeLocalEx('user32.GetDesktopWindow', EntryPoint)
end
function MessageBox(title,text,uType)
return executeCodeLocalEx("user32.MessageBoxA", MainForm.Handle, text, title, uType)
end
--- Applies to example
appform = createForm()
appform.setSize(200,100)
appform.Caption = 'Find Window'
appform.Position = 'poScreenCenter'
editbox = createEdit(appform)
editbox.setPosition(10,10)
editbox.setSize(180,30)
editbox.Text =""
button1 = createButton(appform)
button1.setPosition(50,60)
button1.setSize(100,30)
button1.Caption = 'Execute'
--- Variables and functions
function findWnds()
local txt = editbox.Text
if txt == "" then return nil end
local CallingWindow = findwindow(nil, txt)
local txtValue = getwindowtext(CallingWindow, txt, 256)
MessageBox(tostring(txtValue), "Contains text of control : "..txt, 1)
return 1
end
function clearance()
closeCE()
return caFree
end
--- Event
appform.show()
appform.OnClose = clearance
button1.OnClick = findWnds
|
But when execute the function, I got this error: "Error: Failure determining what user32.FindWindow means"
Why executeCodeLocalEx('user32.FindWindow', sClassName, sAppName) not identified by CE?
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|