设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3155|回复: 5
打印 上一主题 下一主题

[已经过期] WinAPI无能,求教如何能够获取rm当前全屏还是窗口状态。

 关闭 [复制链接]

Lv4.逐梦者

梦石
0
星屑
7941
在线时间
1182 小时
注册时间
2007-7-29
帖子
2055
跳转到指定楼层
1
发表于 2011-6-5 23:48:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
其实要求很简单,就是想要获取rm当前是全屏还是窗口状态而已,
如果悬赏要求等什么不够可以追加,所有身家都没有问题。
或者要我写个什么功能整合追加的脚本之类的做得到的我都行!

Lv2.观梦者

傻♂逼

梦石
0
星屑
369
在线时间
1605 小时
注册时间
2007-3-13
帖子
6562

烫烫烫开拓者

2
发表于 2011-6-6 00:12:41 | 只看该作者
本帖最后由 yangff 于 2011-6-6 00:14 编辑

非常麻烦= =HookApi
当然粗判断的话取一下分辨率……现在用800*600以下分辨率的应该没几个了
其实全屏就等于重载了一次Dx……只是要恢复现场,那么Hook显然就是那API了……,全屏状态在D3DPOOL_MANAGED里……
哎呀,蛋疼什么的最有爱了
回复

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
7941
在线时间
1182 小时
注册时间
2007-7-29
帖子
2055
3
 楼主| 发表于 2011-6-6 02:33:14 | 只看该作者
本帖最后由 enghao_lim 于 2011-6-6 02:34 编辑
yangff 发表于 2011-6-6 00:12
非常麻烦= =HookApi
当然粗判断的话取一下分辨率……现在用800*600以下分辨率的应该没几个了
其实全屏就等 ...


我就怕看到第一句[=='']
至于粗判断,不会[- -||]。我的窗口分辨率刚好就在800x600之下,只有640x480。
至于你最后说的那个,我尽量谷歌好了……[==]
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
110
在线时间
953 小时
注册时间
2007-4-25
帖子
805
4
发表于 2011-6-6 03:37:11 | 只看该作者
一个简单的测试:
  1.   def fullscreen?
  2.     get_foreground_wnd = Win32API.new('user32', 'GetForegroundWindow', 'v', 'i')
  3.     get_wnd_long = Win32API.new('user32', 'GetWindowLong', 'ii', 'l')
  4.     (get_wnd_long.call(get_foreground_wnd.call, -16) & 0x00c00000) == 0
  5.   end
复制代码
对付默认的全屏足矣。

点评

这是检查窗口风格是否有 WS_CAPTION 属性。  发表于 2011-6-6 07:46
最大化?我记得默认全屏不是最大化  发表于 2011-6-6 07:24
[email protected]:~> repeat 1 fortune
Matz is nice, so we are nice.
回复

使用道具 举报

Lv2.观梦者

傻♂逼

梦石
0
星屑
369
在线时间
1605 小时
注册时间
2007-3-13
帖子
6562

烫烫烫开拓者

5
发表于 2011-6-6 08:39:58 | 只看该作者
MSDN给出的方法

shellapi.h
ABN_FULLSCREENAPP Notification
Notifies an appbar when a full-screen application is opening or closing. This notification is sent in the form of an application-defined message that is set by the ABM_NEW message.
Syntax
ABN_FULLSCREENAPP
    fOpen = (BOOL) lParam;
                       
Parameters
fOpen
A flag specifying whether a full-screen application is opening or closing. This parameter is TRUE if the application is opening or FALSE if it is closing.
Return Value
No return value.
Remarks
When a full-screen application is opening, an appbar must drop to the bottom of the z-order. When it is closing, the appbar should restore its z-order position.
Notification Requirements
Minimum DLL Version        None
Custom Implementation        No
Header        shellapi.h
Minimum operating systems        Windows NT 3.51, Windows 95

点评

详细:http://blog.csdn.net/magictong/archive/2009/04/16/4085477.aspx  发表于 2011-6-6 08:47

评分

参与人数 1星屑 +60 收起 理由
enghao_lim + 60 谢谢啊,我这就去看。对于应急我先用着苏的.

查看全部评分

哎呀,蛋疼什么的最有爱了
回复

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
6545
在线时间
1666 小时
注册时间
2008-10-29
帖子
6710

贵宾

6
发表于 2011-6-7 00:36:15 | 只看该作者
直接 GetWindowRect 取得窗口矩形不知道行不行?
全屏后取得的大小应该就是客户区的大小.
不是全屏的时候会大于客户区的大小(有标题和边框)











你知道得太多了

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-19 10:58

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表