amokoura Posted March 5, 2008 Posted March 5, 2008 (edited) If I don't like the dll interface to AutoIt, isn't it easy to rewrite the functions? Currently I'm focused on window manipulation, so wouldn't I need just to use user32.dll functions? Or are there so many hacks and tricks I should know before I could write my on WinActivate() and WinExists() ? Edited March 6, 2008 by amokoura
Richard Robertson Posted March 5, 2008 Posted March 5, 2008 Check out the source. It's got most of those functions in it. The source is outdated, but it is a useful starting point.
amokoura Posted March 5, 2008 Author Posted March 5, 2008 Check out the source. It's got most of those functions in it. The source is outdated, but it is a useful starting point.Thanks! The Window functions might've not changed much.
amokoura Posted March 5, 2008 Author Posted March 5, 2008 Wait a minute, there isn't any source available?? Where can I get?
Richard Robertson Posted March 5, 2008 Posted March 5, 2008 http://www.autoitscript.com/forum/index.php?showtopic=8389It's a sticky at the top of this forum. (C++)
amokoura Posted March 5, 2008 Author Posted March 5, 2008 (edited) http://www.autoitscript.com/forum/index.php?showtopic=8389It's a sticky at the top of this forum. (C++)Yeah I checked it out but there aren't any source files in the mentioned site.BTW I checked AutoHotKey's source. At least it's available. And most likely similar with AutoIt. Edited March 5, 2008 by amokoura
NELyon Posted March 5, 2008 Posted March 5, 2008 http://www.autoitscript.com/autoit3/files/...-v3.1.0-src.exe
Developers Jos Posted March 5, 2008 Developers Posted March 5, 2008 BTW I checked AutoHotKey's source. At least it's available. And most likely similar with AutoIt.Just do a search on that topic and I am sure you get all the details on that one. 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.Â
Moderators SmOke_N Posted March 5, 2008 Moderators Posted March 5, 2008 (edited) If I don't like the dll interface to AutoIt, isn't it easy to rewrite the functions?Currently I'm focused on window manipulation, so wouldn't I need just to use user32.dll functions?Or are there so many hacks and tricks I should know before I could write my on WinActivate() and WinExists() ?I'm sure that:GetActiveWindowSetActiveWindowIsWindowFindWindowAPI calls are all you're looking for?Edit:Forgot SetActiveWindow Edited March 5, 2008 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.
amokoura Posted March 5, 2008 Author Posted March 5, 2008 http://www.autoitscript.com/autoit3/files/...-v3.1.0-src.exeThank you! I was just blind.I'm sure that:GetActiveWindowSetActiveWindowIsWindowFindWindowAPI calls are all you're looking for?Edit:Forgot SetActiveWindowYeah. Exactly those. And the one which returns all windows.For now, I've managed well with the AutoIt dll. Just preparing for a situation where I might have to write as elegant Window manipulation functions as AutoIt has. Gotta check how much effort it would require.
Richard Robertson Posted March 5, 2008 Posted March 5, 2008 There is no function that just returns all the windows. You have to call EnumWindows for that, and provide a function to pick up each individual window. It's kinda messy.
amokoura Posted March 5, 2008 Author Posted March 5, 2008 There is no function that just returns all the windows. You have to call EnumWindows for that, and provide a function to pick up each individual window. It's kinda messy.Yeah. That's why I'll try to stick with AutoIt as long as possible
Richard Robertson Posted March 6, 2008 Posted March 6, 2008 I never said it was hard. I just said it was messy.
cppman Posted March 6, 2008 Posted March 6, 2008 (edited) expandcollapse popup#include <windows.h> #include <iostream> #include <vector> struct WinInfo { HWND WindowHandle; LPSTR WindowTitle; }; BOOL CALLBACK PartnerCallback(HWND hWindow, LPARAM lParam) { std::vector<WinInfo> *pVector = (std::vector<WinInfo>*)lParam; WinInfo wi; wi.WindowHandle = hWindow; wi.WindowTitle = new char[256]; GetWindowTextA(hWindow, wi.WindowTitle, 256); pVector->push_back(wi); return TRUE; } std::vector<WinInfo>* WinList() { std::vector<WinInfo> *pVector = new std::vector<WinInfo>(); EnumWindows(PartnerCallback, (LPARAM)pVector); return pVector; } int main() { std::vector<WinInfo> *pWindows = WinList(); for (size_t i = 0; i < pWindows->size(); i++) { std::cout << pWindows->at(i).WindowTitle << "\n"; delete[] pWindows->at(i).WindowTitle; } delete pWindows; while(1) {} }Well, here is one way to do it. Probably not the best way. Hell, probably not even a good way - but it works. Edited March 6, 2008 by chris95219 Miva OS Project
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