[SOURCE-CODE] Real D3D Menu en VB.NET

Iniciado por **Aincrad**, 12 Abril 2019, 03:19 AM

0 Miembros y 2 Visitantes están viendo este tema.

**Aincrad**

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

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






BloodSharp

Cita de: **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 :

¿Probaste esto?

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


B#



**Aincrad**

#2
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 (vbnet) [Seleccionar]
Imports System

Public Class ACCENTPOLICY

    Public nAccentState As Integer

    Public nFlags As Integer

    Public nColor As Integer

    Public nAnimationId As Integer
End Class

Public Class WINCOMPATTRDATA

    Public nAttribute As Integer

    Public pData As Object

    Public ulDataSize As UInteger
End Class

Public Class Funcs

    Public Delegate Function pSetWindowCompositionAttribute(ByVal UnnamedParameter As System.IntPtr, ByVal UnnamedParameter2 As WINCOMPATTRDATA) As Boolean


    Friend Declare Function SetWindowCompositionAttribute Lib "user32.dll" (ByVal UnnamedParameter As System.IntPtr, ByVal UnnamedParameter2 As WINCOMPATTRDATA) As Boolean

    Public Shared Sub SetWindowTransparent(ByVal hWnd As IntPtr)
        Dim hModule As IntPtr = New IntPtr
        If hModule Then
            Dim SetWindowCompositionAttribute As pSetWindowCompositionAttribute = SetWindowCompositionAttribute
            If (Not (SetWindowCompositionAttribute) Is Nothing) Then
                Dim policy As ACCENTPOLICY = New ACCENTPOLICY
                ' ACCENT_ENABLE_TRANSPARENTGRADIENT=2...
                Dim data As WINCOMPATTRDATA = New WINCOMPATTRDATA
                ' WCA_ACCENT_POLICY=19
                SetWindowCompositionAttribute(hWnd, data)
            End If

        End If

    End Sub

End Class



Form1.vb


Código (vbnet) [Seleccionar]
Imports WindowsApplication4.ACCENTPOLICY

Public Class Form1


    Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As IntPtr
    Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As IntPtr, ByRef lpdwProcessId As Integer) As Integer
    Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As IntPtr
    Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As IntPtr) As Integer
    Public Const PROCESS_VM_ALL As Integer = &H1F0FFF
    Public hWnd As IntPtr, pHandle As IntPtr, processID As Integer
    Const ProcessName As String = "hl2"


    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        If ProcessHack() = 1 Then
            WindowsApplication4.Funcs.SetWindowTransparent(pHandle)
        End If

    End Sub

    Private Function ProcessHack() As Integer
        Dim proc As Process() = Process.GetProcessesByName(ProcessName)
        Dim windowname As String
        windowname = proc(0).MainWindowTitle
        hWnd = FindWindow(vbNullString, windowname)
        GetWindowThreadProcessId(hWnd, processID)
        pHandle = OpenProcess(PROCESS_VM_ALL, 0, processID)
        If hWnd = 0 Then
            Return 0
        Else
            Return 1
        End If
    End Function


End Class


Bueno al menos lo intente .-.