Welcome, Guest.
Username: Password: Remember me

TOPIC: Programmatically trigger Screenshot

Programmatically trigger Screenshot 2 months 2 weeks ago #1

Hi,

I am looking for a way to programmatically trigger Reshade, trough ScriptHookVDotNet SDK, the Effect Toggle and Screenshot key.
I tried using SendKeys.Send("{PRTSC}") - nothing happens.
Does anyone has a suggestion how this can be accomplished?

Thanks in advance.

Johan
The administrator has disabled public write access.

Programmatically trigger Screenshot 2 months 2 weeks ago #2

Untested, but should point you in the right direction:
[DllImport("user32.dll")]
static extern int SendMessage(IntPtr hWnd, int Msg, uint wParam, uint lParam);
[DllImport("user32.dll")]
static extern IntPtr GetActiveWindow();
...
IntPtr hWnd = GetActiveWindow();
SendMessage(hWnd, 0x0100 /*WM_KEYDOWN*/, 0x2C /*VK_SNAPSHOT*/, 0);
SendMessage(hWnd, 0x0101 /*WM_KEYUP*/, 0x2C /*VK_SNAPSHOT*/, 0);

ReShade monitors the window message queue for input events, so sending one to it should make ReShade pick it up.
Cheers, crosire =)
Last Edit: 2 months 2 weeks ago by crosire.
The administrator has disabled public write access.
The following user(s) said Thank You: Johan

Programmatically trigger Screenshot 2 months 1 week ago #3

Hi

Just now I decidet to become a patreon of yours. Such excellent work has to be supported! B)
I was hoping to get some additional advice from you to get my screenshot issue solved.

The following has to be accomplished with c# somehow:
            if (e.KeyCode == Keys.H)
            {

                GTA.Script.Wait(2000);
                Game.Pause(true);
                SendKeys.Send("{PRTSC}"); //Take Picture without modified ReShade shader
                SendKeys.Send("{PGDN}");  //Toggle to preselected ReShade shader
                SendKeys.Send("{PRTSC}"); //Take Picture with additional shader
                SendKeys.Send("{PGDN}");  //Toggle back
                Game.Pause(false);

            }

Futhermode I would like to know if there is a way to extract a higher than 8bit depth image?
Is there a Date yet for releasing the next Reshade version with path tracing?

Thank you in advance.

Johan
Last Edit: 2 months 1 week ago by Johan.
The administrator has disabled public write access.

Programmatically trigger Screenshot 2 months 1 week ago #4

I don't have a Patreon, so that would surprise me. The code I posted above is C#. As for depth: Those buffers already have at least 16-bit. But ReShade can only save 8-bit screenshots. There is also no ReShade version with path tracing, nor is one planned (ReShade does post processing, not path tracing). If you mean Marty's SSRTGI shader, then that's in beta and can already be downloaded.
Cheers, crosire =)
The administrator has disabled public write access.

Programmatically trigger Screenshot 2 months 1 week ago #5

Hi,

then Pascal is the lucky one B)
Well I will give it another try then!

regards
The administrator has disabled public write access.

Programmatically trigger Screenshot 2 months 1 week ago #6

Hi Crosire,

This issue is extremly frustrating, I tried varios approches with my modest skillset in this area without making any progress.
Is there a way to get a working codesnipped from you for scipthookVdotnet (GTAV)?
- because this is very important for me, feel free to charge me for that!

thank you
The administrator has disabled public write access.

Programmatically trigger Screenshot 2 months 1 week ago #7

Hi Crosire,
I hope that I am not totally on my own now - am I :unsure: ?! However, after doing my "research", I guess GTA V is actively filtering low level "SendInput" calls.
Trying to untilize various wrappers like InputSimulator and Inputmanager where not successful at all.
In fact, only by inserting the namespace of these two, resultet in a "script does nothing".
How would you explain this strange behaviour?
Even stranger is, that the script becomes undebugable . No error was cought.
Is there something like a payed unofficial "professional support" for Reshade or SkripthookVdotnetSDK which I can take in demand?
It would be nice hearing from you in this regard.

Thank you
Last Edit: 2 months 1 week ago by Johan.
The administrator has disabled public write access.