[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
回复 11# ygqiang


    那个帖子用的是 TheaterMode,我用的是 FullScreen,实测好像没有问题

TOP

本帖最后由 ygqiang 于 2015-1-11 00:43 编辑
  1. Set SH = CreateObject("Shell.Application")
  2. do
  3. For Each SHWin In SH.Windows
  4.         If  LCase(Right(SHWin.FullName, 12)) = "iexplore.exe" Then
  5.                 SHWin.FullScreen=True
  6.         End If
  7. Next
  8. WScript.Sleep 20000
  9. loop
复制代码
CrLf给出的这个代码。win7 64+IE9环境下测试了。
有个问题。F11全屏以后,ie浏览器右上角的最小化和关闭按钮,都找不到了。如果手动按F11键,是没有这个问题的。

TOP

IE_Maximize.exe 设置IE显示模式(只允许最小化、最大化)

VB6源码:

使用与结果:
  1. C:\Documents and Settings\Yu2n>IE_Maximize.exe
  2. 2015-01-11 00:59:22     Initd.
  3. 2015-01-11 00:59:31     Maximize(2230858)
  4. 2015-01-11 00:59:41     Maximize(198696)
复制代码
『千江有水千江月』千江有水,月映千江;万里无云,万里青天。    http://yu2n.qiniudn.com/

TOP

回复 5# ygqiang


    两个一起用倒是可以全屏并设置 ToolBar=1:
  1. SHWin.FullScreen=True
  2. SHWin.TheaterMode=True
复制代码
不过试了一下好像和 F11 的效果是不太一样,找不到在哪退出全屏

TOP

来段比较暴力的 AutoHotKey:
  1. #SingleInstance force
  2. #Persistent
  3. GroupAdd, IE, ahk_class IEFrame
  4. SetTimer WinMaximizeIE,1000
  5. WinMaximizeIE:
  6. WinMaximize, ahk_group IE
  7. Return
复制代码

TOP

IE_Maximize.exe 设置IE显示模式(只允许最小化、最大化)

VB6源码:


使用与结果:
yu2n 发表于 2015-1-11 01:02



   
这个也测试过,确实也好用。。。win7 64+ie9浏览器环境。

TOP

最终代码如下:
  1. ' VBS 调用API设置IE显示模式(只允许最小化、最大化) by Yu2n
  2. On Error Resume Next
  3. Dim wso
  4. set wso = CreateObject("WScript.Shell")
  5. wso.RegWrite "HKCU\Software\Microsoft\Office\11.0\Excel\Security\AccessVBOM",1,"REG_DWORD"
  6. wso.RegWrite "HKCU\Software\Microsoft\Office\12.0\Excel\Security\AccessVBOM",1,"REG_DWORD"
  7. wso.RegWrite "HKCU\Software\Microsoft\Office\14.0\Excel\Security\AccessVBOM",1,"REG_DWORD"
  8. Dim oExcel, oBook, oModule
  9. Set oExcel = CreateObject("Excel.Application")
  10. Set oBook = oExcel.Workbooks.Add
  11. Set oModule = oBook.VBProject.VBComponents.Add(1)
  12. strCode = _
  13.   "Private Declare Function FindWindow Lib ""user32"" Alias ""FindWindowA"" ( _" & vbCr &_
  14.   "  ByVal lpClassName As String, ByVal lpWindowName As String) As Long" & vbCr &_
  15.   "Private Declare Function GetDesktopWindow Lib ""user32"" () As Long" & vbCr &_
  16.   "Private Declare Function GetWindow Lib ""user32"" ( _" & vbCr &_
  17.   "  ByVal hwnd As Long, ByVal wCmd As Long) As Long" & vbCr &_
  18.   "Private Declare Function GetClassName Lib ""user32"" Alias ""GetClassNameA"" ( _" & vbCr &_
  19.   "  ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long" & vbCr &_
  20.   "Private Declare Function SendMessage Lib ""user32"" Alias ""SendMessageA"" ( _" & vbCr &_
  21.   "  ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long" & vbCr &_
  22.   "Private Declare Function IsZoomed Lib ""user32"" (ByVal hwnd As Long) As Long" & vbCr &_
  23.   "Private Declare Function IsIconic Lib ""user32"" (ByVal hwnd As Long) As Long" & vbCr &_
  24.   "Private Const GW_HWNDFIRST = 0" & vbCr &_
  25.   "Private Const GW_HWNDNEXT = 2" & vbCr &_
  26.   "Private Const GW_CHILD = 5" & vbCr &_
  27.   "Private Const WM_SYSCOMMAND = &H112" & vbCr &_
  28.   "Private Const SC_MAXIMIZE = &HF030&" & vbCr &_
  29.   "Public Sub IE_Maximize()" & vbCr &_
  30.   "  Dim nHWnd As Long" & vbCr &_
  31.   "  Dim s As String * 260" & vbCr &_
  32.   "  nHWnd = GetDesktopWindow()" & vbCr &_
  33.   "  nHWnd = GetWindow(nHWnd, GW_CHILD Or GW_HWNDFIRST)" & vbCr &_
  34.   "  While nHWnd <> 0" & vbCr &_
  35.   "    nHWnd = GetWindow(nHWnd, GW_HWNDNEXT)" & vbCr &_
  36.   "    s = String(256, Chr(0)): GetClassName nHWnd, s, 255: s = Replace(s, Chr(0), """")" & vbCr &_
  37.   "    If InStr(1, s, ""IEFRAME"", vbTextCompare) > 0 Then If nHWnd <> 0 Then WindowMaximize nHWnd" & vbCr &_
  38.   "  Wend" & vbCr &_
  39.   "End Sub" & vbCr &_
  40.   "Private Sub WindowMaximize(ByVal nHWnd As Long)" & vbCr &_
  41.   "  If IsZoomed(nHWnd) = 0 And IsIconic(nHWnd) = 0 Then SendMessage nHWnd, WM_SYSCOMMAND, SC_MAXIMIZE, ByVal 0" & vbCr &_
  42.   "End Sub"
  43. oModule.CodeModule.AddFromString strCode
  44. oExcel.DisplayAlerts = False
  45. Do
  46.   oExcel.Run "IE_Maximize"
  47.   WScript.Sleep 1000
  48. Loop
  49. oBook.Close False
  50. oExcel.Quit
复制代码

TOP

最终代码如下:
  1. On Error Resume Next
  2. Set objShell = CreateObject("Shell.Application")
  3. Do
  4.   For Each i In objShell.Windows()
  5.     If InStr(1, i.FullName, "\IEXPLORE.EXE", 1) > 0 Then
  6.       If i.TheaterMode = False Then i.TheaterMode = True
  7.     End If
  8.   Next
  9.   WScript.Sleep 1000
  10. Loop
复制代码
  1. (echo On Error Resume Next
  2. echo Set objShell = CreateObject^("Shell.Application"^)
  3. echo Do
  4. echo   For Each i In objShell.Windows^(^)
  5. echo     If InStr^(^1, i.FullName, "\IEXPLORE.EXE", ^1^) ^> ^0 Then
  6. echo       If i.TheaterMode = False Then i.TheaterMode = True
  7. echo     End If
  8. echo   Next
  9. echo   WScript.Sleep 1000
  10. echo Loop
  11. )>"c:\iefull.vbs"
复制代码

TOP

监测ie 最大化

TOP

返回列表