|
Look at the SystemEvents class.
|
|
|
|
|
I found another way to do it.
protected override void WndProc(ref System.Windows.Forms.Message m)
{
// defined in winuser.h
const int WM_QUERYENDSESSION = 0x0011;
switch(m.Msg)
{
case WM_QUERYENDSESSION:
//////////////////
// cleanup section
//
//////////////////
base.WndProc(ref m);
break;
default:
base.WndProc(ref m);
break;
}
}
Thank you "the last free name" for your suggestion!
|
|
|
|
|
Hi all,
For a while I want to do something with MS Outlook (2003). I have this 'great' idea of adding data from objects which are connected to the email. An example;
If I was writing a email message to John Doe and I wanted to display his working location. Normally I would have to go into his contact details and look it up. This whole process could be done faster. By making a system like the code insight in MS Visual Studio ( you know; when you press 'sys' and a dropdownbox already displays system). People would type something like [recpient].worklocation and when the email is send, my tool replaces the [recpient].workLocation with John Doe's real work location.
Now for my problem. Since I'm new to Office programming I just started reading almost everything on it. I know about the six Outlook API's and the Office addin system. But still I cant get to the email typing part. I know a 'dirty' way with hooks but that’s my last resort. I want to design this clean. So how do I make a Office Add-in which monitors the typed text in MS outlook? And how can I modify the emailed text before sending?
Well that’s it, I hope someone can help me. I would really like to know more about Office development so any hints/tips/urls are welcome.
|
|
|
|
|
I have a checkedlistbox control which i am pupulating from a table.I am saving the value as a string in which all the values selected are concatenated and stored into sa sting feild in database. Saving is no problem. But i want that stored values should be automatically selected on form load but it is'nt doing this.No Error nothing but the values previously seleted are not selected now.
I am posting my both functions
public static string SetValueFromListBoxes(CheckedListBox lst)
{
string strCheckedValues;
strCheckedValues="";
string strStringCheckedValues="";
for(int i=0;i
|
|
|
|
|
Have you check the value of checked list box in the database? I think, you can easily find the solution if you debug it. Good luck
<italic>Work hard, Work effectively.
|
|
|
|
|
i Could'nt get u. say i have four values a,b,c,d in the table which i am populating in the list. Now if a,b is checked i am saving that as a string containing a,b. now when i need to retrive i am looping through the listbox entries and if that is matching the value from the database i am setting that value in listbox at that index to be checked. but its not checking the value and also giving no error.
thanks
|
|
|
|
|
I know the situation. You can find out the solution by your self first by debugging. Tracing each variables, eventually you will find the problem. You know how to debug, right? Let me know if you haven't figured it out.
<italic>Work hard, Work effectively.
|
|
|
|
|
There is np porpblem at all from tha database side . all the values are perfectly matching and all values selected are selected.I ahve figured out the problem .its sonething with the load event of form the value does not appear selected but if i load the form first and then load the value from database everything is fine.its many be something with the repaint of listbox. i donot know
|
|
|
|
|
Hello
I am trying to open an assembly file by using fileopenDialogBox and unable to do so... Can anyone help me in this regard... Infact I am trying to open Dll's from GAC probably that is the problem... Plz help me...
Thanx
|
|
|
|
|
Hi man,
try this:
Assembly exeAssembly = Assembly.LoadFile(OpenFileDialog1.FileName);
Hope that Helps.
GanDad
|
|
|
|
|
I have a class I declared as static.
It works fine. It simply inserts a record into the database.
Firts I specify the catabase type(Access or SQL) from an enumeration and populates a coonection string.
But I would the form or web page to automatically populate the connection string.
The text for the connectionstring is in a web.config or appname.exe.config file and always has the same name "connectionstring".
Any ideas?
Nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
How about adding a type constructor and populating the connection string there? Something like
class MyForm : Form
{
static MyForm()
{
}
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
i'm trying a treefolder and i've got some probleme retrieving from which drive comes a treenode.fullpath.
lets say i've got a node like this
-my computer - drive C - folder 1a - folder2
- folder 1b
- drive D - folder 4c - folder 3
when i get a fullpath i've got
my computer\drive C\folder 1a\folder2
so i get only the "\folder 1a\folder2" part
then i dont know how to determine that drive C is "C:\"
i thought of getting the index of drive C and map it in the getlogicaldrive list
but how do i get the drive C index when i'm in folder2 node ?!
|
|
|
|
|
Use the tag property while loading the treeview and get the link from it.
|
|
|
|
|
well the fact is that the drive is embedded in the tag but since i've got a root node
i can't happend to get it
i use the selectnode then i'm stuck to find the level 2 node which happens to have the drive path in its tag.
root - drive 0 (tag = c: ) - node 1
. - drive 1 (tag = d: ) - node 2 - nod3 -nod4 <- selected node
nodes[0].nodes ...?
|
|
|
|
|
I'm in my first year of college, and I am trying to get ahead in computer science. I just bought a book called Robert Sedgewick's Algorithms 3rd Edition in C++. Could someone give me an idea? Would it be a good idea to study the whole book? Or certain parts of it? Or get direction or guidelines elsewhere? So far I've learned C++, C# and VB .Net... I thought that learning different data structures and algorithms would be a next good step, but am I wrong? There should probably be some good steps as good advice to advance a novice programmer like me. Could anyone help me here please? Thanks...
|
|
|
|
|
Knowing many data structures and algorithms is always good. But consider not learning too much theroretical things in such a small timespan. Its VERY important to try things out. Make up a project in your mind and just do it. You could also write an article here on CodeProject. This way you would even have some reviewers.
|
|
|
|
|
I can suggest you my method, but I don't tell you its the best
When I intrested in a new language, first I read articles, about its features.
And than I start coding, so somebody said its wrong way, but I don't think so, because, while I try to coding my ideas I brows a lot of other articles, and books, to can implement my idea. It's mutch an intristing way, but sit down in the chair, and read a million page of algorithms yahh .
I always write little application for myself eg: file managger, picure weaver, textr editor, math formulas to help do my homework, and such little thiks.
And now I've millions line of code to write myself, nad I think I'm in friend with some usefoul language.
Wish you the best, do't give up, programming is the best thing
Yust one more suggestin:
Visit this site as often as you can, it's the best place I ever fint in the WWW.
PS:
Sorry my bad english
Nemo (form Hungary )
|
|
|
|
|
I am working on a project which needs to constantly refresh a form. If the processing speed is low, the form refreshing will become slower and slower. Is there a way to cancel all those previous redraw messages and just process the latest one?
Thanx
|
|
|
|
|
Hi guys it is very important for me can create a floating toolbar that appear active if the main one is active, and not when the main is not.
Ok it need to handle hook windows message and it is not relly simple but it is possible you can see it exists and works in much graphic program gui and you can see a c++ example here: http://www.codeproject.com/docking/dockwnd.asp
Ok now i need a C# version of this example but i don't know where.
If someone know where can i learn or if he can show me some row of code i'm grateful.
|
|
|
|
|
How many times are you going to ask this question, then ignore the answers we give??
Last time. You DO NOT hook windows messages to get this to work!!!!!!!! Only ONE window can ever be active. I KNOW there are applications that are out there that give you the ILLUSION that two windows are active. This is NOT the case. You have to owner draw the tool window to get it to appear active when it really isn't.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Now i'm so curious to know why isn't this the case!!
What difference came from?
I answer you it is the same stuff!!!!! Not different!!!!!!
And in the tutorial you can see they use hooking windows message to get this ILLUSION! not using a own drawing becouse if i use a blue drawing for the tite bar of my toolbar like the main and the user use a grey windows impostation it works bad!!!!
So i tell you if you don't know how, please don't answer telling these things!
Thanks
|
|
|
|
|
Why don't you read the article? It's actually very very simple:
http://www.codeproject.com/docking/dockwnd.asp#DEACTIVATE[^]
And no, you don't uses hooks to intercept window messages. Simply override WndProc in your derived class, check for WM_NCACTIVATE message, and before calling base class, always set wParam to true (if your main window has focus.) In the article it takes two lines of code.
[EDIT: A couple of things: First, VS.NET and Office *do* use ownerdrawn title bars. And second, in VS.NET, a toolbar's caption bar never is painted active (only for docked windows.)]
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
ok, but how can i set for my window a my owndrawed title bar?
|
|
|
|
|
You don't. You set your window to have no titlebar at all, and then paint one at the very top.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|