Sign in to follow this  
Followers 0
telmob

Prevent native windows popup?

15 posts in this topic

Hello again.

I'm (still) making a program to prevent new apps to run, based on Software Restriction Policy.

However, when SRP is set, the new apps show a native windows popup saying the file was not found.

I know i can hide it when it shows, but is there a way to prevent it from showing or even to change its contents in a 'natural' way? Do i need a DLL for this?

Share this post


Link to post
Share on other sites



Why do you want to prevent the popup?

The user tries to start a program he isn't allowed to and I think he should know so he doesn't try it again.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Because i want to replace it with a custom tray popup in a non-intrusive way.

So when the user tries to open any file blocked, instead of having a popup saying the file is missing (which is inaccurate) a simple popup will rise saying an application was prevented from running.

Share this post


Link to post
Share on other sites

We don't use SRP here. Can you please post a screenshot of such a popup so we know how it looks like?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Well... i made a mistake. This popup is different from other solutions.

But still, i'd like to prevent it from showing.

Attached.

post-65971-0-48722800-1354638258_thumb.j

Share this post


Link to post
Share on other sites

Get the ControlID of the "OK" button using the Window Info Tool which comes with AutoIt. Then click away the window:

$ControlID = xx
While 1
  $hWindow = WinWait("", "blocked by group policy")
  ControlClick($hWindow, "", $ControlID)
   ; Display your message here
WEnd

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Is this the supposed ControlID? [CLASS:Button: INSTANCE:1]

I can't use it, keep getting a syntax error.

Edited by telmob

Share this post


Link to post
Share on other sites

How do you use it? Can you post your code?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Here it is:

$ControlID = [CLASS:Button: INSTANCE:1]
While 1
  $hWindow = WinWait("", "blocked by group policy")
  ControlClick($hWindow, "", $ControlID)
   ; Display your message here
WEnd

Also tried using something simillar to ControlClick example in the help file but couldn't use it as well.

Share this post


Link to post
Share on other sites

Try:

$ControlID = "[CLASS:Button; INSTANCE:1]"
While 1
    $hWindow = WinWait("", "blocked by group policy")
    ControlClick($hWindow, "", $ControlID)
    ; Display your message here
WEnd

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Not working. The program keeps running and doesn't recognize the window.

I think the problem is lying in the window title, which is variable. Not sure though.

$ControlID = "[CLASS:Button; INSTANCE:1]"
While 1
    $hWindow = WinWait("", "This program is blocked by group policy.")
    ControlClick($hWindow, "", $ControlID)
    MsgBox("","","App Blocked")
WEnd

Share this post


Link to post
Share on other sites

If you use the Window Info Tool, select the Summary tab and move the crosshair over the window, do you see the text "This program is blocked by group policy." listed under ">>>> Visible Text <<<<"?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

No, just 'OK'.

Edited by telmob

Share this post


Link to post
Share on other sites

Any way to 'grab' the popup window without from the 'OK'?

I don't to grab all the 'OK' windows or it'll grab a bunch :)

Share this post


Link to post
Share on other sites

I'm sorry to be bumping this thread, but i would really like to have this feature in my app.

Is there any way i can prevent this native windows popup from showing?

Share this post


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
Sign in to follow this  
Followers 0