Programmatically trigger Screenshot

  • Johan
  • Topic Author
More
4 years 7 months ago #1 by Johan Programmatically trigger Screenshot was created by Johan
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

Please Log in or Create an account to join the conversation.

  • crosire
More
4 years 7 months ago - 4 years 7 months ago #2 by crosire Replied by crosire on topic Programmatically trigger Screenshot
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.
Last edit: 4 years 7 months ago by crosire.
The following user(s) said Thank You: Johan

Please Log in or Create an account to join the conversation.

  • Johan
  • Topic Author
More
4 years 7 months ago - 4 years 7 months ago #3 by Johan Replied by Johan on topic Programmatically trigger Screenshot
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: 4 years 7 months ago by Johan.

Please Log in or Create an account to join the conversation.

  • crosire
More
4 years 7 months ago #4 by crosire Replied by crosire on topic Programmatically trigger Screenshot
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.

Please Log in or Create an account to join the conversation.

  • Johan
  • Topic Author
More
4 years 7 months ago #5 by Johan Replied by Johan on topic Programmatically trigger Screenshot
Hi,

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

regards

Please Log in or Create an account to join the conversation.

  • Johan
  • Topic Author
More
4 years 7 months ago #6 by Johan Replied by Johan on topic Programmatically trigger Screenshot
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

Please Log in or Create an account to join the conversation.

  • Johan
  • Topic Author
More
4 years 7 months ago - 4 years 7 months ago #7 by Johan Replied by Johan on topic Programmatically trigger Screenshot
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: 4 years 7 months ago by Johan.

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.