Xeno-rat
Loading...
Searching...
No Matches
Hidden_handler.Imaging_handler Class Reference
Collaboration diagram for Hidden_handler.Imaging_handler:

Classes

struct  RECT
 

Public Member Functions

 Imaging_handler (string DesktopName)
 
void Dispose ()
 Disposes the resources associated with the current object.
 
Bitmap Screenshot ()
 Takes a screenshot of the desktop and returns it as a Bitmap.
 

Public Attributes

IntPtr Desktop = IntPtr.Zero
 

Private Types

enum  DESKTOP_ACCESS : uint {
  DESKTOP_NONE = 0 , DESKTOP_READOBJECTS = 0x0001 , DESKTOP_CREATEWINDOW = 0x0002 , DESKTOP_CREATEMENU = 0x0004 ,
  DESKTOP_HOOKCONTROL = 0x0008 , DESKTOP_JOURNALRECORD = 0x0010 , DESKTOP_JOURNALPLAYBACK = 0x0020 , DESKTOP_ENUMERATE = 0x0040 ,
  DESKTOP_WRITEOBJECTS = 0x0080 , DESKTOP_SWITCHDESKTOP = 0x0100 , GENERIC_ALL
}
 
enum  GetWindowType : uint {
  GW_HWNDFIRST = 0 , GW_HWNDLAST = 1 , GW_HWNDNEXT = 2 , GW_HWNDPREV = 3 ,
  GW_OWNER = 4 , GW_CHILD = 5 , GW_ENABLEDPOPUP = 6
}
 
enum  DeviceCap { VERTRES = 10 , DESKTOPVERTRES = 117 }
 

Private Member Functions

static IntPtr GetDC (IntPtr hWnd)
 Retrieves a handle to a device context (DC) for the entire window, including title bar, menus, and scroll bars. A window device context permits painting anywhere in a window, because the origin of the device context is the upper-left corner of the window instead of the client area.
 
static bool SetThreadDesktop (IntPtr hDesktop)
 Sets the desktop of the calling thread to the specified desktop.
 
static IntPtr OpenDesktop (string lpszDesktop, int dwFlags, bool fInherit, uint dwDesiredAccess)
 Opens the specified desktop object.
 
static IntPtr CreateDesktop (string lpszDesktop, IntPtr lpszDevice, IntPtr pDevmode, int dwFlags, uint dwDesiredAccess, IntPtr lpsa)
 Creates a new desktop with the specified name and returns a handle to the desktop.
 
static IntPtr GetDesktopWindow ()
 Retrieves a handle to the desktop window. The desktop window covers the entire screen. The desktop window is the area on top of which other windows are painted.
 
static bool GetWindowRect (IntPtr hwnd, out RECT lpRect)
 Retrieves the dimensions of the bounding rectangle of the specified window.
 
static bool IsWindowVisible (IntPtr hWnd)
 Determines whether the specified window is visible.
 
static bool PrintWindow (IntPtr hwnd, IntPtr hDC, uint nFlags)
 The PrintWindow function retrieves the contents of a window or control that is currently being displayed on the screen.
 
static IntPtr GetWindow (IntPtr hWnd, GetWindowType uCmd)
 Retrieves a handle to the window that has the specified relationship to the specified window.
 
static IntPtr GetTopWindow (IntPtr hWnd)
 Retrieves a handle to the top-level window whose class name and window name match the specified strings.
 
static bool ReleaseDC (IntPtr hWnd, IntPtr hDC)
 Releases the device context (DC) that is associated with a specific window.
 
static IntPtr CreateCompatibleDC (IntPtr hdc)
 Creates a memory device context (DC) compatible with the specified device.
 
static IntPtr CreateCompatibleBitmap (IntPtr hdc, int nWidth, int nHeight)
 Creates a bitmap compatible with the specified device context (DC) and returns a handle to the bitmap.
 
static IntPtr SelectObject (IntPtr hdc, IntPtr hgdiobj)
 Selects an object into the specified device context (DC).
 
static bool DeleteObject (IntPtr hObject)
 Deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object.
 
static bool DeleteDC (IntPtr hdc)
 Deletes a device context (DC) from memory.
 
static bool CloseDesktop (IntPtr hDesktop)
 Closes the specified desktop.
 
static int GetDeviceCaps (IntPtr hdc, int nIndex)
 Retrieves device-specific information for the specified device.
 
bool DrawApplication (IntPtr hWnd, Graphics ModifiableScreen, IntPtr DC)
 Captures the application window and draws it on the specified graphics object.
 
void DrawTopDown (IntPtr owner, Graphics ModifiableScreen, IntPtr DC)
 Draws the windows from top to bottom on the screen.
 
void DrawHwnd (IntPtr hWnd, Graphics ModifiableScreen, IntPtr DC)
 Draws the specified window on the given graphics object using the provided device context.
 

Static Private Member Functions

static float GetScalingFactor ()
 Retrieves the scaling factor of the screen.
 

Member Enumeration Documentation

◆ DESKTOP_ACCESS

Enumerator
DESKTOP_NONE 
DESKTOP_READOBJECTS 
DESKTOP_CREATEWINDOW 
DESKTOP_CREATEMENU 
DESKTOP_HOOKCONTROL 
DESKTOP_JOURNALRECORD 
DESKTOP_JOURNALPLAYBACK 
DESKTOP_ENUMERATE 
DESKTOP_WRITEOBJECTS 
DESKTOP_SWITCHDESKTOP 
GENERIC_ALL 

◆ DeviceCap

Enumerator
VERTRES 
DESKTOPVERTRES 

◆ GetWindowType

Enumerator
GW_HWNDFIRST 
GW_HWNDLAST 
GW_HWNDNEXT 
GW_HWNDPREV 
GW_OWNER 
GW_CHILD 
GW_ENABLEDPOPUP 

Constructor & Destructor Documentation

◆ Imaging_handler()

Hidden_handler.Imaging_handler.Imaging_handler ( string DesktopName)
inline
Here is the call graph for this function:

Member Function Documentation

◆ CloseDesktop()

static bool Hidden_handler.Imaging_handler.CloseDesktop ( IntPtr hDesktop)
private

Closes the specified desktop.

Parameters
hDesktopA handle to the desktop to be closed.
Returns
true if the function succeeds; otherwise, false.

This method closes the desktop identified by the handle hDesktop .

Here is the caller graph for this function:

◆ CreateCompatibleBitmap()

static IntPtr Hidden_handler.Imaging_handler.CreateCompatibleBitmap ( IntPtr hdc,
int nWidth,
int nHeight )
private

Creates a bitmap compatible with the specified device context (DC) and returns a handle to the bitmap.

Parameters
hdcA handle to the device context (DC) of a window or a printer.
nWidthThe width, in pixels, of the bitmap.
nHeightThe height, in pixels, of the bitmap.
Returns
A handle to the compatible bitmap if the function succeeds; otherwise, NULL.
Here is the caller graph for this function:

◆ CreateCompatibleDC()

static IntPtr Hidden_handler.Imaging_handler.CreateCompatibleDC ( IntPtr hdc)
private

Creates a memory device context (DC) compatible with the specified device.

Parameters
hdcA handle to the device context of the window or printer to be used for the compatible DC.
Returns
A handle to a memory DC if the function is successful; otherwise, returns NULL.

This method creates a memory device context (DC) that is compatible with the specified device context (DC). The memory DC can be used as a target for BitBlt operations.

Here is the caller graph for this function:

◆ CreateDesktop()

static IntPtr Hidden_handler.Imaging_handler.CreateDesktop ( string lpszDesktop,
IntPtr lpszDevice,
IntPtr pDevmode,
int dwFlags,
uint dwDesiredAccess,
IntPtr lpsa )
private

Creates a new desktop with the specified name and returns a handle to the desktop.

Parameters
lpszDesktopThe name of the new desktop.
lpszDeviceReserved; must be NULL.
pDevmodeReserved; must be NULL.
dwFlagsThe desktop creation options. For a list of values, see https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-createdesktopw.
dwDesiredAccessThe access to the desktop. For a list of values, see https://docs.microsoft.com/en-us/windows/win32/secauthz/access-mask.
lpsaReserved; must be NULL.
Returns
A handle to the newly created desktop. If the function fails, it returns NULL. To get extended error information, call GetLastError.
Exceptions
System.ComponentModel.Win32ExceptionThrown when the function fails to create the desktop. The exception contains the error code returned by GetLastError.
Here is the caller graph for this function:

◆ DeleteDC()

static bool Hidden_handler.Imaging_handler.DeleteDC ( IntPtr hdc)
private

Deletes a device context (DC) from memory.

Parameters
hdcA handle to the device context (DC) to be deleted.
Returns
True if the device context (DC) is successfully deleted; otherwise, false.
Here is the caller graph for this function:

◆ DeleteObject()

static bool Hidden_handler.Imaging_handler.DeleteObject ( IntPtr hObject)
private

Deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object.

Parameters
hObjectA handle to the object to be deleted.
Returns
true if the function succeeds, false if the function fails.
Here is the caller graph for this function:

◆ Dispose()

void Hidden_handler.Imaging_handler.Dispose ( )
inline

Disposes the resources associated with the current object.

This method closes the desktop associated with the current object and performs garbage collection to release any remaining resources.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DrawApplication()

bool Hidden_handler.Imaging_handler.DrawApplication ( IntPtr hWnd,
Graphics ModifiableScreen,
IntPtr DC )
inlineprivate

Captures the application window and draws it on the specified graphics object.

Parameters
hWndA handle to the window to be captured.
ModifiableScreenThe graphics object on which the captured window will be drawn.
DCA handle to the device context of the window.
Returns
True if the window was successfully captured and drawn; otherwise, false.

This method captures the specified window using the PrintWindow function and draws it on the specified graphics object. It also takes into account the scaling factor to ensure proper rendering on high DPI displays.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DrawHwnd()

void Hidden_handler.Imaging_handler.DrawHwnd ( IntPtr hWnd,
Graphics ModifiableScreen,
IntPtr DC )
inlineprivate

Draws the specified window on the given graphics object using the provided device context.

Parameters
hWndThe handle to the window to be drawn.
ModifiableScreenThe graphics object on which the window will be drawn.
DCThe device context used for drawing.

This method checks if the specified window is visible. If it is, it proceeds to draw the application associated with the window using the provided graphics object and device context. If the operating system version is less than 6, it also draws the top-down view of the window.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DrawTopDown()

void Hidden_handler.Imaging_handler.DrawTopDown ( IntPtr owner,
Graphics ModifiableScreen,
IntPtr DC )
inlineprivate

Draws the windows from top to bottom on the screen.

Parameters
ownerThe handle to the owner window.
ModifiableScreenThe graphics object representing the screen.
DCThe device context handle.

This method retrieves the top window owned by the specified owner window and draws each window from top to bottom on the screen using the specified graphics object and device context handle.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDC()

static IntPtr Hidden_handler.Imaging_handler.GetDC ( IntPtr hWnd)
private

Retrieves a handle to a device context (DC) for the entire window, including title bar, menus, and scroll bars. A window device context permits painting anywhere in a window, because the origin of the device context is the upper-left corner of the window instead of the client area.

Parameters
hWndA handle to the window with a device context that is to be retrieved.
Returns
If the function succeeds, the return value is a handle to the device context for the specified window. If the function fails, the return value is IntPtr.Zero.
Here is the caller graph for this function:

◆ GetDesktopWindow()

static IntPtr Hidden_handler.Imaging_handler.GetDesktopWindow ( )
private

Retrieves a handle to the desktop window. The desktop window covers the entire screen. The desktop window is the area on top of which other windows are painted.

Returns
A handle to the desktop window.
Here is the caller graph for this function:

◆ GetDeviceCaps()

static int Hidden_handler.Imaging_handler.GetDeviceCaps ( IntPtr hdc,
int nIndex )
private

Retrieves device-specific information for the specified device.

Parameters
hdcA handle to the device context.
nIndexThe value to be retrieved.
Returns
The return value specifies the value of the desired capability.
Here is the caller graph for this function:

◆ GetScalingFactor()

static float Hidden_handler.Imaging_handler.GetScalingFactor ( )
inlinestaticprivate

Retrieves the scaling factor of the screen.

Returns
The scaling factor of the screen.

This method retrieves the scaling factor of the screen by comparing the logical and physical screen heights. It uses the Graphics class to obtain the device context of the desktop and then calculates the scaling factor using the obtained heights. The scaling factor is then returned as a float value.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTopWindow()

static IntPtr Hidden_handler.Imaging_handler.GetTopWindow ( IntPtr hWnd)
private

Retrieves a handle to the top-level window whose class name and window name match the specified strings.

Parameters
hWndA handle to a window. The search for a child window begins at this window and proceeds through child windows.
Returns
If the function succeeds, the return value is a handle to the top-level window that matches the specified strings. If the function fails, the return value is NULL.
Here is the caller graph for this function:

◆ GetWindow()

static IntPtr Hidden_handler.Imaging_handler.GetWindow ( IntPtr hWnd,
GetWindowType uCmd )
private

Retrieves a handle to the window that has the specified relationship to the specified window.

Parameters
hWndA handle to the window whose relationship is to be retrieved.
uCmdThe relationship between the specified window and the window whose handle is to be retrieved.
Returns
If the function succeeds, the return value is a handle to the window that has the specified relationship to the specified window. If the function fails, the return value is NULL. To get extended error information, call GetLastError.
Here is the caller graph for this function:

◆ GetWindowRect()

static bool Hidden_handler.Imaging_handler.GetWindowRect ( IntPtr hwnd,
out RECT lpRect )
private

Retrieves the dimensions of the bounding rectangle of the specified window.

Parameters
hwndA handle to the window.
lpRectA pointer to a RECT structure that receives the screen coordinates of the upper-left and lower-right corners of the window.
Returns
true if the function succeeds, otherwise false.
Exceptions
System.Runtime.InteropServices.ExternalExceptionThrown when the function fails to retrieve the window dimensions.
Here is the caller graph for this function:

◆ IsWindowVisible()

static bool Hidden_handler.Imaging_handler.IsWindowVisible ( IntPtr hWnd)
private

Determines whether the specified window is visible.

Parameters
hWndA handle to the window to be tested.
Returns
true if the specified window is visible, false otherwise.
Here is the caller graph for this function:

◆ OpenDesktop()

static IntPtr Hidden_handler.Imaging_handler.OpenDesktop ( string lpszDesktop,
int dwFlags,
bool fInherit,
uint dwDesiredAccess )
private

Opens the specified desktop object.

Parameters
lpszDesktopThe name of the desktop to be opened.
dwFlagsReserved; set to 0.
fInheritIf this value is TRUE, processes created by this process will inherit the handle. Otherwise, the processes do not inherit this handle.
dwDesiredAccessThe access to the desktop. For a list of access rights, see Desktop Security and Access Rights.
Returns
If the function succeeds, the return value is a handle to the opened desktop. If the function fails, the return value is NULL.
Here is the caller graph for this function:

◆ PrintWindow()

static bool Hidden_handler.Imaging_handler.PrintWindow ( IntPtr hwnd,
IntPtr hDC,
uint nFlags )
private

The PrintWindow function retrieves the contents of a window or control that is currently being displayed on the screen.

Parameters
hwndA handle to the window or control from which to retrieve the contents.
hDCA handle to a device context (DC) for the client area of the window or control.
nFlagsThe drawing options. This parameter can be used to control how the window contents are retrieved.
Returns
If the function succeeds, the return value is true. If the function fails, the return value is false.
Here is the caller graph for this function:

◆ ReleaseDC()

static bool Hidden_handler.Imaging_handler.ReleaseDC ( IntPtr hWnd,
IntPtr hDC )
private

Releases the device context (DC) that is associated with a specific window.

Parameters
hWndA handle to the window whose DC is to be released.
hDCA handle to the DC to be released.
Returns
True if the DC was released successfully; otherwise, false.
Here is the caller graph for this function:

◆ Screenshot()

Bitmap Hidden_handler.Imaging_handler.Screenshot ( )
inline

Takes a screenshot of the desktop and returns it as a Bitmap.

Returns
A Bitmap object representing the screenshot of the desktop.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SelectObject()

static IntPtr Hidden_handler.Imaging_handler.SelectObject ( IntPtr hdc,
IntPtr hgdiobj )
private

Selects an object into the specified device context (DC).

Parameters
hdcA handle to the device context.
hgdiobjA handle to the object to be selected.
Returns
If the selected object is not a region and the function succeeds, the return value is a handle to the object being replaced. If the selected object is a region and the function succeeds, the return value is one of the following: SIMPLEREGION - Region consists of a single rectangle. COMPLEXREGION - Region consists of more than one rectangle. NULLREGION - Region is empty. If an error occurs and the function fails, the return value is NULL.
Here is the caller graph for this function:

◆ SetThreadDesktop()

static bool Hidden_handler.Imaging_handler.SetThreadDesktop ( IntPtr hDesktop)
private

Sets the desktop of the calling thread to the specified desktop.

Parameters
hDesktopA handle to the desktop to be set.
Returns
True if the desktop is successfully set; otherwise, false.
Exceptions
System.ComponentModel.Win32ExceptionThrown when an error occurs while setting the desktop.
Here is the caller graph for this function:

Member Data Documentation

◆ Desktop

IntPtr Hidden_handler.Imaging_handler.Desktop = IntPtr.Zero

The documentation for this class was generated from the following file: