ycomp Posted May 22, 2022 Posted May 22, 2022 would there be a way to create a function that takes all the parameters you would use for DllCall() and then it calls DllCall() with those parameters? I ask because DllCall() takes a variable # of parameters so I'm not sure how that works.
Danyfirex Posted May 22, 2022 Posted May 22, 2022 You would need to do something like this: DllCall("user32.dll", "int", "MessageBox", _ "hwnd", 0, _ ; Handle to the parent window "str", "Some text", _ ; The text of the message box "str", "Some title", _ ; The title of the message box "int", 0) ; Flags for the message box. ;wrapper _DllCall("user32.dll", "int", "MessageBox", _ "hwnd", 0, _ ; Handle to the parent window "str", "Some text", _ ; The text of the message box "str", "Some title", _ ; The title of the message box "int", 0) ; Flags for the message box. Func _DllCall($dll, $returnType, $function, $vT1 = 0, $vP1 = 0, $vT2 = 0, $vP2 = 0, $vT3 = 0, $vP3 = 0, $vT4 = 0, $vP4 = 0) Switch @NumParams Case (3) Return DllCall($dll, $returnType, $function) Case (3 + 2) Return DllCall($dll, $returnType, $function, $vT1, $vP1) Case (3 + 4) Return DllCall($dll, $returnType, $function, $vT1, $vP1, $vT2, $vP2) Case (3 + 6) Return DllCall($dll, $returnType, $function, $vT1, $vP1, $vT2, $vP2, $vT3, $vP3) Case (3 + 8) Return DllCall($dll, $returnType, $function, $vT1, $vP1, $vT2, $vP2, $vT3, $vP3, $vT4, $vP4) Case Else EndSwitch EndFunc ;==>_DllCall Saludos Danysys.com AutoIt... Reveal hidden contents UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
ycomp Posted May 22, 2022 Author Posted May 22, 2022 thanks I had a suspicion it might be something like that, I was hoping there was an easier way
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