Get Rid of MS Office 2019 Shadow Border Window

Get help with using AutoHotkey and its commands and hotkeys
rifqii_
Posts: 2
Joined: 12 Aug 2020, 00:20

Get Rid of MS Office 2019 Shadow Border Window

12 Aug 2020, 11:05

hello, I'm using this WinCut script by Roland https://autohotkey.com/board/topic/21070-wincut-cut-out-piece-of-window-on-the-fly/

it worked very well until I use it to snip MS Office 2019 (Word, Excel). It seems like both apps using some shadow border window and WinSet, Region can't handle it. How can I get rid of that border and make it clean? (see picture)

here is the script:

Code: Select all

#NoEnv
#SingleInstance, force

+#LButton::
Hotkey, esc, cancel, On
cancel:=0
CoordMode, Mouse
MouseGetPos, sx, sy, win
WinGetClass, class, ahk_id%win%
if class in Progman,Shell_TrayWnd
  return
WinGetPos, wx, wy,,, ahk_id%win%
Gui, +lastfound +alwaysOnTop +toolwindow -caption
Gui, Color, 00FFFF
WinSet, Transparent, 50
      break
    ifEqual, cancel, 1, gosub exit
    MouseGetPos, x, y
    Gui, Show, % "x" sx "y" sy "w" x-sx "h" y-sy
  } WinGetPos, gx, gy, w, h
Gui, Show, noActivate
Loop {
    if !getKeyState("LButton", "p")
Gui, destroy
WinGetPos, wx, wy,,, ahk_id%win%
x:=gx-wx, y:=gy-wy
WinSet, Region, % x "-" y " " x+w "-" y " " x+w "-" y+h " " x "-" y+h " " x "-" y, ahk_id%win%
Hotkey, esc, cancel, off
return

cancel:
cancel:=1
return

exit:
Hotkey, esc, cancel, off
Gui destroy
exit

+#Esc::
WinSet, Region,, A
return
thank you
Attachments
Annotation 2020-08-12 221437.png
Annotation 2020-08-12 221437.png (228.43 KiB) Viewed 518 times
InkedAnnotation 2020-08-12 221744_LI.jpg
InkedAnnotation 2020-08-12 221744_LI.jpg (62.31 KiB) Viewed 518 times
User avatar
Annecy
Posts: 2
Joined: 20 Sep 2020, 19:43

Get Rid of Window Shadow Border ???

20 Sep 2020, 20:06

Greetings, ALL :wave:
I hope "all is well" or at least "well enough" :shock:
I'm starting to script (with/in) AHK again ...
after a 6year hiatus ...
(Had 3 surgeries between March2017 & Jan2020 :crazy:)

Anyway, my first question concerns this (exact) WinSet Region border issue ...
I'm setting a BORDER to the (old) NirSoft AdapterWatch Utility ...
On both my Win10x64 & Win7x64 (ThinkPad) LapTops,
the result has the sort of transparent bordered window
as pictured by/in the OP ...

I scripted EXTENSIVELY for years with AHK 1.04.85 ...
I started "working" with/in "Tech" back in the 1980s
while an UnderGraduate @Univeristy ...

This transparent bordered window issue never occurred previously
when/while I was scripting on my (then) XP laptop/s ...

Please reply/advise ...
Thank you & regards ...
User avatar
Annecy
Posts: 2
Joined: 20 Sep 2020, 19:43

Re: Get Rid of Window Shadow Border ???

17 Oct 2020, 04:25

Annecy wrote:
20 Sep 2020, 20:06
Greetings, ALL :wave:
I hope "all is well" or at least "well enough" :shock:
I seem to have re-solved this "issue" ...
& a similar/related issue that came out while debugging the initial/original issue :!: 8-)

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], boiler, keylo, Lem2001, mikeyww and 47 guests