Link to home
Start Free TrialLog in
Avatar of Econnergy
Econnergy

asked on

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.
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

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
Avatar of Econnergy
Econnergy

ASKER

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
What does Screen.AllScreens.Length return?

Bob
ASKER CERTIFIED SOLUTION
Avatar of Econnergy
Econnergy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial