LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 05-25-2005, 06:49 AM   #1
IDoIt
LQ Newbie
 
Registered: May 2005
Posts: 10

Rep: Reputation: 0
win32 windows programming , How in linux ?


Hi all ,

i wrote a win32 application under windows , and i want to convert it on linux .

i want to get window handler and name and it's children and many else , i hope to find some one help me

THX
 
Old 05-25-2005, 07:44 AM   #2
gerrit_daniels
Member
 
Registered: Oct 2003
Location: Belgium
Distribution: Kubuntu
Posts: 34

Rep: Reputation: 15
Linux doesn't support the win32 api by itself. You can run windows programs in linux using wine. I believe it is also possible to link directly with the wine libs so your users don't need to install wine, but I haven't tried this yet.

If your program uses MFC/Visual C++ I would recommend porting it to linux using wxWidgets.

Hope this helps
 
Old 05-25-2005, 08:06 AM   #3
IDoIt
LQ Newbie
 
Registered: May 2005
Posts: 10

Original Poster
Rep: Reputation: 0
thx gerrit_daniels

But i meant that u can on windows api's get the window handler or it's name or even childs ,....

that's what im searching for "linux x window api"

thx again
 
Old 05-25-2005, 09:09 AM   #4
gerrit_daniels
Member
 
Registered: Oct 2003
Location: Belgium
Distribution: Kubuntu
Posts: 34

Rep: Reputation: 15
From what you're saying I understand that you are looking for the "x.org api" to rewrite your program for linux. If that is the case then I would suggest using one of the toolkits instead of using x directly because they are much easier to use. If you're programming in c you can use GTK, if you use c++ I would suggest wxWidgets or the KDE libs.

Hope this helps
 
Old 05-25-2005, 09:50 AM   #5
sekelsenmat
Member
 
Registered: Apr 2005
Location: São Paulo - Brazil
Distribution: Mageia Linux 1
Posts: 353

Rep: Reputation: 30
Quote:
Originally posted by IDoIt that's what im searching for "linux x window api" [/B]
Converting a program to linux will very much depend on how you built the program.

Did you use a RAD IDE to build the windows or you built them coding? In what language did you write the program?

Suposing you coded the window and are writing in c++ the answer is: The inner windowing API for linux is X11, but it is not adequate for most gui programs, you should use a toolkit around it. Another API that makes things a lot easier and goes above X11. There are 2 main such gui APIs for linux: GTK and QT.

For a multiplatform program you could use an API that will go above GTK (and then above Win32 when compiling for windows). Some options are: wxWidgets for c++ and Lazarus LCL for pascal.

Felipe
 
Old 05-25-2005, 12:37 PM   #6
IDoIt
LQ Newbie
 
Registered: May 2005
Posts: 10

Original Poster
Rep: Reputation: 0
thx all very much

here's what i want :

i have made a program on windows using C++ that can retrieve any GUI running application properties (like : the window handler , window childs , containing controls , size , position ,.....) and many else
spy++ (Microsoft) is an example of it
i want to make simillar one on linux
i don't want to build a GUI window , i want to use a current running application ( what ever this app was ) to get what i want from it
 
Old 05-25-2005, 02:59 PM   #7
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 try those XGetxxxxxx functions in this link :
http://tronche.com/gui/x/xlib/function-index.html
 
Old 05-26-2005, 12:54 AM   #8
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
I hear X11 is a real pain to program for. You might want to figure out what window manager you want it to run under (I think KDE is the most used/easiest to use/most Windows-like GUI). For that you can use Qt (http://doc.trolltech.com/3.3/index.html) which is an excellent user interface library. I think it might be more what you are looking for if you are a Win32 programmer.
ta0kira
 
Old 05-26-2005, 02:53 AM   #9
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
i guess he just need some functions to retrieve windows attributes instead of creating a Xwindow and Xevents from scratch .........
 
Old 05-26-2005, 06:52 AM   #10
IDoIt
LQ Newbie
 
Registered: May 2005
Posts: 10

Original Poster
Rep: Reputation: 0
yes alred , u r right

i don't need to build any GUI application from scratch

i just need to retrieve some attributes from an already running application ( for ex. firefox , mplayer ,...any window)

thx for everyone
 
Old 05-26-2005, 07:48 AM   #11
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
if you are interested in Xlib then you may try roll your own findwindow function by using XQueryTree() , get all window IDs then get attributes .

do a google search with XQueryTree() for full C/C++ example code .....
but still you might find some ready wrapper function from qt or others ......

goodluck ......
 
  


Reply



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
Serial port programming problem (Win32 VS POSIX) chanwing Programming 1 06-29-2005 11:17 AM
Learn linux programming under windows beep_beep Linux - Software 5 05-26-2005 07:12 AM
If Win32 is for WIndows than What is the API for Linux ? indian Programming 14 01-07-2005 02:28 PM
Linux Programming vs. Windows LinuxBlackBox Programming 7 10-28-2003 09:03 AM
Exp. Windows/Linux-Script Programmer - Need Linux Programming Mentor! ruttiger Linux - Newbie 2 10-28-2001 11:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:28 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration