By registering with us, you'll be able to discuss, share and exchange private messages with other members of our community.
SignUp Now!echo %@winapi[user32.dll,GetOpenClipboardWindow]
WHICHWIN: find windows and show their properties; options:
/F format_elements (lowercase supresses description)
elements: H(andle) P(rocess) C(lass) M(odule file name)
T(itle) V(isible) S(how) L(TRB normal)
I(ndex) D (thread) B(lank) E(nabled)
N(umber found/processed)
default: HPMCTVSLBEN
/R recurse (do child windows)
/nnn maximum number of windows to return
Filters:
/E | /D enabled | disabled windows only
/V | /I visible | invisible windows only
/P pid decimal or hex prefixed with "0x"
/M module case-insensitive substring match on fully-qualified name
/C class case-insensitive substring match
/T title case-insensitive substring match
"quote" strings containing spaces
@setlocal
@echo off
set hwnd=%@winapi[user32.dll,GetOpenClipboardWindow]
iff %hwnd eq 0 then
echo Clipboard is not locked.
else
echo Clipboard is locked by window handle %hwnd
quit
endiff
Gosub GetTCMDhwnd
:: Open the Clipboard
set rc=%@winapi[user32.dll,OpenClipboard,%@eval[%handle]]
iff %rc eq 0 then
echo Could not open clipboard.
quit
else
echo Clipboard has been opened.
endiff
:: Empty the Clipboard
set rc=%@winapi[user32.dll,EmptyClipboard]
iff %rc eq 0 then
echo Could not empty clipboard.
else
echo Clipboard has been emptied.
endiff
:: Is the clipboard locked?
set hwnd=%@winapi[user32.dll,GetOpenClipboardWindow]
iff %hwnd eq 0 then
echo Clipboard is not locked.
else
echo Clipboard is locked by window handle %@eval[%hwnd=H]
endiff
::Close the Clipboard
set rc=%@winapi[user32.dll,CloseClipboard]
iff %rc eq 0 then
echo Could not close clipboard.
else
echo Clipboard closed.
endiff
endlocal
quit
:GetTCMDhwnd
iff PLUGIN sysutils then
::Next Sentence
else
plugin /l c:\utils\sysutils64.dll
endiff
iff %_? eq 0 then
::Next Sentence
else
echo Could not load SysUtils plugin
quit
endiff
set handle=%@execstr[whichwin /v /T "Administrator: TC 22 - TCC Prompt"]
iff %@word[0,%handle] eq Handle: then
set handle=%@word[1,%handle]
echo hwnd for "Administrator: TC 22 - TCC Prompt" is %handle
else
echo Could not get handle to TCMD.EXE
quit
endiff
Return