Does anyone know how to make a program that will take a game that takes up your whole desktop screen, and move it into a small frame or window?
Printable View
Does anyone know how to make a program that will take a game that takes up your whole desktop screen, and move it into a small frame or window?
hrm, try sending alt + enter keys to the prog.... if you can do this manually, you can also do it automatically.
Sastraxi's Method will only work for games that run in
DOS. Games using DirectX, I know, the Full-Screen /
Non Full-Screen-ness is set when the DirectX object is
created. Im not sure you could make it run non-
fullscreen if you wanted to, and if you could, i dont know
how. Im pretty sure its the same way for OGL too.
Sastraxi should know =).
Z.
Maybe this can help you:
Copy this code into a form and set Borderstyle to 0
Option Explicit
Public DirectX As DirectX7
Public DirectDraw As DirectDraw7
Public DirectMusicLoader As DirectMusicLoader
Public DirectMusicPerformance As DirectMusicPerformance
Public DirectMusicSegment As DirectMusicSegment
Private Sub Form_Load()
Set DirectX = New DirectX7
InitDirectDraw
InitDirectMusic
SetDirectDraw 1024, 768, 16
SetDirectMusic -1, 1
SetMidiFile "C:\", "1.mid"
PlayMidiFile True, 0, 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set DirectMusicSegment = Nothing
Set DirectMusicPerformance = Nothing
Set DirectMusicLoader = Nothing
Set DirectDraw = Nothing
Set DirectX = Nothing
End Sub
Public Function InitDirectDraw()
Set DirectDraw = DirectX.DirectDrawCreate("")
End Function
Public Sub InitDirectMusic()
Set DirectMusicLoader = DirectX.DirectMusicLoaderCreate
Set DirectMusicPerformance = DirectX.DirectMusicPerformanceCreate
End Sub
Public Sub SetDirectDraw(X As Long, Y As Long, Farbtiefe As Long)
DirectDraw.SetCooperativeLevel Me.hWnd, DDSCL_EXCLUSIVE Or DDSCL_FULLSCREEN
DirectDraw.SetDisplayMode X, Y, Farbtiefe, 0, DDSDM_DEFAULT
End Sub
Public Sub SetDirectMusic(Port As Long, OutputPort As Long)
DirectMusicPerformance.Init Nothing, frmmain.hWnd
DirectMusicPerformance.SetPort Port, OutputPort
End Sub
Public Sub SetMidiFile(SearchDirectory As String, Filename As String)
DirectMusicLoader.SetSearchDirectory SearchDirectory
Set DirectMusicSegment = DirectMusicLoader.LoadSegment(Filename)
DirectMusicSegment.SetStandardMidiFile
End Sub
Public Sub PlayMidiFile(AutoDownload As Boolean, Flags As Variant, StartTime As Variant)
DirectMusicPerformance.SetMasterAutoDownload AutoDownload
DirectMusicPerformance.PlaySegment DirectMusicSegment, Flags, StartTime
End Sub
With this code you can change the display mode and play background music with dx7. You may change the display mode settings and the midi file path.
>>> Have fun ;)
Zaei, with OGL you dont need a clipper you just change the width and height of the picturebox(or whatever you are using that has an hDC)'s size and then you set the aspect ratio so that it doesn't look screwy. All that's needed is 3 lines of code.