Program over-top of fullscreen
Is there a way I can have a form show up over top of a full-screen game or something, without disrupting the game, but so there's like a pop-up, so that when I receive an IM in the background or something, it has a pop-up that doesn't interupt my game. Is there a way I can do this?
Re: Program over-top of fullscreen
You should ask Jacob Roman since he should know how to do that with DirectX. ;)
Re: Program over-top of fullscreen
Does setting it to always on top (HWND_TOPMOST) using SetWindowPos() not work?
Re: Program over-top of fullscreen
Set the border style of a form to None and then when you maximize it it will go over everything (even the taskbar). Then you can combine it with Always on Top to make it stay over everything. You can also implement the blocking of opening the start menu, task swtiching and so on to create a full game effect.
Re: Program over-top of fullscreen
Baja he wants a popup over a game ;)
Re: Program over-top of fullscreen
Oh... my bad. I thought he wanted to MAKE a game.
1 Attachment(s)
Re: Program over-top of fullscreen
I don't know if anybody has heard of it before, but there is a program called "Xfire" www.xfire.com, anyways it has in game instant messaging, so it shows a popup and what person said it, and when you press a hotkey, it brings up an instant message thing overtop of your game, but anyways the popup is what I want to do, and make it so that you can see it overtop of the game, yet still be playing the game, and when you press a hotkey (I know how to do this) it brings something up, anyways I've attatched a picture of xfire to show you what I mean.
Re: Program over-top of fullscreen
So what is your problem exactly? what cant you get to work?
Re: Program over-top of fullscreen
Will the always on top method work though? Like MSN's popups used to mess up full screen games, but xfire made it work perfect, so I'm wondering if the always on top will work.
Re: Program over-top of fullscreen
I guess the only way to see is to try. Make a timer, set it to 30 seconds or so, and have it pop up a new window and on load (of that popup) set it Always On Top. Then start the game and the timer.
Re: Program over-top of fullscreen
Ok, thanks I'll try it and let you know.
Re: Program over-top of fullscreen
Ok I tried this code:
VB Code:
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Sub Form_Load()
Form1.Visible = False
End Sub
Private Sub Timer1_Timer()
Form1.Visible = True
Call SetWindowPos(Form1.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
End Sub
And it showed up over other windows, but not the full screen game.
Re: Program over-top of fullscreen
Did it at least flash for a moment?
Re: Program over-top of fullscreen
I didn't see anything until I alt-tabbed out of the game, but it was overtop of other windows.
Re: Program over-top of fullscreen
i found this on allapi.net, but it will only print text and it flickers
you can probably use the same method and BitBlit on to the same hDC as your game
but i cant think of a way to get your whole form on top ?
VB Code:
'This Project needs
'- two timers, interval=100
'- a button
'in general section
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function GetActiveWindow Lib "user32" () As Long
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function Ellipse Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Sub Form_Load()
Timer1.Interval = 100
Timer1.Enabled = True
Timer2.Interval = 100
Timer2.Enabled = True
Command1.Caption = "Draw Text"
End Sub
'This will draw an Ellipse on the active window
Sub Timer1_Timer()
Dim Position As POINTAPI
'Get the cursor position
GetCursorPos Position
'Draw the Ellipse on the Screen's DC
Ellipse GetWindowDC(0), Position.x - 5, Position.y - 5, Position.x + 5, Position.y + 5
End Sub
Sub Command1_Click()
'KPD-Team 1998
'URL: [url]http://www.allapi.net/[/url]
Dim intCount As Integer, strString As String
strString = "Cool, text on screen !"
For intCount = 0 To 30
'Draw the text on the screen
TextOut GetWindowDC(0), intCount * 20, intCount * 20, strString, Len(strString)
Next intCount
End Sub
Private Sub Timer2_Timer()
'Draw the text to the active window
TextOut GetWindowDC(GetActiveWindow), 50, 50, "This is a form", 14
End Sub
Close this window
Re: Program over-top of fullscreen
you can also try SetParent
this puts the whole form inside the game window, BUT it will flicker :(
works ok for notepad tho
VB Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Sub Form_Load()
Me.ZOrder 0
Timer1.Interval = 1000
Timer2.Interval = 100
End Sub
Private Sub Timer1_Timer()
Dim hwnd As Long
hwnd = FindWindow("Notepad", vbNullString)
If hwnd = 0 Then Exit Sub
SetParent Me.hwnd, hwnd
Timer1.Enabled = False
End Sub
Private Sub Timer2_Timer()
Me.Refresh
End Sub
Re: Program over-top of fullscreen
Is there anyway to stop the flickering?
Re: Program over-top of fullscreen
Why dont you use spy++ to watch XFire and see what messages it sends
Re: Program over-top of fullscreen
I've tried to use spy++ before, I always get confused on how it works, could you explain it to me a bit?
Re: Program over-top of fullscreen
you find the window of XFire messanger with it (by its name). Then you right click on it and click messages
you will see a whole lot of stuff there, but try and remember the number on the left and quickly start up your game and ask a friend to message you. Then shrink the game and pause spy++ and read along until you see something that might be of interest ;)
Re: Program over-top of fullscreen
I'll try it out some time.