Idea for a shell button - is this possible?

For general issues related to PWB v2.

Moderators: Tyler, Scott, PWB v2 Moderator

Post Reply
spragers
Benefactor
Benefactor
Posts: 153
Joined: Fri Dec 27, 2002 9:11 am
Contact:

Idea for a shell button - is this possible?

Post by spragers »

Hi,

I was wondering if you can think of any way to do the following:

Create a shell button labeled something like "this is a popup" that would

- close the current window
- add the URL of the window to a text file list of additions to be considered

The last part (adding the URL) would be easy enough to do in a script, proveded there was an easy way to retrieve the current URL. That doesn't show up in the registry anywhere, does it? (I wouldn't think so, since PWB can be run without installing it first). The first part would also seem do-able, maybe using the SendKeys functions or similar.

I just thought this would be an easy way for patrons to help us fight the war against popups :)

Thanks!

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

Easy enough, I can modify the CloseCurrent utility to add the URL to a text file. Unless someone else wants to take a shot at it.

--Scott

spragers
Benefactor
Benefactor
Posts: 153
Joined: Fri Dec 27, 2002 9:11 am
Contact:

Post by spragers »

I put together a short script that comes close, in case you're interested:

Dim PopFile
Dim YesNo

Const ForReading = 1, ForWriting = 2, ForAppending = 8

Set WshShell = WScript.CreateObject("WScript.Shell")
Set filesys = WScript.CreateObject("Scripting.FileSystemObject")

YesNo = WshShell.Popup("Are you sure you want to report this window as a pop-up, and close this window?", 10, "Report PopUp", 4+32)

if YesNo = 6 then
WScript.Sleep 2000
WshShell.SendKeys "%{F4}"
set PopFile = filesys.OpenTextFile("{filename}", ForAppending)
PopFile.WriteLine("A POPUP WINDOW WAS JUST REPORTED")
PopFile.Close
YesNo = WshShell.Popup("Thank you!", 2, "Report PopUp", 0+64)
end if

WScript.Quit()

As long as "SecondWindow - AlwaysOnTop = false" it looks like it works.

Post Reply