Guest Posted September 19, 2013 Posted September 19, 2013 (edited) EDIT: No matter ..I decided not to ask it.Delete the thread please. Edited September 19, 2013 by Guest
FireFox Posted September 19, 2013 Posted September 19, 2013 Hi, I will nonetheless answer to your question: list the modules and check the directx dll name which will tell you the directx version. Br, FireFox.
Guest Posted September 20, 2013 Posted September 20, 2013 (edited) Hi, I will nonetheless answer to your question: list the modules and check the directx dll name which will tell you the directx version. Br, FireFox. i need to do a check on running process to know if this process using dx9/dx10/dx11/ogl. checking the dll name in the "app" folder (If there is such dll file) Indeed tell me the directx version which used by the app. but in the "app" folder not every exe file using dx / ogl. i need to know which exe file in the "app" folder using dx9/dx10/dx11/ogl. OR i need to know what is the main exe file of the "app" folder. If you know how to do it, Can you give example code? Edited September 20, 2013 by Guest
FireFox Posted September 20, 2013 Posted September 20, 2013 Something like this: #include <WinAPIEx.au3> Local $aSupportedModules[5][2] = _ [["d3d9.dll", "Direct3D9"], _ ["d3d10.dll", "Direct3D10"], _ ["d3d10_1.dll", "Direct3D10_1"], _ ["d3d11.dll", "Direct3D11"], _ ["d3d11_1.dll", "Direct3D11_1"]] ; I have a window named test with some D3D. Local $iPID = WinGetProcess("test") If $iPID = 0 Then Exit 1 Local $aModules = _WinAPI_EnumProcessModules($iPID) For $i = 2 To $aModules[0][0] ;skip the own proc For $i2 = 0 To UBound($aSupportedModules, 1) -1 If StringRegExpReplace($aModules[$i][1], "^.*\\", "") = $aSupportedModules[$i2][0] Then ConsoleWrite("module found: " & $aSupportedModules[$i2][1] & @CrLf) ExitLoop 2 EndIf Next Next
Guest Posted September 20, 2013 Posted September 20, 2013 (edited) Something like this: #include <WinAPIEx.au3> Local $aSupportedModules[5][2] = _ [["d3d9.dll", "Direct3D9"], _ ["d3d10.dll", "Direct3D10"], _ ["d3d10_1.dll", "Direct3D10_1"], _ ["d3d11.dll", "Direct3D11"], _ ["d3d11_1.dll", "Direct3D11_1"]] ; I have a window named test with some D3D. Local $iPID = WinGetProcess("test") If $iPID = 0 Then Exit 1 Local $aModules = _WinAPI_EnumProcessModules($iPID) For $i = 2 To $aModules[0][0] ;skip the own proc For $i2 = 0 To UBound($aSupportedModules, 1) -1 If StringRegExpReplace($aModules[$i][1], "^.*\\", "") = $aSupportedModules[$i2][0] Then ConsoleWrite("module found: " & $aSupportedModules[$i2][1] & @CrLf) ExitLoop 2 EndIf Next Next I always knew this forum have geniuses people but it is not working >"D:\Portable Programs\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\?????\DATA\Desktop\test3.au3" D:\???????\DATA\Desktop\test3.au3 (16) : ==> Subscript used with non-Array variable.: For $i = 2 To $aModules[0][0] For $i = 2 To $aModules^ ERROR >Exit code: 1 Time: 0.614 Maybe you missed something? EDIT: now it is working! just changed the $iPID = WinGetProcess("test") to $iPID = <the pid number> Your example is very help a lot!!It saved me develop a very complicated detection option which does not always work.It saved me several days of developingYou deserve a donation! Edited September 20, 2013 by Guest
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now