Jump to content

Turning a Windows tranparent before it is created


Recommended Posts

Hello from Barcelona.

Today I come with a really funny problem:

I have been asked to launch a PowerPoint presentation in some computers running PowerPoint Viewer.

So far, so good.

The pptx are going to be stored in our server, but thanks to _WinNet_AddConnection2 funtion I can open it without having to map the network drive.

The thing is that my boss wants the files are showed from the server, without giving the option of downloading the ppt files to the users (PowerPoint Viewer works fine for us in this case).

As soon as I run the ppt file I got this screen:

Sin+t%25C3%25ADtulo.png

For my project this is a major problem beacuse it crearly shows the path where the ppt files are going to be stored in the server. It can be a security problem if we are trying to keep our files away from anyone in the LAN.

It also shows the word "Downloading", but I have used DriveSpaceFree() Function and the disk's free space is the same before, during and after the presentation.

I do not want this popup to be shown, so I have tried things like turning it transparent as soon as it shows up, but it stills appears, and someone with a mobile phone could make a slowmotion video and catch the path of the files.

 

This is the info that I get from the window with autoit:

Quote

 

>>>> Window <<<<
Title:    Descarga
Class:    NUIDialog
Position:    475, 224
Size:    350, 124
Style:    0x94C80000
ExStyle:    0x00000509
Handle:    0x00000000002503A0

>>>> Control <<<<
Class:    NetUIHWND
Instance:    1
ClassnameNN:    NetUIHWND1
Name:    
Advanced (Class):    [CLASS:NetUIHWND; INSTANCE:1]
ID:    
Text:    
Position:    0, 0
Size:    344, 95
ControlClick Coords:    148, 17
Style:    0x56000000
ExStyle:    0x00000000
Handle:    0x00000000000902D4

 

And this is the code that I'm using:

#include <WinAPIShellEx.au3>
#include <WinNet.au3>

;I do declare the variables with the server credentials
$sServer = '192.168.20.13'
$sShare = 'Compartida\Carpetas Personales\formacion\formacion'
$sUsername = 'localserver\userfake'
$sPassword = 'pssworduserfake'

$sServerShare = '\\' & $sServer & '\' & $sShare

$result = _WinNet_AddConnection2("", $sServerShare, $sUsername, $sPassword, 1)

If $result Then
    ShellExecute($sServerShare & "\AAAA.ppsx")

    Do
        Sleep(1)
        WinSetTrans("[CLASS:NUIDialog]", "", 0)
    Until ProcessExists("PPTVIEW.EXE")


    Do
        Sleep(1)
        WinSetTrans("[CLASS:NUIDialog]", "", 0)
    Until WinExists("[CLASS:NUIDialog]")

    Do
        Sleep(1)
        WinSetTrans("[CLASS:NUIDialog]", "", 0)
    Until WinExists("[CLASS:PPTFrameClass]")

Else
    ConsoleWrite("Unable to connect to " & $sServerShare & @CRLF)
EndIf

 

As you can see I have tried to set the popup window transparent as soon as it appears, but it is shown like a flash.

Is there any way to pre-turn its transparency before it is showed?

Any help or hint would be trully appreciated.

Edited by Qwerty212
Link to post
Share on other sites

If someone could take a video from the download message he could as well take a video from the whole presentation ;)

If you can't set the message window to transparent you could try to overlay the whole screen with a black or blurred picture to make the message window unreadable.
Maybe you could switch off the screen while the download message gets displayed?

Just my 2 cents worth.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Link to post
Share on other sites
Just now, water said:

If someone could take a video from the download message he could as well take a video from the whole presentation ;)

If you can't set the message window to transparent you could try to overlay the whole screen with a black or blurred picture to make the message window unreadable.
Maybe you could switch off the screen while the download message gets displayed?

Just my 2 cents worth.

Good morning water. Thanks for your reply.

I have created a splashGUI and I have given to it WinSetOnTop = 1 in a While loop, but the message is popping over it :sweating:

The video problem is something that my boss should consider, but it overpasses my goal.

Link to post
Share on other sites

Maybe this works (never tried it myself): https://www.codeproject.com/Articles/11099/Turn-on-off-monitor

AutoIt provides function _SendMessage (including an example) for this.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Link to post
Share on other sites

try to manualy copy the pptx file to local disk then open it with shell execute and delete it after u close powerpointviewer,exp:-
 

#include <WinAPIShellEx.au3>
#include <WinNet.au3>

;I do declare the variables with the server credentials
$sServer = '192.168.20.13'
$sShare = 'Compartida\Carpetas Personales\formacion\formacion'
$sUsername = 'localserver\userfake'
$sPassword = 'pssworduserfake'

$sServerShare = '\\' & $sServer & '\' & $sShare

$result = _WinNet_AddConnection2("", $sServerShare, $sUsername, $sPassword, 1)

If $result Then
    FileCopy($sServerShare & "\AAAA.ppsx",@TempDir&"\AAAA.ppsx")
    $PID=ShellExecute(@TempDir&"\AAAA.ppsx")
    ProcessWaitClose($PID)
    FileDelete(@TempDir&"\AAAA.ppsx")

Else
    ConsoleWrite("Unable to connect to " & $sServerShare & @CRLF)
EndIf

 

Link to post
Share on other sites
2 hours ago, Network_Guy said:

try to manualy copy the pptx file to local disk then open it with shell execute and delete it after u close powerpointviewer,exp:-
 

#include <WinAPIShellEx.au3>
#include <WinNet.au3>

;I do declare the variables with the server credentials
$sServer = '192.168.20.13'
$sShare = 'Compartida\Carpetas Personales\formacion\formacion'
$sUsername = 'localserver\userfake'
$sPassword = 'pssworduserfake'

$sServerShare = '\\' & $sServer & '\' & $sShare

$result = _WinNet_AddConnection2("", $sServerShare, $sUsername, $sPassword, 1)

If $result Then
    FileCopy($sServerShare & "\AAAA.ppsx",@TempDir&"\AAAA.ppsx")
    $PID=ShellExecute(@TempDir&"\AAAA.ppsx")
    ProcessWaitClose($PID)
    FileDelete(@TempDir&"\AAAA.ppsx")

Else
    ConsoleWrite("Unable to connect to " & $sServerShare & @CRLF)
EndIf

 

Thanks for the hint. The goal is to do not store anything in the local drive (that's one of the reasons that the "Downloading" window may cause some heart attacks to my boss :sweating:).

The PowerPoints are going to be shown in a computer with no clipboard, the Explorer.exe has been changed by a own .exe in the regedit, the USB ports are disabled...

I've tried to create a ramdisk and hide it with 

FileSetAttrib($f_path,"+SH")

I'm pretty confident about that anything is downloaded into the hdd due the result of DriveSpaceFree()  but I would prefer to avoid a window that claims that it is downloading something.

Is there any chance of forcing the screen coordinate of this window with a regedit?

The computers do have the ALT+TAB disabled, so maybe it would be a chance of forcing it to be created outside the visible area?

Thanks for the ideas

Link to post
Share on other sites

I have archieved good results with this regwrite values:

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\PowerPoint Viewer\Options", "Left", "REG_DWORD", @DesktopWidth - 1)
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\PowerPoint Viewer\Options", "Top", "REG_DWORD", @DesktopHeight - 1)

And moving the window outside the visible area instead of just turning it transparent:

WinMove("[CLASS:NUIDialog]", "", @DesktopWidth + 8000, 9000, 1, 1, 1)

WinSetTrans("[CLASS:NUIDialog]", "", 0)

The values of the RegWrite do work when the values are lower than the @DesktopHeight and the @DesktopWidth.

At first I tried to put something like:

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\PowerPoint Viewer\Options", "Left", "REG_DWORD", @DesktopWidth + 9000)

But it didn't worked. The Downloading screen was still visible for a few ms.

The good part is that, even with this values, there is a harmless popup with a progressbar that says "Opening Presentation" that is placed inside the visible area plus the presentation is opened maximized inside the visible area of the desktop.

I'm going to do some more testing to see if it really get hidden everytime.

 

Now I'm going to try to open a MS Word .docx with MS Word Viewer without giving the option to open a new file from the File Menú.

Thanks for your help.

 

Greets from Barcelona 

Link to post
Share on other sites

I am pretty sure that the file is saved locally in the Download folder.  If the person would shutdown (unplugged) the computer during the presentation, the file would still be there at the next startup.  I think your approach has a breach there.  I would suggest you use InetGet and save the file into a ramdisk.  That way you won't ever see a download message and the file cannot be retrieved in the previous scenario I just described.

Link to post
Share on other sites
7 minutes ago, Nine said:

I am pretty sure that the file is saved locally in the Download folder.  If the person would shutdown (unplugged) the computer during the presentation, the file would still be there at the next startup.  I think your approach has a breach there.  I would suggest you use InetGet and save the file into a ramdisk.  That way you won't ever see a download message and the file cannot be retrieved in the previous scenario I just described.

I think it so, but there's no file anywhere. I've searched all around the disk and there's no ppt or any file with the same or similar size.

It would be great to see if there's any info about how PPVIEW.exe handles remote files.

Link to post
Share on other sites

Did you enable explorer to show system/hidden files ?  Because it is obvious that the file is saved somewhere locally... 

Link to post
Share on other sites
8 minutes ago, Nine said:

Did you enable explorer to show system/hidden files ?  Because it is obvious that the file is saved somewhere locally... 

Yes I did. I've also used DriveSpaceFree() Function and the disk's free space is the same before, during and after the presentation.

I think that it downloads the presentation somehow.

 (Using the same method I can play a video huge video in VideoLAN and it opens in a second).

I have argued against using formats as PowerPoints and they have not payed any attention to my claims.

You can open a pdf with a huge amount of programs, same for pictures and videos, but if you do want to open a ppt file then you have to use LibreOffice (it can not play ppt files in kiosk mode restraining "Save As option"), PowerPoint (it has a cost in licenses) or PowerPoint Viewer (discontinued and with very few options).

Link to post
Share on other sites

Use this tool to see where the file is located.  In the bottom panel, look at the files list, you will see the folder where the file has been downloaded.  Right click in PPVIEW.exe will tell you the name of the file.

Link to post
Share on other sites

I suppose then that the download is not creating a file, but it is reading the file into memory and closing the remote file right after the download.

Edited by Nine
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...