mirror of
https://github.com/vxunderground/VX-API
synced 2026-06-06 16:54:55 +00:00
Create RfGetCurrentWindowText.cpp
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
DWORD RfGetCurrentWindowTextA(DWORD nBufferLength, PCHAR lpBuffer)
|
||||
{
|
||||
PRTL_USER_PROCESS_PARAMETERS ProcessParameters = GetPeb()->ProcessParameters;
|
||||
|
||||
if (nBufferLength < ProcessParameters->WindowTitle.Length)
|
||||
return ERROR_FAILURE_RETURN;
|
||||
|
||||
return (DWORD)WCharStringToCharString(lpBuffer, ProcessParameters->WindowTitle.Buffer, ProcessParameters->WindowTitle.MaximumLength);
|
||||
}
|
||||
|
||||
DWORD RfGetCurrentWindowTextW(DWORD nBufferLength, PWCHAR lpBuffer)
|
||||
{
|
||||
PRTL_USER_PROCESS_PARAMETERS ProcessParameters = GetPeb()->ProcessParameters;
|
||||
|
||||
if (nBufferLength < ProcessParameters->WindowTitle.Length)
|
||||
return ERROR_FAILURE_RETURN;
|
||||
|
||||
if (StringCopyW(lpBuffer, ProcessParameters->WindowTitle.Buffer) == NULL)
|
||||
return ERROR_FAILURE_RETURN;
|
||||
|
||||
return ProcessParameters->WindowTitle.Length;
|
||||
}
|
||||
Reference in New Issue
Block a user