Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?

User Image
RickyMoose
7 discussion posts
Per this thread, I see that you cannot directly manipulate a full screen RDP window using display fusion.

https://www.displayfusion.com/Discussions/View/rdp-not-opening-on-selected-monitor/?ID=721b8409-321f-444e-8690-afc9a64f8779#4

As a workaround I have modified my saved rdp file and added the value:

Code

smart sizing:i:1


With this value set, I can full screen the rdp window by pressing CTRL+ALT+PAUSE on the keyboard.
I am trying to automate this within a custom function but no matter what I have tried, I cannot send these characters to the window.

Function: Send CTRL+ALT+Pause

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)
    {
        // your code goes here

        // Convert the window handle to hexadecimal
        string windowHandleHex = windowHandle.ToInt64().ToString("X");

        BFS.Window.Focus(windowHandle);

// Press and hold the Ctrl key
BFS.Input.SendKeyDown("Ctrl");
BFS.Input.SendKeyDown("Alt");
// ... perform any operations while Ctrl is held down ...
BFS.Input.SendKeys("{VK_PAUSE}");
// Release the Ctrl key
BFS.Input.SendKeyUp("Ctrl");
BFS.Input.SendKeyUp("Alt");
        
        
        //-- Send the CTRL + PAUSE keystrokes
//        BFS.Input.SendKeys("%^{VK_PAUSE}");
        //BFS.General.Sleep(500);
        //BFS.Input.SendKeys("^%{VK_PAUSE}");
        // ^ ctrl   % alt

        // Use the hexadecimal window handle in GetUserConfirm
        BFS.Dialog.GetUserConfirm("Current Hwnd " + windowHandleHex);

    }
}


As you can see from the above example I have tried both SendKeyDown and SendKeys, but neither are working for me.

Using the AutoIT spy tool I can verify I am setting focus on the correct window handle.

Any ideas as to what I am doing wrong?

Thanks.
• Attachment [protected]: correct handle.jpg [24,044 bytes]
• Attachment [protected]: trigger example.jpg [8,604 bytes]
Aug 17, 2024 (modified Aug 17, 2024)  • #1
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Try just running this line:

Code

BFS.Input.SendKeys("%(^({VK_19}))");
Aug 19, 2024  • #2
User Image
RickyMoose
7 discussion posts
I tried using

Code

BFS.Input.SendKeys("%(^({VK_19}))");
but nothing happend.

other than using BFS.Window.Focus(windowHandle); is there a better way to ensure that is the target window getting the keystroke? If I hit the keys on the keyboard it works every time.

Thanks.
Aug 19, 2024  • #3
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
The BFS.Window.Focus(windowHandle); line just sends the code to the last focused window.

There might be something weird with the pause key, if you remove that and add a different key, does it work?
Aug 23, 2024  • #4
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)