Coder Social home page Coder Social logo

Comments (4)

justinstenning avatar justinstenning commented on August 17, 2024

You can comment out the bringprocesstofront as that was only required for
some old approaches.

On Friday, 12 September 2014, Csharper1972 [email protected] wrote:

I'm running battlefield bad company 2 and it's working on dx11.
When i'm clicking on the Request Capture button after some seconds it's
throwing an exception in Form1.cs in the method DoRequest() the exception
message is:

Could not set process window to the foreground

It didn't happen on DX9 game only on this battlefield bad company 2.

This is the full exception error message:

System.Exception was unhandled
HResult=-2146233088
Message=Could not set process window to the foreground
Source=System.Windows.Forms
StackTrace:
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate
method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
at TestScreenshot.Form1.DoRequest() in
c:\Temp\spazz\Direct3DHook-master\TestScreenshot\Form1.cs:line 218
at TestScreenshot.Form1.btnCapture_Click(Object sender, EventArgs e) in
c:\Temp\spazz\Direct3DHook-master\TestScreenshot\Form1.cs:line 196
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button,
Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr
dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context)
at TestScreenshot.Program.Main() in
c:\Temp\spazz\Direct3DHook-master\TestScreenshot\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[]
args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

Line 196 in form1 is:

DoRequest();

And line 218 in form1 is: progressBar1.Invoke(new MethodInvoker(delegate()
And the whole code in the DoRequest() method is marked with yellow when
the exception is show up.

And so far it happen only on dx11 game battlefield bad company 2 and only
when i click the button Request Capture

β€”
Reply to this email directly or view it on GitHub
#16.

from direct3dhook.

Csharper1972 avatar Csharper1972 commented on August 17, 2024

Thanks another question i'm not sure if it's issue or not. How can i make in form1 with a button click that it will show or not show the overlays ? One click will not show the fps another click will show. I know how can i call the Draw() method in DXOverlayEngine.cs from form1 or i can use the Inject button click Inject/Detach but i want just to display or not to display the overlays.

from direct3dhook.

justinstenning avatar justinstenning commented on August 17, 2024

Look at the CaptureInterface and CaptureInterfaceProxy classes. You can
extend to make any calls into the target application. Just have to create
appropriate event handlers.

On Saturday, 13 September 2014, Csharper1972 [email protected]
wrote:

Thanks another question i'm not sure if it's issue or not. How can i make
in form1 with a button click that it will show or not show the overlays ?
One click will not show the fps another click will show. I know how can i
call the Draw() method in DXOverlayEngine.cs from form1 or i can use the
Inject button click Inject/Detach but i want just to display or not to
display the overlays.

β€”
Reply to this email directly or view it on GitHub
#16 (comment)
.

from direct3dhook.

Csharper1972 avatar Csharper1972 commented on August 17, 2024

Thank you. Working.

from direct3dhook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.