Click here to Skip to main content
15,896,063 members
Home / Discussions / C#
   

C#

 
GeneralCut Image Pin
jzb21-Jul-04 18:50
jzb21-Jul-04 18:50 
GeneralRe: Cut Image Pin
Heath Stewart22-Jul-04 4:10
protectorHeath Stewart22-Jul-04 4:10 
GeneralUser Controls's question Pin
jzb21-Jul-04 18:48
jzb21-Jul-04 18:48 
GeneralRe: User Controls's question Pin
Heath Stewart22-Jul-04 4:03
protectorHeath Stewart22-Jul-04 4:03 
Generalusing different interfaces still works! Pin
ting66821-Jul-04 18:36
ting66821-Jul-04 18:36 
GeneralRe: using different interfaces still works! Pin
Colin Angus Mackay21-Jul-04 23:52
Colin Angus Mackay21-Jul-04 23:52 
GeneralOne major tcp/ip headache Pin
TalkingBabb0t21-Jul-04 17:10
TalkingBabb0t21-Jul-04 17:10 
GeneralRe: One major tcp/ip headache Pin
Heath Stewart22-Jul-04 3:56
protectorHeath Stewart22-Jul-04 3:56 
I have yet to figure out what everyone's infatuation with writing a VNC-like application in C# is. This is really not a good idea, mind you.

Not only are there already clients that do this installed in Windows (NetMeeting is standard in Win98 and Win2K and newer, or some form of it; Windows XP already has remote assistance that's very flexible) but you can even use some of the APIs like NetMeeting to integrate into your own application.

The true remote desktops don't use an entire screenshot, but a virtual frame buffer. Consider this: when a region is invalidated in Windows, it sends the WM_PAINT message with an HRGN that specifies what needs to be repainted (in .NET, this corresponds to the Paint event and the PaintEventArgs.ClipRectangle property). This may be an entire window or just a portion of it. But the entire screen is not drawn each time. By using a virtual frame buffer you take advantage of this (requiring much less bandwidth). Only the bits for the newly drawn portion are transferred across the wire.

It's this approach - if you're intent on reinventing the wheel (there's lots of "wheels" already, many very heavily tested) - you should look into. Unfortunately, .NET is too high level for such a task. Even if you do manage to P/Invoke all the native APIs you'll need an declare all the structs and consts, you'll incur performance penalties because of marshaling. You could, of course, write a Managed C++ assembly that alliviate most of these problems (mixing unmanaged and managed code to make such functionality accessible to other .NET assemblies written in any language).

What you're currently doing will have problems like you're seeing. Far too much bandwidth is required and will most likely require more time to transfer than your current refresh time, creating a large bottleneck that won't go away and will eventually cause timeouts (pretty quickly). The more lag on the wire, the faster timeouts will start occuring.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: One major tcp/ip headache Pin
TalkingBabb0t22-Jul-04 16:19
TalkingBabb0t22-Jul-04 16:19 
GeneralAbout C# Rs232 communication Pin
resocman21-Jul-04 17:09
resocman21-Jul-04 17:09 
GeneralRe: About C# Rs232 communication Pin
Heath Stewart22-Jul-04 3:46
protectorHeath Stewart22-Jul-04 3:46 
GeneralRe: About C# Rs232 communication Pin
resocman22-Jul-04 19:59
resocman22-Jul-04 19:59 
GeneralEvents and Model Logic Pin
Leslie Sanford21-Jul-04 16:44
Leslie Sanford21-Jul-04 16:44 
GeneralRe: Events and Model Logic Pin
Heath Stewart22-Jul-04 3:43
protectorHeath Stewart22-Jul-04 3:43 
Generalpassing a form control to a class Pin
budha_man_9921-Jul-04 11:51
budha_man_9921-Jul-04 11:51 
GeneralRe: passing a form control to a class Pin
Colin Angus Mackay21-Jul-04 14:06
Colin Angus Mackay21-Jul-04 14:06 
GeneralRe: passing a form control to a class Pin
budha_man_9922-Jul-04 4:50
budha_man_9922-Jul-04 4:50 
GeneralRe: passing a form control to a class Pin
Colin Angus Mackay22-Jul-04 5:21
Colin Angus Mackay22-Jul-04 5:21 
GeneralRe: passing a form control to a class Pin
budha_man_9922-Jul-04 5:28
budha_man_9922-Jul-04 5:28 
Generalresize tabPages problem Pin
Andy H21-Jul-04 11:32
Andy H21-Jul-04 11:32 
Generalcolor button example Pin
ddelapasse21-Jul-04 9:20
ddelapasse21-Jul-04 9:20 
GeneralRe: color button example Pin
Gary Thom21-Jul-04 9:58
Gary Thom21-Jul-04 9:58 
GeneralRe: color button example Pin
Anonymous21-Jul-04 10:29
Anonymous21-Jul-04 10:29 
GeneralRe: color button example Pin
Gary Thom22-Jul-04 9:41
Gary Thom22-Jul-04 9:41 
Generalcut/copy/paste/undo Pin
HappyPaws21-Jul-04 8:36
HappyPaws21-Jul-04 8:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.