monoceres Posted November 21, 2007 Posted November 21, 2007 (edited) Hello!I think that it is finaly time for me to learn how to practicly do some dll calls, and I found this reference point at msdn and I thought that this would be a good start.How would I get the total physical memory for example, the reference is: MSDN linkPs. I do know some c++ / win32 programming, but just a little Edited January 4, 2009 by monoceres Broken link? PM me and I'll send you the file!
Moderators SmOke_N Posted November 21, 2007 Moderators Posted November 21, 2007 monoceres said: Hello!s sayI think that it is finaly time for me to learn how to practicly do some dll calls, and I found this reference point at msdn and I thought that this would be a good start.How would I get the total physical memory for example, the reference is: MSDN linkPs. I do know some c++ / win32 programming, but just a little If you know "some" C++ ... you know that's not a call to a dll right? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
monoceres Posted November 21, 2007 Author Posted November 21, 2007 (edited) Yes, but I need to work out how you use this in the Psapi.dll dll call. Edited November 21, 2007 by monoceres Broken link? PM me and I'll send you the file!
Moderators SmOke_N Posted November 21, 2007 Moderators Posted November 21, 2007 (edited) monoceres said: Yes, but I need to work out how you use this in the Psapi.dll dll call.Which Psapi.dll function are you trying to use? Edit: Anyone having an issue with Psapi.dll and GetPerformanceInfo? I keep getting function unknown \ Edit2: I have to run now, here's a "non" working version:Local $aPERFORMANCE_INFORMATION[15] = ["", "cb", "CommitTotal", "CommitLimit", _ "PhysicalTotal", "PhysicalAvailable", "SystemCache", "KernelTotal", "KernelPaged", _ "KernelNonpaged", "PageSize", "HandleCount", "ProcessCount", "ThreadCount"] Local $nCB = 80000 Local $tPERFORMANCE_INFORMATION = DllStructCreate("dword;int[10];dword[3]") Local $aGPI = DllCall("Psapi.dll", "int", "GetPerformanceInfo", "ptr", DllStructGetPtr($tPERFORMANCE_INFORMATION), "dword", $nCB) If IsArray($aGPI) Then Local $sHold = "" For $i = 1 To 14 $sHold &= $aPERFORMANCE_INFORMATION[$i] & " = " & DllStructGetData($tPERFORMANCE_INFORMATION, $i) & @CRLF Next MsgBox(64, "Info", $sHold) EndIfI can't figure out why it says that the function doesn't exist (I checked, it does)... I'm obviously calling it wrong, and my struct must be set up wrong.... maybe someone would like to take over where I left off... Edited November 21, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
monoceres Posted November 21, 2007 Author Posted November 21, 2007 I can The code runs for me, but the only values I get is the CommitTotal, CommitLimit and CB, everything is zero. But your code is good anyhow because now I more about structs in dll's, thanks! Broken link? PM me and I'll send you the file!
MrCreatoR Posted December 26, 2007 Posted December 26, 2007 SmOke_N Quote I can't figure out why it says that the function doesn't existMaybe this will explain it: ' said: PSAPI.DLL (Process Status Helper) is one of the possible DLLs may cause error in Windows system. You may get some error message such as below during the boot up process:Procedure entry point GetProcessImageFileNameW could not be located in the dynamic link library. PSAPI.DLLAccording to Microsoft, there is only one PSAPI.DLL file in your PC and it is under the Windows\System 32 folder. Additional PSAPI.DLL file may be installed by third party programs such as SmartBridge, often the older version. If you have other versions of the PSAPI.DLL file in the system, it can cause your IE 7 or other windows programs that interact with IE7 to crash when you start it up. Beside, you may have annoying error message like above too. To solve the PSAPI.DLL incompatibility issue and overcome this problem, search your PC or check the program folder of the application that crashes for a PSAPI.DLL file:Open up Search from Start Menu.Find all instances PSAPI.DLL on your PC.Rename all extra copies of PSAPI.DLL files found EXCEPT the one located in \Windows\System32\ folder to some other names like PSAPIOLD.DLL (never delete or do anything with the PSAPI.DLL file in your Windows or Windows/System 32 folder).Reboot the system.It work for me if i use full path to system dir, i.e. DllCall(@SystemDir & "\Psapi.dll"....) .BTW, the Psapi.dll wil present on all Windows platforms, or only on WIN NT 4? (accourding to the help file). Reveal hidden contents Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
corey822 Posted December 26, 2007 Posted December 26, 2007 noob help dll? cheers C.W C.Wnew rules:1.dont use plz in a post or title use please instead2.always use help file as it is now muchly over rated3. dont think where not watching u4.please wait 24 hours after last post ot bump XD i use to make that mistake
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