LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-30-2005, 03:47 PM   #1
integer
LQ Newbie
 
Registered: Mar 2005
Posts: 3

Rep: Reputation: 0
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!
 
Old 03-30-2005, 03:51 PM   #2
Mega Man X
Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 63
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.
 
Old 03-30-2005, 03:58 PM   #3
integer
LQ Newbie
 
Registered: Mar 2005
Posts: 3

Original Poster
Rep: Reputation: 0
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.
 
Old 03-30-2005, 10:41 PM   #4
alred
Member
 
Registered: Mar 2005
Location: singapore
Distribution: puppy and Ubuntu and ... erh ... redhat(sort of) :( ... + the venerable bsd and solaris ^_^
Posts: 658
Blog Entries: 8

Rep: Reputation: 31
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

Last edited by alred; 03-30-2005 at 10:54 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Porting Win32 API && PIC programing bobbens Programming 2 02-11-2005 07:14 AM
If Win32 is for WIndows than What is the API for Linux ? indian Programming 14 01-07-2005 02:28 PM
cross platform C or C++ API for linux and Win32 tcma Linux - Software 1 12-09-2004 11:05 PM
Porting win32 application into Linux sergeyy Linux - Software 1 06-23-2003 08:57 AM
ASSEMBLY: Win32 API errors mandrake_linux Programming 1 06-19-2001 11:38 PM


All times are GMT -5. The time now is 07:30 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration