Project1

标题: WinAPI无能,求教如何能够获取rm当前全屏还是窗口状态。 [打印本页]

作者: enghao_lim    时间: 2011-6-5 23:48
标题: WinAPI无能,求教如何能够获取rm当前全屏还是窗口状态。
其实要求很简单,就是想要获取rm当前是全屏还是窗口状态而已,
如果悬赏要求等什么不够可以追加,所有身家都没有问题。
或者要我写个什么功能整合追加的脚本之类的做得到的我都行!dsu_plus_rewardpost_czw
作者: yangff    时间: 2011-6-6 00:12
本帖最后由 yangff 于 2011-6-6 00:14 编辑

非常麻烦= =HookApi
当然粗判断的话取一下分辨率……现在用800*600以下分辨率的应该没几个了
其实全屏就等于重载了一次Dx……只是要恢复现场,那么Hook显然就是那API了……,全屏状态在D3DPOOL_MANAGED里……
作者: enghao_lim    时间: 2011-6-6 02:33
本帖最后由 enghao_lim 于 2011-6-6 02:34 编辑
yangff 发表于 2011-6-6 00:12
非常麻烦= =HookApi
当然粗判断的话取一下分辨率……现在用800*600以下分辨率的应该没几个了
其实全屏就等 ...


我就怕看到第一句[=='']
至于粗判断,不会[- -||]。我的窗口分辨率刚好就在800x600之下,只有640x480。
至于你最后说的那个,我尽量谷歌好了……[==]
作者: 苏小脉    时间: 2011-6-6 03:37
一个简单的测试:
  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
复制代码
对付默认的全屏足矣。
作者: yangff    时间: 2011-6-6 08:39
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

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




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1