开发者

Resizing SunAwtFrame

There is an application written in Java using AWT. And I want to resize its windows by an external program. My OS is Windows XP. Actually this application is an online poker client.

The windows are of "SunAwtFrame" class, so I look for those windows and call MoveWindow/SetWindowPos on them. The resul开发者_如何学Got is not the one I expect:

a problem http://savepic.net/1331700.png

As you see, the window did resize, but the content did not. While resizing manually it scales, and I want the same behavior here. Probably, some additional action are needed to make AWT windows understand it was resized. How can I fix the problem?


I recommend doing this:

  • Use Spy++ (available as a tool in Microsoft Visual Studio) to filter messages sent to the SunAwtFrame window.

  • Resize window manually.

  • Figure out which messages are sent to the window during resizing. Use MoveWindow/SetWindowPos and/or send those messages after you resize.

  • Take a look at functions InvalidateRect and UpdateWindow.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜