Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
Mrrellim69
16 discussion posts
I have a program that needs to load on Windows startup to populate a registration key. The only problem is that a window opens to say the the key has been registered but the window stays open until I click "Ok"

I can't figure out how to get create a trigger to close the window automatically when it opens.

any help would be appreciated.
Sep 3, 2021  • #1
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Hello,

What program launches that confirmation window? Could you send over a screenshot of the window?

Thanks!
Sep 7, 2021  • #2
User Image
Mrrellim69
16 discussion posts
I have attached a screen shot of the window and the trigger I have enabled.

The program is PDF-Xchange Vault.

Thanks
• Attachment [protected]: PDF Vault window.JPG [16,704 bytes]
• Attachment [protected]: PDF Window Trigger.JPG [59,478 bytes]
Sep 8, 2021  • #3
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Hello,

Thanks for sending that over. Let's make sure the trigger is actually grabbing that window itself.

Is that minimize action doing anything to the window? If you try using the "Move window to specific size and location" action to move the window, does that work?

Thanks!
Sep 8, 2021  • #4
User Image
Mrrellim69
16 discussion posts
Right now the trigger is grabbing the window and minimizing it to the system tray. If possible I would like to have the trigger completely close the window rather than minimize to the system tray.
Sep 8, 2021  • #5
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Hello,

If you create a scripted function in DisplayFusion and add this line:

BFS.Window.Close(windowHandle);

You can then call that function in the action pane of your trigger, and it should close that window out.

Hope that helps!
Sep 8, 2021  • #6
User Image
Mrrellim69
16 discussion posts
I removed the "minimize window to system tray" run function.

Then for the scripted function I tried both using C# and Visual basic. I enter the code line and click "Verify Function" and it says "Verify Successful".

I then click "ok", "Ok" and then "apply".

When I open the program the window just stays in the middle of the screen.
Sep 8, 2021  • #7
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Hello,

After you created the scripted function, did you go back to your trigger and use the "Run Function" action, and then select the scripted function you created?

Thanks!
Sep 8, 2021  • #8
User Image
Mrrellim69
16 discussion posts
Sorry, yes I did do that.

I have added a video of me creating the scripted function.
Sep 8, 2021  • #9
User Image
Mrrellim69
16 discussion posts
Yes I did.

I have added a video of me creating the scripted function.
• Attachment [protected]: Window Trigger.webm [25,239,609 bytes]
Sep 8, 2021  • #10
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Hello,

Ah, you'll want to take out the two front slashes before that line, as those cause your code to be commented out. The full script should look like this:

Code

using System;
using System.Drawing;

// The 'windowHandle' parameter will contain the window handle for the:
//   - Active window when run by hotkey
//   - Trigger target when run by a Trigger rule
//   - TitleBar Button owner when run by a TitleBar Button
//   - Jump List owner when run from a Taskbar Jump List
//   - Currently focused window if none of these match
public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        BFS.Window.Close(windowHandle);
    }
}
Sep 8, 2021  • #11
User Image
Mrrellim69
16 discussion posts
Thank you that works great!!
Sep 8, 2021  • #12
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)