CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1
  1. #1
    Join Date
    Oct 2010
    Posts
    23

    Vb.net hardware Acceleration project

    Toggling Hardware Acceleration can be done using macro AutoIT scripts, but I was thinking more of a feasible solution for VB.net or C++.
    =============================================================
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
    Run a registry search for Dword value: (Acceleration.level) and it should point to the default card.
    In programming simply (stop iteration when dword is found in the services key)

    I converted the C++ code to VB.net- can't say it's perfect but it loads all right from VB.NET 2010.
    Based on what the writer suggested regarding the code, it's supposed to acknowledge the "Acceleration.level" registry value and apply the settings, but all it does is refresh the screen.
    =================================================================
    In short, the code below just does that, refreshes the screen, if anyone has a way to make it "register" the changes feel free.
    ENUM_REGISTRY_SETTINGS<-- If all it does is refresh the screen, maybe this might work- I did try replacing "ENUM_CURRENT_SETTINGS" in the subroutine but that did not change a thing.

    Code:

    Declarations-
    http://www.ureader.com/message/1448174.aspx

    Add the constant because the page does not include it:

    Code:
    Private Const CDS_RESET = &H40000000
    
    
    '- Put this in a button1 sub
    '------------------------------------------
    Dim DevM As DEVMODE
    Dim test As Boolean = EnumDisplaySettings(Nothing, ENUM_CURRENT_SETTINGS, DevM)
    If test = True Then
    Dim result As Long = ChangeDisplaySettings(DevM, CDS_RESET)
    End If
    '------------------------------------------
    Last edited by StriderH2; March 31st, 2011 at 02:27 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured