F**e 发帖数: 593 | 1 How can I get all the windows on my screen? Or get the window location/size if
I have the name, etc? Thanks a lot.
Is this possible in Java? |
z****g 发帖数: 2497 | 2 java不能直接获得这些windows的信息吧。
除非用jni调用windows的API。
【在 F**e 的大作中提到】 : How can I get all the windows on my screen? Or get the window location/size if : I have the name, etc? Thanks a lot. : Is this possible in Java?
|
F**e 发帖数: 593 | 3 Thanks! Can you give me some points to such Windows API?
location/size if
【在 z****g 的大作中提到】 : java不能直接获得这些windows的信息吧。 : 除非用jni调用windows的API。
|
t*****s 发帖数: 124 | 4 1. write a EnumWindowsProc callback function
2. call EnumWindows(...) and pass your callback function to it.
3. you will get a window handle in the callback funtion
4. with the handle (hWnd), you can get what you want about the window
for example:
RECT rc;
GetWindowRect(hWnd, &rc);
int height = rc.bottom - rc.top;
int width = rc.right - rc.left;
for more details, please search the msdn
【在 F**e 的大作中提到】 : Thanks! Can you give me some points to such Windows API? : : location/size if
|
F**e 发帖数: 593 | 5 That's very helpful. Thanks. I'll try that. How about on unix/linux?
【在 t*****s 的大作中提到】 : 1. write a EnumWindowsProc callback function : 2. call EnumWindows(...) and pass your callback function to it. : 3. you will get a window handle in the callback funtion : 4. with the handle (hWnd), you can get what you want about the window : for example: : RECT rc; : GetWindowRect(hWnd, &rc); : int height = rc.bottom - rc.top; : int width = rc.right - rc.left; : for more details, please search the msdn
|
t*****s 发帖数: 124 | 6 sorry, i have no experience in x window
【在 F**e 的大作中提到】 : That's very helpful. Thanks. I'll try that. How about on unix/linux?
|