NvSelectDisplayDevice not setting display

GEFORCE 6200
I am using the follwing code for vb.net 2.0

<DllImport("nvcpl.dll")> _
Private Shared Function NvSelectDisplayDevice(ByVal monitor As Integer) As Boolean
End Function

Dim results As Boolean
results = NvSelectDisplayDevice(2)
If results = True Then
MessageBox.Show("T")
Else
MessageBox.Show("F")
End If

The results are true.
According to the documentation all function calls going forward should be displayed in window 2.
Any thing I do afterward displays in window 1.
Any suggestion or help would be appreciated.
EconnergyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
What are you trying to achieve here?  Are you trying to display on the 2nd monitor of a 2-monitor setup?  The .NET framework can work with multiple monitors, without any API calls.

Bob
0
EconnergyAuthor Commented:
The monitors are set up in dual view mode NOT span mode
The form startposition was set to manual
The following code does not start the program on the second monitor

    Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
        Dim s As Screen
        For Each s In Screen.AllScreens
            If Not s.Primary Then
                Me.Bounds = s.Bounds
                Exit For
            End If
        Next
    End Sub
0
Bob LearnedCommented:
What does Screen.AllScreens.Length return?

Bob
0
EconnergyAuthor Commented:

It returns 2

Overriding the load event didn't work, but overriding the shown event works.

Protected Overrides Sub OnShown(ByVal e As System.EventArgs)
        MyBase.OnShown(e)

        Dim s As Screen
        For Each s In Screen.AllScreens
            If Not s.Primary Then
                Me.Location = s.WorkingArea.Location
                Exit For
            End If
        Next
        Me.WindowState = FormWindowState.Normal
    End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.