Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    May 2006
    Posts
    24

    Display Adapter Info

    Wondering if there is a funtion available within APMS to get display adapter info.

    I have a rather crude method now which uses WMI to retrieve the info, via a windows script and write this to a "mainfest" file (for the lack of a better term), i then reads said file using functions built into APMS.

    But maybe someone else out there has a less crude method ??

    This is my .vbs code
    Code:
    On Error Resume Next
    
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objOutFile = objFSO.OpenTextFile("C:\display.ifx", 8, True)
    
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    
    Set colItems = objWMIService.ExecQuery _
        ("Select * from Win32_DisplayControllerConfiguration")
    
    For Each objItem in colItems
        objOutFile.WriteLine "[DisplayAdapter]"
        objOutFile.WriteLine "BitsPerPixel=" & objItem.BitsPerPixel
        objOutFile.WriteLine "Horizontal Resolution=" & objItem.HorizontalResolution
        objOutFile.WriteLine "Adapter=" & objItem.Name
        objOutFile.WriteLine "VideoMode=" & objItem.VideoMode
    Next
    Which will output
    Code:
    [DisplayAdapter]
    BitsPerPixel=32
    Horizontal Resolution=1680
    Adapter=GeForce 8800 GTS
    VideoMode=1680 by 1050 pixels, True Color, 60 Hertz
    Maybe someone with some DLL making skills can use the above *shrugs*
    Last edited by hiddenhole; 02-04-2008 at 06:52 AM.

  2. #2
    Join Date
    May 2006
    Posts
    5,380

    Your Luck Is In

    as it happens im working on a WMI dll for my current project, give me a hour or 2 and it *should* be finished
    Open your eyes to Narcissism, Don't let her destroy your life!!

  3. #3
    Join Date
    May 2006
    Posts
    24
    Legend

  4. #4
    Join Date
    May 2006
    Posts
    24

    Cool

    On that note, IR.. you guys should look at WMI support with your next release.

  5. #5
    Join Date
    May 2006
    Posts
    5,380
    ok, im having a little trouble with this dll, it all works prefect when called from a pb application but im getting an error with AMS, but only after the first call

    so the first call is error free, but if the same dll is called again after that then it crashes the AMS application, restart and again first call is ok,

    im not sure what is causeing this at mo, it seems like the dll call is still active even after its returned to AMS, but in PB it works fine

    so the best i can do for now is make a commandline exe that writes a text file from the WMI info, but thats what you already have so it would be no better,

    i'll take another look at tonight and see if theres anything i can do
    Open your eyes to Narcissism, Don't let her destroy your life!!

  6. #6
    Join Date
    May 2006
    Posts
    24
    Apparently one can access the WMI through luaCOM plugin ??..iam currently looking into this further...will post any progress

  7. #7
    Join Date
    May 2006
    Posts
    5,380
    Well, i gave up on the WMI route and opted for some windows registry API commands and this time i have a stable dll

    i managed to get the information i require so im happy and i thought i would post it in case it will do the job for you

    see screen cap for more info on what info it retrieves

    hope it helps

    heres a small example
    Code:
    -------------------------------------------------------------------------------------------------------
    -- GetVideoInfo(Item,ShowText)
    --
    -- Item: 0 = Manufacturer
    --       1 = VideoDriver
    --       2 = VideoMemory
    --       3 = VideoDriverDLL
    --       4 = VideoDriverVersion
    --       5 = Width
    --       6 = Height
    --       7 = Depth
    --       8 = Frequency
            
    -- ShowText: 0 = Dont show text
    --           1 = Do show text
    ------------------------------------------------------------------------------------------------------
    
    strText=""
    for i=1, 9 do
    	Item=i-1
    	ShowText=1
    	DLLReturn = DLL.CallFunction("AutoPlay\\Docs\\VideoCardInfoDLL.dll", "GetVideoInfo", Item..", "..ShowText, DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL);
    	strText=strText..DLLReturn.."\r\n"
    end
    
    result = Dialog.Message("Notice", strText, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    Last edited by RizlaUK; 02-01-2009 at 11:34 AM.
    Open your eyes to Narcissism, Don't let her destroy your life!!

  8. #8
    Join Date
    May 2006
    Posts
    24
    Cheers, it does return some of the information i require.

    Iam still playing with luaCOM...but at present it looks promising

Similar Threads

  1. Display System Informations
    By FoxLeader in forum AutoPlay Media Studio 6.0
    Replies: 2
    Last Post: 11-16-2006, 10:13 AM
  2. Display App Version info
    By Jonas DK in forum AutoPlay Media Studio 6.0
    Replies: 1
    Last Post: 08-04-2006, 10:46 PM
  3. Display a screen, wait, then move on
    By Tek in forum Setup Factory 7.0
    Replies: 2
    Last Post: 03-01-2005, 09:19 AM
  4. Display system info
    By pjhiggins in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 02-25-2004, 08:32 AM
  5. HOWTO: Display Conditional Text Based Upon a List Box Selection
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-15-2002, 10:54 AM

Posting Permissions

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