MyEarth Posted December 19, 2012 Share Posted December 19, 2012 (edited) Hi community, a new member here! I'll come from AHK but now i'm tired and i want to use a better coding software like autoit I have some problem with DLLCall, this was the original script: #NoEnv SetWorkingDir %A_ScriptDir% OnExit, ExitSub hDLL := DllCall("LoadLibrary", Str, "Library86.dll", Ptr) ;for x86 ;hDLL := DllCall("LoadLibrary", Str, "Library64.dll", Ptr) ;for x64 if (hDLL) { hTest := DllCall("SetWindowsHookEx", Int, 5, Ptr, DllCall("GetProcAddress", Ptr, hDLL, AStr, "CBProc", ptr), Ptr, hDLL, Ptr, 0, Ptr) if (!hHook) { MsgBox, SetWindowsHookEx is failed ExitApp } } else { MsgBox, LoadLibrary is failed ExitApp } MsgBox, Good Work, LoadLibrary is load Return Esc::ExitApp ExitSub: if (hTest) DllCall("UnhookWindowsHookEx", Ptr, hTest) if (hDLL) DllCall("FreeLibrary", Ptr, hDLL) ExitApp Some advice? Many thanks, i'm glad to stay here Edited December 19, 2012 by MyEarth Link to comment Share on other sites More sharing options...
bogQ Posted December 19, 2012 Share Posted December 19, 2012 (edited) why not try in help file func name _Winapi_SetWindowsHookEx instead dllcall? Edited December 19, 2012 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
MyEarth Posted December 19, 2012 Author Share Posted December 19, 2012 Thanks for your interest. I have few post so i can reply only 4 times until 20 December 2012 - 08:57 PM. I would be happy if you make an example based on my script, if you want and have time, for better understand the Function. Just for DLLCall: DllCall("LoadLibrary", Str, "Library86.dll", Ptr) DllCall("SetWindowsHookEx", Int, 5, Ptr, DllCall("GetProcAddress", Ptr, hDLL, AStr, "CBProc", ptr), Ptr, hDLL, Ptr, 0, Ptr) DllCall("UnhookWindowsHookEx", Ptr, hTest) DllCall("FreeLibrary", Ptr, hDLL) Link to comment Share on other sites More sharing options...
Developers Jos Posted December 19, 2012 Developers Share Posted December 19, 2012 Thanks for your interest. I have few post so i can reply only 4 times until 20 December 2012 - 08:57 PM. You should be fine now ...Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
MyEarth Posted December 19, 2012 Author Share Posted December 19, 2012 You should be fine now ...Jos Thanks Jos, now i can reply to all Link to comment Share on other sites More sharing options...
MyEarth Posted December 19, 2012 Author Share Posted December 19, 2012 For now, i have convert this line of AHK: hDLL := DllCall("LoadLibrary", Str, "Library86.dll", Ptr) To this Autoit code. I think is correct, right? $hDLL = DllCall("Library86.dll", "Str", "LoadLibrary", "Ptr") I need some help for other SetWindowsHookEx, UnhookWindowsHookEx and FreeLibrary...thanks Link to comment Share on other sites More sharing options...
MyEarth Posted December 20, 2012 Author Share Posted December 20, 2012 Bump, please any help is grateful, this scipt is very important for me Link to comment Share on other sites More sharing options...
JohnOne Posted December 20, 2012 Share Posted December 20, 2012 You have not been able to convert any more of that at all in a full day? or you just want someone to do it for you? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
MyEarth Posted December 20, 2012 Author Share Posted December 20, 2012 (edited) You have not been able to convert any more of that at all in a full day?Not, and i don't know if that DLLCall work, noone confirmed thator you just want someone to do it for you?Isn't a 1000 line of code, only four lines ( or three if my conversion is correct ) with the same subject, the DllCall...i'm not asking for the moon Edited December 20, 2012 by MyEarth Link to comment Share on other sites More sharing options...
bogQ Posted December 20, 2012 Share Posted December 20, 2012 (edited) i did suggest you to take a look in help file for _WinAPI_SetWindowsHookEx commandstrangely but in help file under the explanation about that specific func you do have example that not only include usage of _WinAPI_SetWindowsHookEx but _WinAPI_UnhookWindowsHookExnow if you still wanna go with dll call on your own but i hardly see the point i would suggest you to open WinAPI.au3 file located in include folder of your autoit instalation, with your scite editor and look at func _WinAPI_SetWindowsHookEx to see how exactly do it trigger user32 dll.as for your Library86.dll and your not working AHK script, we heare dont know AHK, we know AutoIt, so did you provide anything for us to try to compare not working autoit code with working correct syntax? how can anyone know if something is working if noone have anything that points him to what shud and how shud he do it. Did you explain what your script should represent, what shud it be doing, whats it your end result that you expect from it? Where is that dll located? can i finde it in my windows dir? is there a link to the api documentation? are funcs on that dll exported at all?My point is not to flame you, my point is to open your eyes that you got heare to learn (i hope) AutoIt, not to learn us AHK. Sometimes incomplete questions cannot be answered regardles of how hard you try.so im gona redirect you to small tutorial in hope itl do you some good of understanding dll and au3. Considering that you had take a look at that funcs from help file and opened WinAPI.au3 to see how someone else is dooing it i hope that your next question will be more helpful for us in order to help you. Edited December 20, 2012 by bogQ BrewManNH 1 TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
MyEarth Posted December 21, 2012 Author Share Posted December 21, 2012 Perhaps I did not explain well, my AHK script WORK. I'd like to convert to AutoitNow i don't have problem with loop, HotkeySet etc. but only with DllCallNow i have posted this line:$hDLL = DllCall("Library86.dll", "Str", "LoadLibrary", "Ptr")And nooone confirmed if it is correct or not, i only see a useless lecture, from my point of view, also I did not ask any full script, only 4 LINES of code, the only part that I can not solve alone, I have limits and I have no problem admittingI have follow the forum for a lot of time and i see many time script for user only posting thread with an idea of a script...The Library86.dll is an internal library of my company, i can't post it and i think it is not necessary.This is all story, if someone want to help with that DllCall i'm grateful, otherwise friends as before. Link to comment Share on other sites More sharing options...
bogQ Posted December 21, 2012 Share Posted December 21, 2012 (edited) Noone can confirm or conwert this cos noone know AHK, and cos you did not provide documentation for that dll and geave something to test it on. so we cant help but you can test if @error is returned after dll func usage, if there is @error than your probably doooing something wrong. so check for @error and see what did it return, then open help file on that func and look under return error to see why exactly did you get that speciric error number.Clear enought with no lectures this time? Edited December 21, 2012 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
JohnOne Posted December 21, 2012 Share Posted December 21, 2012 Well if you could be bothered to look in the help file you would have solved this by now. But I'm sure someone might turn up eventually and do your work for you. Best of luck. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Tekk Posted December 21, 2012 Share Posted December 21, 2012 (edited) ;~ DllCall ( "dll", "return type", "function" [, type1, param1 [, type n, param n]] ) ;~ http://msdn.microsoft.com/en-us/library/windows/desktop/ms684175(v=vs.85).aspx $hDLL = DllCall('Kernel32.dll', 'handle', 'LoadLibrary', 'str', 'Library86.dll') If IsArray($hDLL) Then $hDLL = $hDLL[0] Edited December 23, 2012 by Tekk Link to comment Share on other sites More sharing options...
wakillon Posted December 23, 2012 Share Posted December 23, 2012 Hi community, a new member here! I'll come from AHK but now i'm tired and i want to use a better coding software like autoit I have some problem with DLLCall, this was the original script: #NoEnv SetWorkingDir %A_ScriptDir% OnExit, ExitSub hDLL := DllCall("LoadLibrary", Str, "Library86.dll", Ptr) ;for x86 ;hDLL := DllCall("LoadLibrary", Str, "Library64.dll", Ptr) ;for x64 if (hDLL) { hTest := DllCall("SetWindowsHookEx", Int, 5, Ptr, DllCall("GetProcAddress", Ptr, hDLL, AStr, "CBProc", ptr), Ptr, hDLL, Ptr, 0, Ptr) if (!hHook) { MsgBox, SetWindowsHookEx is failed ExitApp } } else { MsgBox, LoadLibrary is failed ExitApp } MsgBox, Good Work, LoadLibrary is load Return Esc::ExitApp ExitSub: if (hTest) DllCall("UnhookWindowsHookEx", Ptr, hTest) if (hDLL) DllCall("FreeLibrary", Ptr, hDLL) ExitApp Some advice? Many thanks, i'm glad to stay here The Library86.dll is an internal library of my company, i can't post it and i think it is not necessary. It's strange ! Pasting "GetProcAddress CBProc" in google, the first answer is naturally this post. But the second is here ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 23, 2012 Moderators Share Posted December 23, 2012 MyEarth,The code you posted is identical to that in the AHK thread to which wakillon linked - the title of which is "Hyde (sic) your process from the Task Manager". Is that what you are trying to do with this script? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
wakillon Posted December 25, 2012 Share Posted December 25, 2012 No news! Like his dll, he want surely stay hidden! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
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