LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   porting Win32 API calls to Linux (https://www.linuxquestions.org/questions/programming-9/porting-win32-api-calls-to-linux-307939/)

integer 03-30-2005 03:47 PM

porting Win32 API calls to Linux
 
i've never done any linux-specific coding before, but i'm switching to linux now and wish to port one of my python programs.
my question is: what is the linux-equivalent of the following Win32 API functions:

win32gui.EnumWindows
win32gui.GetWindowText

Thank you!

Mega Man X 03-30-2005 03:51 PM

There's no Linux equivalent for that. Linux, unlike Windows, has no gui stuff inbuilt on the kernel. You will need to pick up some API as gtk or qt and start coding. GTK has an extension for python, I don't know if QT has. Check out their sites:

http://www.trolltech.com/

http://www.gtk.org/

If you really just have to use Win32 API, check out Wine:

http://www.winehq.com/

wine is supposed to translate Win32 API in Linux, thus making Win32 applications and games to actually run in Linux.

integer 03-30-2005 03:58 PM

fair enough.
i should mention now that i plan to use Xandros, which uses KDE.
so my next question is: what is the Xandros/KDE equivalent of "EnumWindows" ?

basically i just want to know how to enumerate all the window-entities and get their titles and i'm only interested in Xandos.

Thanks!

Quote:

Originally posted by Megaman X
There's no Linux equivalent for that. Linux, unlike Windows, has no gui stuff inbuilt on the kernel. You will need to pick up some API as gtk or qt and start coding. GTK has an extension for python, I don't know if QT has. Check out their sites:

http://www.trolltech.com/

http://www.gtk.org/

If you really just have to use Win32 API, check out Wine:

http://www.winehq.com/

wine is supposed to translate Win32 API in Linux, thus making Win32 applications and games to actually run in Linux.


alred 03-30-2005 10:41 PM

you may need to use X functions for "EnumWindows"

possible to write a FindWindow function with :

XQueryTree // cycle all windows and get window ID
XFetchName // get window name
XGetWindowAttributes // get window attrib

take a look at :

for getting X windows informations

for other X functions

might not be what you want but hopes it help


All times are GMT -5. The time now is 07:51 PM.