Đang Thực Hiện

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.

Kỹ năng: .NET, Lập trình C#

Xem thêm: fix console application, console application screenshot, you fix it, you fix, user32, ui programming, thread programming, threading programming, there fix it, the fix it, t$c, struct c programming, string programming, string c programming, static programming, sleep programming, sequential programming, reflection programming, public programming, programming reflection, programming notepad, programming money, programming methods, notepad programming, notepad png

Về Bên Thuê:
( 43 nhận xét ) London, United Kingdom

Mã Dự Án: #1029723

Đã trao cho:

CloudLand

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

$30 USD trong 0 ngày
(7 Đánh Giá)
5.9

21 freelancer đang chào giá trung bình $33 cho công việc này

VileGnosis

Details in PMB

$30 USD trong 1 ngày
(128 Đánh Giá)
6.5
crypted

Please check your pmb

$30 USD trong 0 ngày
(23 Đánh Giá)
4.9
tonykim100

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

$30 USD trong 1 ngày
(16 Đánh Giá)
4.2
bilal580

i can do this for you

$30 USD trong 1 ngày
(8 Đánh Giá)
4.2
sm2mafaz

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

$30 USD trong 1 ngày
(9 Đánh Giá)
4.1
muthukrishnanram

Hi, plz check the PM

$50 USD trong 0 ngày
(10 Đánh Giá)
4.0
junworried

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

$30 USD trong 0 ngày
(8 Đánh Giá)
3.7
aisha2010

Please check PM

$30 USD trong 0 ngày
(2 Đánh Giá)
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 trong 1 ngày
(1 Đánh Giá)
3.3
codeison

Please check the PM

$30 USD trong 1 ngày
(4 Đánh Giá)
2.8
cigara9393

ready for this project..check pmb

$30 USD trong 0 ngày
(3 Đánh Giá)
2.4
softwarevamp

Hello, glad to help you!

$30 USD trong 0 ngày
(1 Đánh Giá)
1.3
BeautyOfCode

Hi, please check PM.

$30 USD trong 1 ngày
(0 Đánh Giá)
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 trong 1 ngày
(0 Đánh Giá)
0.0
mread

I am ready for this project.

$30 USD trong 0 ngày
(0 Đánh Giá)
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 trong 0 ngày
(0 Đánh Giá)
0.0
girishkolte2000

Please contact me for more details.

$89 USD trong 10 ngày
(0 Đánh Giá)
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 trong 1 ngày
(0 Đánh Giá)
3.0
gnsonar

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

$30 USD trong 5 ngày
(0 Đánh Giá)
0.0
stoqnovst

Please check your PMB.

$30 USD trong 0 ngày
(0 Đánh Giá)
0.0