simple problem all i need to do is create a function to draw the system time over battlefield 3. i have this so far that will draw over firefox, but bf3 seems to just ignore this and it doesnt show up when ingame Code: Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim time As String = Now.ToShortTimeString Call DrawOverlay(time) End Sub Code: Private Shared Sub DrawOverlay(ByVal OverlayString As String) Dim Processes = Process.GetProcessesByName("firefox") Dim deviceContext As Graphics = Graphics.FromHwnd(Processes(0).MainWindowHandle) Dim drawFont As New Font("Arial", 14, FontStyle.Bold) Dim myBrush As New Drawing2D.LinearGradientBrush(deviceContext.ClipBounds, Color.Black, Color.SkyBlue, Drawing2D.LinearGradientMode.Horizontal) Dim drawFormat As New StringFormat() drawFormat.FormatFlags = StringFormatFlags.NoFontFallback deviceContext.DrawString(OverlayString, drawFont, myBrush, 100, 100, drawFormat) End Sub Code: Public Function IsProcessRunning(ByVal name As String) As Boolean 'here we're going to get a list of all running processes on 'the computer For Each clsProcess As Process In Process.GetProcesses() If clsProcess.ProcessName.StartsWith(name) Then 'process found so it's running so return true Return True End If Next 'process not found, return false Return False End Function Code: Private Sub update_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles update.Tick If IsProcessRunning("firefox") = True Then Dim time As String = Now.ToShortTimeString Call DrawOverlay(time) End If End Sub End Class all of this is not my code it is the result of lots of googling and a few edits
Hmm, some Games with newer protection platforms have a tendancy to kick out unsigned code. Have you looked into this? And does it run on Games for Windows Live?
i have not looked into the signed code any idea on implementation (i will look into), i do not run games for windows live so i would not know EDIT: alright just looked into this code signing thing and well, i don't get it, what would i have to do to call it "signed"
think im making progress i've found this :http://www.mikoweb.eu/index.php?node=21 and this http://www.vbforums.com/archive/index.php/t-352428.html
Are you implimenting the code by placing it into the game, or drawing it in your code and forcing it on top of all active windows?
my plan is to just draw over but if i could pace it into the game that would be ideal, but i have never done any type of injection
I think DLL injection would be the better option, but is always harder to do. It's not ususally to do with the game forcing it out but it's backend protection forcing out the unsigned code. I will look into this for you and get back to you.
Wait, did you enable update.Tick(the timer) throught it's settings? I've just got it working in limbo, it was flickering badly but setting the Timer increment to 10 helped. Do you want me to send you the modified code? < See here Also I renamed the timer(update) to (updatetimer) as it was conflicting with a Sub in the form.designer.
yes the code would be helpfull, yes it flickers because of the method used since im not injecting the code the game refresh and code refresh is different. im wonder why this overlay doesnt work in bf3 though EDIT: ALRIGHT so this does infact work with bf3 BUT it only displays while not in fullscreen mode, so why then doesn't it work in fullscreen-have to play in fullscreen
I'm downloading the Game to help you, I'll delete it afterwards. I'll .zip the code quickly and send it, all you have to do is change the Process name from limbo back to battlefield. I've added some new bits and commented what they are, one to detect if the corrent process is being loaded for you. If you get confused please feel free to quote the code and ask me for help. I'll PM you the new project link. EDIT: I had limbo in Windowed mode, I'll put it into FS and get back to you.
ok, the main problem i have is that stupid fs mode not working. im thinking maybe that process get like a sole use of the screen or sumthing
Right I've looked into it and I think DirectX isn't accepting it, so... We'll have to call gpcomms.dll and use your app, just replace the code in the timer to match gpcomms DirectX drawing. I'll write it up as soon as I can and send it to you, in the meantime continue playing with your version of the app. Do you dev with C#.NET or just VB.NET?
im only practiced in vb.net but i can use tools to convert c# to vb. working code in any language would be amazing EDIT: take a look at this it's in vb and does overlays- im not able to analyze the source now though as it is late here http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=4015&lngWId=10 lol i just was able to review it- turns out it makes calls to gpcomms.dll EDIT2: alright so ive been searching up and it seem that punkbuster (the anticheat used for bf3) doesn't like the use of external dlls so im thinking now we'll have to use a directdraw or d3d function/solution now...ah more stuff i have no experience in
hi, iam new here. I'm looking for the same thing (but for CS1.6), and more than a few months I could not find. Therefore, I would wait dave for publish your code. And if that matter, i write in vb.net too. Thank you.
I think i can help you out here, ill download and install it to give you a working fix.. Can you pm me a link to it ?