473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

directX minimize window problem


Hi,
Any Windows action which minimizes all windows (win + D, ctrl + alt +
del) is causing program error

I have two forms:

Form1 is shown on primary monitor on dual head graphics display

Public Class Form1

Inherits System.Windows.Forms.Form

Dim out As monitorIzlaz

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

out = New monitorIzlaz

out.setBackColor(Color.Black)

out.Top = 0

out.Left = -800

out.Show()

out.kreni()

End Sub

End Class

monitorIzlaz is shown on secondary monitor on dual head graphics display

Imports Microsoft.DirectX

Imports Microsoft.DirectX.Direct3D

Imports Microsoft.DirectX.AudioVideoPlayback

Public Class monitorIzlaz

Inherits System.Windows.Forms.Form

Public device As Device = Nothing

Dim radi As Boolean = True

Dim nit As System.Threading.Thread

Dim nitVideo As System.Threading.Thread

Private s(15) As Microsoft.DirectX.Direct3D.Sprite

Public comp(15) As monitorComp

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

InitializeGraphics()

Me.SetStyle(ControlStyles.AllPaintingInWmPaint Or
ControlStyles.Opaque, True)

nit = New System.Threading.Thread(AddressOf mainloop)

nit.Priority = Threading.ThreadPriority.Highest

End Sub

Public Sub InitializeGraphics()

Dim presentParams As New PresentParameters

presentParams.SwapEffect = SwapEffect.Flip

presentParams.BackBufferCount = 1

presentParams.Windowed = True

presentParams.AutoDepthStencilFormat = DepthFormat.D24S8

presentParams.EnableAutoDepthStencil = True

presentParams.PresentationInterval = PresentInterval.One

device = New Device(1, DeviceType.Hardware, Me,
CreateFlags.HardwareVertexProcessing, presentParams)

device.RenderState.SourceBlend = Direct3D.Blend.SourceAlpha

device.RenderState.DestinationBlend =
Direct3D.Blend.InvSourceAlpha

device.RenderState.AlphaBlendEnable = True

Dim i As Integer

For i = 0 To 15

s(i) = New Sprite(device)

Next

AddHandler device.DeviceReset, AddressOf Me.resetDevice

AddHandler device.DeviceResizing, AddressOf Me.resetDevice1

End Sub

Public Sub mainloop()

Dim dir As System.IO.Directory

Dim pomak As Integer = 2

While radi

Try

device.Clear(ClearFlags.Target Or ClearFlags.ZBuffer,
bckColor, 1.0F, 0)

device.BeginScene()

For i = 0 To 15

s(i).Begin(SpriteFlags.AlphaBlend)

s(i).Draw(comp(i).rendertexture, New
Rectangle(0, 0, comp(i).SIRINA, comp(i).VISINA), New Vector3(0, 0, 0),
New Vector3(comp(i).X, comp(i).Y, 1.0F), Color.FromArgb(comp(i).opacity,
255, 255, 255))

s(i).End()

next

device.EndScene()

device.Present()

Catch ex As Exception

End Try

End While

End Sub

Public Sub kreni()

nit.Start()

End Sub

End Class

Any idea whats wrong and/or how to solve this problem?

Thanks in advance.

*** Sent via Developersdex http://www.developersdex.com ***
Oct 9 '06 #1
0 1389

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: ammd | last post by:
Hi, I installed Microsoft DirectX 9.0 SDK (Summer 2004) but when I create a project and try to add the necessary references I can't find them. Does anybody know where to look for them? BTW, I have VS...
3
by: Maka Sili | last post by:
Hi, My VC++ application does not have a titlebar (and therefore no System menu, no minimize, no maximize and no close button). We have a custom button for minimize and close. When the app...
0
by: YiFai | last post by:
Hello, I'm currently writing a directx program with C++, but it takes a while to load the files necessary for the directx. When the directx window loads, it can quit the program with the...
1
by: Kav | last post by:
Hello, I apologize in advance for my “Greenness” . I posted a question a couple weeks ago asking how I could render a DIB frame a custom decoder from unmanaged code to a c# window using...
14
by: Jessica Weiner | last post by:
I am writing an application in C# which need to plot graphs and simple shapes (polygons, circles, squares etc). Which library is better for this purpose and why? Thanks.
2
by: tony | last post by:
Hello! I have a mainManu where I can chose to display some window forms. When the mainMenu is minimized I need to minimize every window form that is started from the mainMenu. So I need to...
3
by: Jimmy | last post by:
I'm kinda newbie to python and wxPython. Now I'm confronting a thorny problem: how can I make my program minimize to the taskbar represented as an ico, and when there is some message from network...
5
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Dear all, I'd like to know if there is any method to minimize command mode window when a console program is running. In my case, there are several console programs which run periodically in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.