|
Hello,
I am trying to find a faster, better way to know when something on the desktop changes. Could be application focus, text being typed, time in the systems tray changes..anything.
Instead of using a screenshot and figuring out the difference. Isnt there a way to tap into the desktop update events? Kinda like you hook into the mouse and keyboard events?
I know there are some custom video drivers out there that vnc uses. But I dont think thats something that can be used in C# affectivly.
Any suggestions or comments?
thanks
Steve
|
|
|
|
|
|
There are many different "events", as you call them, that get "fired" when something on the desktop changes. They're really window messages, but there so many different ones depending on what's going on, that you'll really find it difficult to capture all these changes.
What's the goal here? What are you really trying to accomplish?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the replys.
My main goal is to find a faster process to grab screen changes. Instead of using the whole take 2 bitmaps and compare method.
Going through tightVNC's code, they are hooking that video driver then checking the messages for an update, grabbing the region and sending it..genius.
Now if only I could tap into that somehow, my cpu would go down and my process time would be faster.
Steve Welborn
Software Architect
|
|
|
|
|
I have an application that connects to a Web Service.
When I clicked a button to open a form "A", at the same time I stopped the Web Service in IIS - this stopping action raised an event - this event will close all opening forms by calling Dispose() method of each form.
Because the form "A" was processing CreateHanlde() method when it was disposed, it threw following exception:
"An unhandled exception of type 'System.InvalidOperationException' occurred in system.windows.forms.dll
Additional information: Cannot call Dispose() while doing CreateHandle()."
==> How do I solve this problem ?
Giang Nam
|
|
|
|
|
Why is your WebService firing an event to trigger forms to close?
Why are you creating a form only to have it be killed off by this event? Wouldn't it be easier to create the form AFTER the WebService is shutdown? What does this form have to do with the WebService?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
- That's a Chat application.
- Every period of time, I call a method of Web Service to get messages sent to me. This is done by a Timer.
- When the Timer ticks, my application call that method but 'cause the IIS has been stopped, it throws an Exception.
- I catch this Exception and raise an ServerError event, this event will close all opening windows and ask User if he want to relogin.
==> Because, this event disposes all windows while one of them is calling CreateHandle() method, it throws above Exception.
==> That's my problem, thanks for answering me.
|
|
|
|
|
Hi, i want to get the file properties dialog of multiple files to show up in c#; same as if you were to select multiple files in explorer and hit properties. If someone could point me in the right direction id be thankful.
|
|
|
|
|
|
I've had no problem, so far, constructing object and structures that have constructors, however, from past experience, I have encountered struct objects (usualy COM) that do not have constructors.
All their values are initialised to zero, null, etc, by default, and their values are set individualy in public fields.
How would I create a new object of this type via reflection?
With code, i would simply declare a variable of that type and set the values, but this is an entirely different situation.
Cheers
Cata
|
|
|
|
|
Every object has a default constructor, unless it's explicitly made private, in which case, it's designed to be created by a factory method. You'll need to find the method and call it, I'd have thought.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Have a look at RSAParameters in .Net Reflector. The entire struct is just made up of public field members.
No constructors, methods, or properties.
There are a number of these objects that are in the .net library, and i'd like to know how to create an instance. From tinkering with COM i gather most objects of this type are used in marshaling.
And while i'm at it, what about int16/32/64 etc? I know I can parse them from a string but is there anyway to create an instance directly of a particular value?
Cata
|
|
|
|
|
Can anyone suggest how I can capture any packet that is sent from a host? The idea is to not let the packet out into the network, but to capture it, generate our own reply and send it back to the host. If I have the packet, I know how to strip it into the various layers and make a new one to send back. The problem is actually getting the initial packet.
I've looked at sniffer source code but that seems only to look what packets are on the line and not physically take them. Someone said that I should use a NIC in promiscuous mode? As far as I know, a NIC in promiscuous mode will listen to any packets on the network, not just ones destined for its own interface. I only want to capture the packets from the host that the application is running on and not from any other machine on the network. To try make this clearer, when the application is running, the host will not be able to communicate over the network but instead will only be able to communicate to the application.
Any help or pointers in any direction will be greatly appreciated!
Thanks!
|
|
|
|
|
Well, one problem you have is that Raw Sockets are restricted to Administrator use only. Normal users can't create packets from scratch...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the response! The application will be used in a classroom where each student will be running a server, so the Admin use is not a problem.
|
|
|
|
|
Hi,
I put a combobox on my winform C# and each time the user touch by mistake the mouse scroll wheel it gives another selection in the list and that's what I would like to avoid.
Is there a property where I can cancel the scroll wheel for the combobox?
Thanks for your help
from a beginner
|
|
|
|
|
No, there isn't.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
There's no property to use, but you can subclass a ComboBox and stop the scroll wheel message (WM_MOUSEWHEEL ) from getting through by overriding the WndProc [^] method
public class ComboBoxEx : ComboBox<br />
{<br />
public ComboBoxEx() : base()<br />
{<br />
<br />
}<br />
<br />
<br />
protected override void WndProc(ref Message m)<br />
{<br />
if (m.Msg == 0x020A )<br />
{<br />
return;<br />
}<br />
<br />
base.WndProc (ref m);<br />
}<br />
}
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
Hi Mathew,
Thanks for your code. Easy and it works fine.
Regards,
Davy
|
|
|
|
|
No worries
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
How can i hide or remove 1 or 2 of the buttons (next/previous month) in the MonthCalendar Control ?
Is there a way to do it ?
|
|
|
|
|
I don't think it's possible, the MonthCalendar control is a wrapper around the SysMonthCal32 common control and I don't see that as an option in the native control.
James
|
|
|
|
|
Hi all,
I am trying to achieve the same behavior as the FlowLayoutPanel control found in .NET 2.0, but with our current .NET 1.1 project.
Anyone knows of a 3rd party control that can do that?
Thanks!
|
|
|
|
|
|
I am trying to build a lottery program and want to read a comma delimited text file into my program and display it into text boxes has anybody got any suggestions or any help
|
|
|
|