Project1

标题: 最好用的全屏脚本【 [打印本页]

作者: yangff    时间: 2010-12-24 19:23
标题: 最好用的全屏脚本【
本帖最后由 yangff 于 2010-12-26 18:52 编辑


!12.26重要更新!

修复了因FreeLibrary导致的错误
Win7测试不通过……Win7的任务栏太牛逼了……
激活窗体盖不住,强行置顶盖不住……我无语了
调用setwindow,自行给$hwnd赋值(我管你用什么办法,反正我这里用的是APIHOOK……250果断报毒中)
代码
  1. $rect_yangff=[0,0,0,0]
  2. def setwindow

  3.   
  4.   gsm=Win32API.new("user32","GetSystemMetrics","l","l")
  5.   转换宽度=gsm.call(0)
  6.   转换高度=gsm.call(1)
  7.   $转换比x=$原宽度.to_f/转换宽度.to_f
  8.   $转换比y=$原高度.to_f/转换高度.to_f

  9.   hWnd = $hwnd

  10.   swp = Win32API.new('window', 'SetMaxWindow', 'llp', '')
  11.   a=$rect_yangff
  12.   s=a.pack("llll")
  13.   swp.call(hWnd,$yangff_fenbianlv_onces?1:0,s)
  14.   a=s.unpack("llll")
  15.   $rect_yangff=a
  16.   if $yangff_fenbianlv_onces
  17.     $yangff_fenbianlv_onces=false
  18.   else
  19.     $yangff_fenbianlv_onces=true
  20.    
  21.   end
  22. end
复制代码
Dll
window.rar (3.53 KB, 下载次数: 222)
为什么写成了Dll?因为调用的Api有点小多……关键是这个dll本来还有防破解啊,自动1024*768啊,当然也包含了那个取得hwnd的东西,只不过这个是剥离出来的功能……怕那个dll上去没人会用……250爆各种毒……

Dll的源代码是


  1. #COMPILER PBWIN 9
  2. #COMPILE DLL

  3. %USEMACROS = 1
  4. #INCLUDE "Win32API.inc"

  5. GLOBAL ghInstance AS DWORD




  6. '-------------------------------------------------------------------------------
  7. ' Main DLL entry point called by Windows...
  8. '
  9. FUNCTION LIBMAIN (BYVAL hInstance   AS LONG, _
  10.                   BYVAL fwdReason   AS LONG, _
  11.                   BYVAL lpvReserved AS LONG) AS LONG
  12.     'maxwindow=0 '0 no 1 yes
  13.     SELECT CASE fwdReason

  14.     CASE %DLL_PROCESS_ATTACH
  15.         'Indicates that the DLL is being loaded by another process (a DLL
  16.         'or EXE is loading the DLL).  DLLs can use this opportunity to
  17.         'initialize any instance or global data, such as arrays.

  18.         ghInstance = hInstance

  19.         FUNCTION = 1   'success!

  20.         'FUNCTION = 0   'failure!  This will prevent the EXE from running.

  21.     CASE %DLL_PROCESS_DETACH
  22.         'Indicates that the DLL is being unloaded or detached from the
  23.         'calling application.  DLLs can take this opportunity to clean
  24.         'up all resources for all threads attached and known to the DLL.

  25.         FUNCTION = 1   'success!

  26.         'FUNCTION = 0   'failure!

  27.     CASE %DLL_THREAD_ATTACH
  28.         'Indicates that the DLL is being loaded by a new thread in the
  29.         'calling application.  DLLs can use this opportunity to
  30.         'initialize any thread local storage (TLS).

  31.         FUNCTION = 1   'success!

  32.         'FUNCTION = 0   'failure!

  33.     CASE %DLL_THREAD_DETACH
  34.         'Indicates that the thread is exiting cleanly.  If the DLL has
  35.         'allocated any thread local storage, it should be released.

  36.         FUNCTION = 1   'success!

  37.         'FUNCTION = 0   'failure!

  38.     END SELECT

  39. END FUNCTION


  40. '-------------------------------------------------------------------------------
  41. ' Examples of exported Subs and functions...
  42. '

  43. SUB SetMaxWindow ALIAS "SetMaxWindow" (BYVAL hWnd AS LONG,BYVAL maxwindow AS LONG,r AS RECT) EXPORT
  44.         DIM lstyle AS DWORD
  45.     ' code goes here
  46.     IF maxwindow=0 THEN
  47.         maxwindow=1
  48.         GetWindowRect(hwnd,r)
  49.         DIM w AS DWORD,h AS DWORD
  50.         w = GetSystemMetrics(0)
  51.         h = GetSystemMetrics(1)
  52.         SetWindowPos(hWnd,0,0,0,w,h,&H20)
  53.         ShowWindow(hWnd,3)

  54.         lstyle=GetWindowLong(hWnd, -16)

  55.         lstyle = lstyle AND NOT &H80000
  56.         lstyle = lstyle AND NOT &H10000
  57.         lstyle = lstyle AND NOT &H20000
  58.         lstyle = lstyle AND NOT &HC00000
  59.         SetWindowLong hwnd,-16,lstyle



  60.     ELSE
  61.         maxwindow=0

  62.         ShowWindow(hWnd,9)
  63.         lstyle=GetWindowLong(hWnd, -16)

  64.         lstyle = lstyle OR &H80000
  65.         lstyle = lstyle OR &H10000
  66.         lstyle = lstyle OR &H20000
  67.         lstyle = lstyle OR &HC00000
  68.         SetWindowLong hwnd,-16,lstyle
  69.         w = GetSystemMetrics(0)
  70.         h = GetSystemMetrics(1)
  71.         SetForegroundWindow(hwnd)
  72.         SetWindowPos(hWnd,0,r.nleft,r.ntop,r.nright-r.nleft,r.nbottom - r.ntop,&H20)
  73.         SetForegroundWindow(hwnd)
  74.         DIM hmenu AS DWORD
  75.         hmenu=GetSystemMenu(hwnd,0)
  76.         EnableMenuItem (hMenu, 4, 1025)

  77.     END IF
  78. END SUB
复制代码
这样全屏就支持鼠标了~~~
作者: 光的圆周率    时间: 2010-12-24 20:46
好久都没看到Yangff酱了~
作者: yangff    时间: 2010-12-24 23:37
另外说一句就是不知道关于那个任务栏(关键是我不想把它隐藏掉,我才不是那么暴力的人呢)有什么办法?
作者: wbsy8241    时间: 2010-12-25 00:51
终于看见有超过640*480的全屏了...

配合调任意分辨率的DLL 可以做任意分辨率了..

#   原宽度=544
#   原高度=416
这2个应该要 +6 和+32?(不确定是24还是32,我电脑上测试32是正确的,和主题(窗口栏)有关?)
不然画面会被拉小
作者: 八云紫    时间: 2010-12-25 10:20
hWnd 替换成紫苏的脚本会更好点. 虽然是全屏.
作者: yangff    时间: 2010-12-25 18:36
wbsy8241 发表于 2010-12-25 00:51
终于看见有超过640*480的全屏了...

配合调任意分辨率的DLL 可以做任意分辨率了..

= =,忘记处理这个了……真是失败……
作者: summer92    时间: 2010-12-25 20:31
顶~,还是大分辨率舒服啊,感谢感谢
作者: wbsy8241    时间: 2010-12-28 18:41
回复 yangff 的帖子

不会给 $hwnd 赋值
和API有关的完全不懂
导致16行报错
= =
作者: yangff    时间: 2010-12-28 22:47
wbsy8241 发表于 2010-12-28 18:41
回复 yangff 的帖子

不会给 $hwnd 赋值

苏紫的hwnd脚本
作者: wbsy8241    时间: 2010-12-29 01:38
回复 yangff 的帖子

XPSP3  3次调用任务栏会显示出来= =(上面全屏的游戏 下面一条任务栏)




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