Actually, try this:
http://www.codeproject.com/tools/Win...er_Utility.asp
Actually, try this:
http://www.codeproject.com/tools/Win...er_Utility.asp
QPixmap::grabWindow() takes a native window system identifier (WId).
J-P Nurmi
Hi,
Thnx Marcel and Jpn for your valuable suggestions.
But the thing is that i want use this capture screen technology on MAC, Linux, and Windows.
So i thought that QT have some support for it but i haven't found anything useful yet.
"Jpn" although grabWindow() can work for me but the whole thing is that how can i know in my QT app that which is active window and how do i get winId of the active window.
And "Marcel" the link you had given me is a useful one i want to use my app across many platforms including MAC, Linux and Windows.
Thnx again for your kind help.![]()
I'm afraid you need a platform dependent solution for that.
Something like XGetInputFocus(), GetActiveWindow() and so on..
J-P Nurmi
Did u happen to see the Screen capture example in the Qt demos ?? U can find it under Desktop->Screen capture in the demo....
it uses something like...
am not sure how portable is this.originalPixmap = QPixmap::grabWindow(QApplication::desktop()->winId());
hope this helps...
Last edited by aamer4yu; 18th April 2007 at 06:21.
Hi,
Thanks to all for your valuable suggestions.
I know that how it can be done using Windows APIs.
But i haven't done anything in MAC or Linux.
So i don't know how to implement function which can capture active window.
I am not aware of MAC and Linux specific APIs.
And also i don't have any link or documentation like MSDN for Mac and Linux systems.
If anybody have any idea how can i write this function for Mac and Linux then please help me out.
In Window GetWindowFromPoint() gives me the handle of window which i clicked using mouse. and then everything is easy. But i don't know how i can do this using MAC and Linux specific APIs.
Also in my first post i asked whom i should sent this "Alt + PrtScn" message so that it will just dump the Active Window image to the clipboard. I think if i can do this then it will ease my work.![]()
Or can anyone show me the code snippet to capture active window on Mac and Linux, especially Mac OS.
Waiting for valuable suggestions from all of you. Thanks for your interest. I think there are many people who wants to do the same thing.
Thanks in advance.![]()
Shalabh............
For mac: developer.apple.comAnd also i don't have any link or documentation like MSDN for Mac and Linux systems.
For linux: the X server api documentation www.x.org
regards
from Qt docs...
what does it mean by portable in principle ??WId QWidget::winId () const
Returns the window system identifier of the widget.
Portable in principle, but if you use it you are probably about to do something non-portable. Be careful.![]()
is this function portable or non portable ??
It is portable! But in principle![]()
OK...
so in principle.. its portable !!![]()
![]()
![]()
![]()
It means that it is portable by itself, but if you use it, you are doing something which is not portable, so portability of the winId() method is not important as it is surrounded by an unportable code.
hmm... understood somewhat,,,
tell me one thing more...
will the code of screnshot example of the Qt demo run on Windows, Linux, and Mac ?? i may understand better by this answer![]()
Bookmarks