|
Yes there is. In windows system there is something called WinEvents . Pretty much like C# events. These are system messages sent to whomever is interested in receiving them. You declare yourself interested in receiving a certain message by registering a hook to that message -aka WinEvent-.
Anyway. Here is the sum up:
Event to hook: EVENT_SYSTEM_FOREGROUND . Click here for more events[^].
Hook function: SetWinEventHook()
Click here for an example[^]
Regards
|
|
|
|
|
Having solved the original problem I have now run into more threading problems. When i fire an event in my bindable list i get the dreaded "cross-threaded operation..." error. No problem i thought, i'll cast the target to control and invoke against that, that'll work. I then discover that the target is of type CurrencyManager and does not have an invoke method.
How can i raise an event back to the currency manager on the thread that the control it is managing was created on?
Thanks Russell.
My early morning sleepy post is below
------------------------------------------------------------------------------------------------
Hi guys,
I've got a datagridview in my application which is bound to an IBindableList which i have built to implement sorting filtering etc. I've mad some changes to the events within my app to make sure that the background threads execute in the right order and now i only have blank rows in my grid. When i select a filter criteria the right number of lines are displayed in the grid but they are all empty. I've inspected the underlying collection and the data are all correct. The grid i requesting the objects from the collection when i would expect it to. I've placed breakpoints in the property get code and it seems that the grid is not requesting any data.
I would greatly appreciate any help you can give.
Thanks
Russell
-- modified at 8:50 Monday 4th December, 2006
|
|
|
|
|
Managed to answer my own question as i closed the browser.
I had moved the line of code from the form constructor into an eventhandler. I've now made it invoke the code that sets the datasource and it's looking good.
Russ
|
|
|
|
|
Hi,
I have written a Windows form that I can manually Hide or Show either using a NotifyIcon or from other methods in my code.
However whatb I cannot yet do is Hide the application window when the application is first loaded.
It always displays on the screen and has to be manually hidden by the user clicking a button. After that point it, so far, can be hidden or shown as required.
I have tried setting WindowState to minimized in the FormDesigner code however it then does not always become visible when I want.
Can anyone advise what I am doing wrong?
Thanks Andrew
|
|
|
|
|
In your form's constructor:
this.Visible = false;
Then hide/show it as you like.
Regards
|
|
|
|
|
Hi Coders;)!
I wanna use somthing for adding item to the shortcut menus in the windows explorer. but I do not find true way yet for doing this stuff.
I think IshellExtInt & IContextMenu Interfaces are usefull for this. who khow how it works?
|
|
|
|
|
Hello, I am currently trying to program conway's game of life, but I am completely clueless!!!! Can someone help please?
|
|
|
|
|
|
Thanks for the link, it's great, I already understand what it's supposed to do, but I don't know how to go about implementing it.
|
|
|
|
|
Hi all,
I am using Visual Studio 2005 to develop a form based application in C#. I have a Tree Ctrl in my form and i want that all classes should know about the current seletion in tree ctrl.
Is it possible in C# to share a variable across the classes as we do in MFC through application class. We just need to refer to Application class (theApp) and we access the variable.
How it can be done in C#.
Thanks in advance.
Gajesh Mangal
Pune(India)
|
|
|
|
|
It's possible, but you should ask yourself if you want this. It's pretty clear this is going to break your MVC design, if you're using it.
class Application<br />
{<br />
private static TreeNode selectedTreeNode;<br />
<br />
public static TreeNode SelectedTreeNode<br />
{<br />
get { return selectedTreeNode; }<br />
set { selectedTreeNode = value; }<br />
}<br />
}
Assign the node from the GUI and use it from any other class.
WM.
What about weapons of mass-construction?
"You can always try to smash it with a wrench to fix that. It might actually work" - WillemM
|
|
|
|
|
The most common equivelant to the application class in MFC would be to create a class full of public, static properties. As there's only one application class in MFC, so too, static variables can be seen from anywhere.
A better approach is to consider when the second class needs to see inside the first one, and set up delegates to provide this communication.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi! I need to extract all the numbers from string:
-.8497E-02 .8497E-02 .0000E+00 -.8339E-01 -.5225E-02 -.1366E+02
the position and format of numbers is always the same.
|
|
|
|
|
First fragment the string in multiple string each of them containing the string representation of one number with String.SubString method or maybe more easily with String.Split(" ") as your example implies that string representation are delimited by white spaces.
To convert each string representation into a number use Double.TryParse (.NET 2.0) or Double.Parse (prior versions).
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
|
Hi,
I love coding with a plain text editor and the command
prompt compiler. I have the framework version 1.1 with
service pack installed, and the 1.1 SDK as well.
Just wanted to know if there's anything that cannot be
done without using the IDE. Is there?
If a person is able and has the know-how, anything can
be done using the "stupid" notepad and "painful" command
prompt compiler, right?
ASP - AJAX is SEXY. PERIOD.
|
|
|
|
|
Bulky Fellow wrote: Just wanted to know if there's anything that cannot be done without using the IDE.
No there isn't. You just loose some comfort in doing it.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Bulky Fellow wrote: Just wanted to know if there's anything that cannot be
done without using the IDE. Is there?
Designing a GUI quickly, I guess. But, no, at the end of the day, I doubt that there's anything you can't do, given enough time.
Bulky Fellow wrote: If a person is able and has the know-how, anything can
be done using the "stupid" notepad and "painful" command
prompt compiler, right?
I'm not sure anyone said it was stupid. If you're coding for money, it's a stupid way to write code ( it's slower, and not fair on your employer ), but if you're coding for fun, go for it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi
Does anyone have any idea or any useful links as to how one goes about shifting the focus from one application to a totally different one, that is currently running?
Thanks,
RainFox - cunning, with some cloudy clueless moments, yet cool and fresh
|
|
|
|
|
|
Hello,
I'm working with active directory in asp.net and C# as codebehind and I've used:
directorysearcher search =new...;
search.propertiesToLoad.Add("cn");
That give me the user name. now if I'm also getting the "memberof" property I'm getting alot of groups for the user.
Is there a built in function that tell me if the user is in a specific group instead of writing my own function that will run on all the groups that the user is a member of them and compere?
some thing like:
bool x=isCurrentUserMemberof("myGroupName");
Hope i was clear enough.
Thanks.
|
|
|
|
|
again and again i am stuck with the active directory issues.
Now i am trying to add a user. I am able to do so but with one big problem.
The problem is that the new user is taking a user name different than what i am giving. IT is taking something like that: "$K51000-JA95P8M1QM23" .
The letters and number changes but the same concept.
I am using this methode to add a user:
<br />
DirectoryEntry entry = new DirectoryEntry("LDAP://mainsrv/OU=" + "ITC Users" + ",DC=ITC" + ",DC=local");<br />
<br />
DirectoryEntry user = entry.Children.Add("cn=" + userName, "user");<br />
<br />
user.CommitChanges();<br />
<br />
user.Properties["sAMAccountName"].Value = userName;<br />
<br />
user.CommitChanges();<br />
where userName is a string that i define through a textbox
I am adding the rest of the fields in the same concept:
example:
<br />
user.Properties["displayName"].Value = firstName;<br />
user.CommitChanges();<br />
all the other properties of the user different from the userName are being added succesully with no problem.
Any suggestions??
best regrads,
Jamil Abou Khalil
|
|
|
|
|
Hi.when i make changes in a project server or a sharepoint portal,i need to send alerts to a mobile pc that changes have been made(e.g:document added,deleted,updated etc).is there a way to do this?i am using windows 2000 professional.
thanks in advance
|
|
|
|
|
Sharepoint 2003 offers some pretty good stuff for notifying users of a change. If your mobile device has e-mail, it is doable without much work.
Setup the device to sync with your exchange server and let the sharepoint server send e-mail notifications to the e-mailaddress being synchronized with the server.
WM.
What about weapons of mass-construction?
"You can always try to smash it with a wrench to fix that. It might actually work" - WillemM
|
|
|
|
|
thank u .but how do i get started?i do have sharepoint 2003 and project server installed on my system.can u give me some code structure or any steps to follow for getting this done.your help would be greatly appreciated.
thanks in advance
|
|
|
|