Hola, Bueno mi duda es como haría yo para
Sobreponer Un formulario encima de un juego
Direcx En pantalla Completa, El compañero
@Elektro lo logro con la api de
SharpDX, Bueno yo he logrado casi lo mismo pero Con una
api Direxc , he logrado hasta ahora sobreponer texto y dibujar en juegos en pantalla completa que usan
direcx 9 , Ya puedo Simplemente dibujar un
menu d3d y listo creo las funciones y hago un hack,
pero no logro ni tengo idea de como sobreponer el Formulario. Necesito ayuda en eso.La api que estoy usando : DX9-Overlay-APIDocumentación
Bueno y como siempre, yo no planteo nada sin algo de codigo : Wrapper :
DX9Overlay.vb --- ClaseImports System
Imports System.Runtime.InteropServices
Namespace DX9OverlayAPI
Class DX9Overlay
Public Const PATH As String = "dx9_overlay.dll"
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function TextCreate(ByVal font As String, ByVal fontSize As Integer, ByVal bBold As Boolean, ByVal bItalic As Boolean, ByVal x As Integer, ByVal y As Integer, ByVal color As UInteger, ByVal text As String, ByVal bShadow As Boolean, ByVal bShow As Boolean) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl, CharSet:=CharSet.Unicode)>
Public Shared Function TextCreateUnicode(ByVal font As String, ByVal fontSize As Integer, ByVal bBold As Boolean, ByVal bItalic As Boolean, ByVal x As Integer, ByVal y As Integer, ByVal color As UInteger, ByVal text As String, ByVal bShadow As Boolean, ByVal bShow As Boolean) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function TextDestroy(ByVal id As Integer) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function TextSetShadow(ByVal id As Integer, ByVal b As Boolean) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function TextSetShown(ByVal id As Integer, ByVal b As Boolean) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function TextSetColor(ByVal id As Integer, ByVal color As UInteger) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function TextSetPos(ByVal id As Integer, ByVal x As Integer, ByVal y As Integer) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function TextSetString(ByVal id As Integer, ByVal str As String) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl, CharSet:=CharSet.Unicode)>
Public Shared Function TextSetStringUnicode(ByVal id As Integer, ByVal str As String) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function TextUpdate(ByVal id As Integer, ByVal font As String, ByVal fontSize As Integer, ByVal bBold As Boolean, ByVal bItalic As Boolean) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl, CharSet:=CharSet.Unicode)>
Public Shared Function TextUpdateUnicode(ByVal id As Integer, ByVal font As String, ByVal fontSize As Integer, ByVal bBold As Boolean, ByVal bItalic As Boolean) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function BoxCreate(ByVal x As Integer, ByVal y As Integer, ByVal w As Integer, ByVal h As Integer, ByVal dwColor As UInteger, ByVal bShow As Boolean) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function BoxDestroy(ByVal id As Integer) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function BoxSetShown(ByVal id As Integer, ByVal bShown As Boolean) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function BoxSetBorder(ByVal id As Integer, ByVal height As Integer, ByVal bShown As Boolean) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function BoxSetBorderColor(ByVal id As Integer, ByVal dwColor As UInteger) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function BoxSetColor(ByVal id As Integer, ByVal dwColor As UInteger) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function BoxSetHeight(ByVal id As Integer, ByVal height As Integer) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function BoxSetPos(ByVal id As Integer, ByVal x As Integer, ByVal y As Integer) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function BoxSetWidth(ByVal id As Integer, ByVal width As Integer) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function LineCreate(ByVal x1 As Integer, ByVal y1 As Integer, ByVal x2 As Integer, ByVal y2 As Integer, ByVal width As Integer, ByVal color As UInteger, ByVal bShow As Boolean) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function LineDestroy(ByVal id As Integer) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function LineSetShown(ByVal id As Integer, ByVal bShown As Boolean) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function LineSetColor(ByVal id As Integer, ByVal color As UInteger) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function LineSetWidth(ByVal id As Integer, ByVal width As Integer) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function LineSetPos(ByVal id As Integer, ByVal x1 As Integer, ByVal y1 As Integer, ByVal x2 As Integer, ByVal y2 As Integer) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ImageCreate(ByVal path As String, ByVal x As Integer, ByVal y As Integer, ByVal rotation As Integer, ByVal align As Integer, ByVal bShow As Boolean) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ImageDestroy(ByVal id As Integer) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ImageSetShown(ByVal id As Integer, ByVal bShown As Boolean) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ImageSetAlign(ByVal id As Integer, ByVal align As Integer) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ImageSetPos(ByVal id As Integer, ByVal x As Integer, ByVal y As Integer) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ImageSetRotation(ByVal id As Integer, ByVal rotation As Integer) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function DestroyAllVisual() As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ShowAllVisual() As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function HideAllVisual() As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function GetFrameRate() As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function GetScreenSpecs(<Out> ByRef width As Integer, <Out> ByRef height As Integer) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function SetCalculationRatio(ByVal width As Integer, ByVal height As Integer) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function SetOverlayPriority(ByVal id As Integer, ByVal priority As Integer) As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function Init() As Integer
End Function
<DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub SetParam(ByVal _szParamName As String, ByVal _szParamValue As String)
End Sub
End Class
End Namespace
En el Form1, Un ejemplo de como Dibujar texto, Cuadro o linea : Imports System
Imports DX9OverlayAPI
Public Class Form1
Shared overlayText As Integer = -1
Shared overlayBox As Integer = -1
Shared overlayLine As Integer = -1
Private Sub texto()
DX9Overlay.SetParam("process", "hl2.exe")
DX9Overlay.DestroyAllVisual()
overlayText = DX9Overlay.TextCreateUnicode("Arial", 12, False, False, 200, 200, 4278255615, "Hello world!", True, True)
End Sub
Private Sub linea()
DX9Overlay.SetParam("process", "hl2.exe")
DX9Overlay.DestroyAllVisual()
overlayLine = DX9Overlay.LineCreate(0, 0, 300, 300, 5, 4294967295, True)
End Sub
Private Sub caja()
DX9Overlay.SetParam("process", "hl2.exe")
DX9Overlay.DestroyAllVisual()
overlayBox = DX9Overlay.BoxCreate(200, 200, 100, 100, 1358889215, True)
End Sub
Private Sub eliminarTodo()
DX9Overlay.TextDestroy(overlayText)
DX9Overlay.BoxDestroy(overlayBox)
DX9Overlay.LineDestroy(overlayLine)
End Sub
End Class
Y bueno la .DLL no la agregan a referencias, solo la colocan en donde esta su .exe . osea en la carpeta .\bin\Debug\ DLLGracias de antemano, solo quiero superponer el Formulario no dibujar y no se como hacer eso.
PD : @Elektro Pasaste de Mod. Global a Colaborador? como
@Shell Root? Colaborador no es un rango menor al q tenias?
, que paso? tu eres el que mas ayuda al foro y te bajan de rango. están bien pendejos.