I've been googling. experimenting, inventing and nothing has worked so far.
What I'm attempting to do, is draw directly to screen display. I get the feeling this could be impossible so my first question is, "Is this possible or not?". If so, my second question is "How?"
I've been trying for a while, attempting to create a device context for the screen display. But I don't know if this is even the right approach to go for. Here's what I've been working with atm.
[php]
Imports System.Runtime****teropServices
Public Class Form1
Dim ScreenDC As IntPtr
<DllImport("Gdi32.dll")> _
Public Shared Function CreateDC(ByVal driverName As String, ByVal deviceName As String, ByVal output As String, ByVal lpInitData As IntPtr) As IntPtr
End Function
<DllImport("Gdi32.dll")> _
Public Shared Function DeleteDC(ByVal dc As IntPtr) As Boolean
End Function
Dim sWidth = Screen.PrimaryScreen.Bounds.Width
Dim sHeight = Screen.PrimaryScreen.Bounds.Height
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
DeleteDC(ScreenDC)
End Sub
End Class
[/php]
I've been trying to adapt snippets i've used for various other projects I've made over time and somehow get this to work. (i.e the ScreenDC was something I used for a ScreenScanner a while back)
At the moment I'm trying to draw pretty much a crosshair on the screen, nothing happens however when I press Button1. I wasn't fully expecting this code to work, but I'm out of ideas.
Anyone got an idea of how to go about this?
Cheers,
J-Deezy.
Well it possible... I remember i did it, i got the source from Zoom so.. Ask him
make a transparent forum
/ just an idea
That is a good idea ^
Make a transparent full screen form and just draw on that..
He needs it to be working in DirectX Game...
Drawing direct to screen can cause Flicker? Use double buffer? /
Originally Posted by Golden.
That is a good idea ^
Make a transparent full screen form and just draw on that..
Lol, you can't be serious. That wouldn't work for anything fullscreen.
Ontopic: I can draw direct to the DirectX Game by obtaining the window handle and then drawing to the window handle, however the game renders frames too fast and seeing as I haven't hooked anything my crosshair just flickers hell bad. So either I need to draw direct to screen display or figure out how to hook to Endscene with VB