Foro de elhacker.net

Programación => .NET (C#, VB.NET, ASP) => Mensaje iniciado por: **Aincrad** en 12 Abril 2019, 03:19 am



Título: [SOURCE-CODE] Real D3D Menu en VB.NET
Publicado por: **Aincrad** en 12 Abril 2019, 03:19 am
Bueno después de buscar en vano como superponer forms en juegos de pantallas completa  y no encontrar nada, Me resigne a usar la api q Comparti hace tiempo : VB.NET Overlay in Games Full Screen (https://foro.elhacker.net/net/vbnet_overlay_in_games_full_screen-t488795.0.html)

Bueno hice un mini menu D3D con ella, Solo funciona con juegos que usan Directx 9.

Obiamente si funciona con los juegos en pantalla completa.

Link : DirectX-Menu-Game (https://github.com/salsoft2111995/DirectX-Menu-Game)

(https://i.ibb.co/0CZfJrm/SAMP-test.png)



Título: Re: [SOURCE-CODE] Real D3D Menu in VB.NET
Publicado por: BloodSharp en 12 Abril 2019, 05:02 am
Bueno después de buscar en vano como superponer forms en juegos de pantallas completa  y no encontrar nada, Me resigne a usar la api q Comparti hace tiempo :

¿Probaste esto?

https://www.unknowncheats.me/forum/counterstrike-global-offensive/318927-overlay-fullscreen.html


B#


Título: Re: [SOURCE-CODE] Real D3D Menu in VB.NET
Publicado por: **Aincrad** en 12 Abril 2019, 05:10 am
ups, no xd. ahora lo pruebo. tal vez mañana. y edito este pots para decir como me fue.

oie tu programas en c++ no? seria genial que se agregara compatibilidad con directx 10 y 11 a esa api xd . es solo un comentario.

Por cierto gracias por comentar



Edición, Probé el code que me pusiste. pero no funciono.

A continuación lo q hice:


Clase - ACCENTPOLICY.vb

Código
  1. Imports System
  2.  
  3. Public Class ACCENTPOLICY
  4.  
  5.    Public nAccentState As Integer
  6.  
  7.    Public nFlags As Integer
  8.  
  9.    Public nColor As Integer
  10.  
  11.    Public nAnimationId As Integer
  12. End Class
  13.  
  14. Public Class WINCOMPATTRDATA
  15.  
  16.    Public nAttribute As Integer
  17.  
  18.    Public pData As Object
  19.  
  20.    Public ulDataSize As UInteger
  21. End Class
  22.  
  23. Public Class Funcs
  24.  
  25.    Public Delegate Function pSetWindowCompositionAttribute(ByVal UnnamedParameter As System.IntPtr, ByVal UnnamedParameter2 As WINCOMPATTRDATA) As Boolean
  26.  
  27.  
  28.    Friend Declare Function SetWindowCompositionAttribute Lib "user32.dll" (ByVal UnnamedParameter As System.IntPtr, ByVal UnnamedParameter2 As WINCOMPATTRDATA) As Boolean
  29.  
  30.    Public Shared Sub SetWindowTransparent(ByVal hWnd As IntPtr)
  31.        Dim hModule As IntPtr = New IntPtr
  32.        If hModule Then
  33.            Dim SetWindowCompositionAttribute As pSetWindowCompositionAttribute = SetWindowCompositionAttribute
  34.            If (Not (SetWindowCompositionAttribute) Is Nothing) Then
  35.                Dim policy As ACCENTPOLICY = New ACCENTPOLICY
  36.                ' ACCENT_ENABLE_TRANSPARENTGRADIENT=2...
  37.                Dim data As WINCOMPATTRDATA = New WINCOMPATTRDATA
  38.                ' WCA_ACCENT_POLICY=19
  39.                SetWindowCompositionAttribute(hWnd, data)
  40.            End If
  41.  
  42.        End If
  43.  
  44.    End Sub
  45.  
  46. End Class
  47.  
  48.  

Form1.vb


Código
  1. Imports WindowsApplication4.ACCENTPOLICY
  2.  
  3. Public Class Form1
  4.  
  5.  
  6.    Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As IntPtr
  7.    Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As IntPtr, ByRef lpdwProcessId As Integer) As Integer
  8.    Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As IntPtr
  9.    Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As IntPtr) As Integer
  10.    Public Const PROCESS_VM_ALL As Integer = &H1F0FFF
  11.    Public hWnd As IntPtr, pHandle As IntPtr, processID As Integer
  12.    Const ProcessName As String = "hl2"
  13.  
  14.  
  15.    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  16.  
  17.        If ProcessHack() = 1 Then
  18.            WindowsApplication4.Funcs.SetWindowTransparent(pHandle)
  19.        End If
  20.  
  21.    End Sub
  22.  
  23.    Private Function ProcessHack() As Integer
  24.        Dim proc As Process() = Process.GetProcessesByName(ProcessName)
  25.        Dim windowname As String
  26.        windowname = proc(0).MainWindowTitle
  27.        hWnd = FindWindow(vbNullString, windowname)
  28.        GetWindowThreadProcessId(hWnd, processID)
  29.        pHandle = OpenProcess(PROCESS_VM_ALL, 0, processID)
  30.        If hWnd = 0 Then
  31.            Return 0
  32.        Else
  33.            Return 1
  34.        End If
  35.    End Function
  36.  
  37.  
  38. End Class

Bueno al menos lo intente .-.