En cours

Fix C# Console Application

Hello all,

I have a C# console application that needs fixing. It nearly works. However, its not saving an application window as an image. I don't want to use the usual screenshot methods, I need to be able to render any window to an image even when windows UI is not running. Its nearly there but I can't figure the last bit out.

Everyone can have a look at this class, WHEN you fix it only bid then and that person will get the money straight away. Here is the class:

using System;

using [url removed, login to view];

using [url removed, login to view];

using [url removed, login to view];

using [url removed, login to view];

using [url removed, login to view];

using [url removed, login to view];

using [url removed, login to view];

using [url removed, login to view];

namespace Testing

{

class Program

{

private const uint WM_PRINT = 0x0317;

private const uint WM_PRINTCLIENT = 0x0318;

private const uint PRF_NON_CLIENT = 0x00000002;

private const uint PRF_CLIENT = 0x00000004;

private const uint PRF_ERASEBKGND = 0x00000008;

private const uint PRF_CHILDREN = 0x00000010;

[DllImport("[url removed, login to view]", SetLastError = true)]

private static extern bool SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, uint lParam);

[DllImport("[url removed, login to view]")]

static extern IntPtr GetWindowDC(IntPtr hWnd);

[DllImport("[url removed, login to view]")]

[return: MarshalAs([url removed, login to view])]

static extern bool GetWindowRect(IntPtr hWnd, ref RECT lpRect);

[DllImport("[url removed, login to view]", SetLastError = true)]

[return: MarshalAs([url removed, login to view])]

public static extern int WTSGetActiveConsoleSessionId();

[DllImport("[url removed, login to view]")]

public static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId);

[DllImport("[url removed, login to view]", SetLastError = true)]

static extern IntPtr CreateCompatibleDC(IntPtr hdc);

static void Main(string[] args)

{

Process window = new Process();

[url removed, login to view] = "[url removed, login to view]";

[url removed, login to view]();

[url removed, login to view]();

IntPtr handle = [url removed, login to view];

Bitmap image = new Bitmap(500, 500, [url removed, login to view]);

using (Graphics graphics = [url removed, login to view](image))

{

IntPtr hDC = [url removed, login to view]();

if(SendMessage(handle, WM_PRINT, hDC, PRF_NON_CLIENT | PRF_CHILDREN))

{

//[url removed, login to view]("Success!");

}

else

{

//[url removed, login to view]("Exception: " + [url removed, login to view]() + ", Error: " + [url removed, login to view]());

}

[url removed, login to view](hDC);

}

[url removed, login to view]("C:\\[url removed, login to view]", [url removed, login to view]);

[url removed, login to view](15000);

[url removed, login to view]();

//[url removed, login to view]();

}

[StructLayout([url removed, login to view])]

public struct RECT

{

public int Left; // x position of upper-left corner

public int Top; // y position of upper-left corner

public int Right; // x position of lower-right corner

public int Bottom; // y position of lower-right corner

}

}

}

The first person to do it will get the money and only the cheapest price.

PLEASE FIX THEN BID! It shouldn't take long for a pro to do it.

Compétences : .NET, Programmation C#

Voir plus : fix console application, console application screenshot, you fix, user32, ui programming, thread programming, threading programming, struct programming, static programming, sleep programming, sequential programming, reflection programming, public programming, programming reflection, programming notepad, programming methods, notepad png, notepad image, else programming, string programming, programming string, programming static, programming else, programming extern, get string

Concernant l'employeur :
( 43 commentaires ) London, United Kingdom

N° du projet : #1029723

Décerné à :

CloudLand

Hi, I can help you. Please check your PMB.

30 $ USD en 0 jours
(7 Commentaires)
5.9

21 freelance ont fait une offre moyenne de 33 $ pour ce travail

VileGnosis

Details in PMB

30 $ USD en 1 jour
(128 Commentaires)
6.5
crypted

Please check your pmb

30 $ USD en 0 jours
(23 Commentaires)
4.9
tonykim100

Hello sir! I am ready to start your work right now. Please refer your pmb. Thanks.

30 $ USD en 1 jour
(16 Commentaires)
4.2
bilal580

i can do this for you

30 $ USD en 1 jour
(8 Commentaires)
4.2
sm2mafaz

Hello There, Please have a look to the PMB for further details. Kind regards, Mafaz

30 $ USD en 1 jour
(9 Commentaires)
4.1
muthukrishnanram

Hi, plz check the PM

50 $ USD en 0 jours
(10 Commentaires)
4.0
junworried

hi, please see solution attached to private message. Regards :)

30 $ USD en 0 jours
(8 Commentaires)
3.7
aisha2010

Please check PM

30 $ USD en 0 jours
(2 Commentaires)
3.3
teget

Hello! I can solve your problem in just a couple of minutes. Please check private message for my sample work.

30 $ USD en 1 jour
(1 Commentaire)
3.3
codeison

Please check the PM

30 $ USD en 1 jour
(4 Commentaires)
2.8
cigara9393

ready for this project..check pmb

30 $ USD en 0 jours
(3 Commentaires)
2.4
softwarevamp

Hello, glad to help you!

30 $ USD en 0 jours
(1 Commentaire)
1.3
BeautyOfCode

Hi, please check PM.

30 $ USD en 1 jour
(0 Commentaires)
0.0
cswengrnaveed

Hi, Can you please let me know that this question still open or not. So that I can proceed further on this. Thanks

60 $ USD en 1 jour
(0 Commentaires)
0.0
mread

I am ready for this project.

30 $ USD en 0 jours
(0 Commentaires)
0.0
palinfotech

we have a team of 25 members with expertise in their profession. We have made a similar kind of projects. For further information please view your PMB. Ready to work with you Regards

30 $ USD en 0 jours
(0 Commentaires)
0.0
girishkolte2000

Please contact me for more details.

89 $ USD en 10 jours
(0 Commentaires)
0.0
ocherk

Hi, did you try to use [url removed, login to view](@"C:\[url removed, login to view]", [url removed, login to view]); instead of [url removed, login to view]("C:[url removed, login to view]", [url removed, login to view]); ?

30 $ USD en 1 jour
(0 Commentaires)
3.0
gnsonar

i have the experience on the c#.I can fix your problem.

30 $ USD en 5 jours
(0 Commentaires)
0.0
stoqnovst

Please check your PMB.

30 $ USD en 0 jours
(0 Commentaires)
0.0