|
How do u work with MSN messager and notepad, i want to get your some source code.
Please ,Thank u very much
Sorry ...
|
|
|
|
|
Thats the code that give you on msn and notepad.
i'm looking to work also on Word and Yahoo...
private Point getCaretLocation()
{
IntPtr hFocus = (IntPtr)GetForegroundWindow();
IntPtr hFore;
IntPtr id=IntPtr.Zero;
if (hFocus != IntPtr.Zero)
{
hFore= (IntPtr)GetForegroundWindow ();
AttachThreadInput((int)GetWindowThreadProcessId((int)hFore, id),
GetCurrentThreadId(), 1);
hFocus = (IntPtr)GetForegroundWindow();
Point mypoint=Point.Empty;
GetCaretPos(ref mypoint);
Console.WriteLine(mypoint.ToString());
ClientToScreen (hFocus, ref mypoint);
return mypoint;
}
return Point.Empty;
}
R.Z
|
|
|
|
|
Im using access database to store some customer information.
I have a table with an autonumber field.
I want to get the value of the autonumbered field, for the last added record in that table? So i can use it as my Customer ID for the next entry of customer details.
if the last generated autonumber is
Ex:
100 ->
the next customer id should be 101, can anyone please help or can point me to the right direction :)
how do i do it using ado.net? Just learning c# and ado.net :)
+============================================================================
Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Don't use the pre tag on the message. The font isn't that easy to read, and the text doesn't wrap.
After you insert a record, use the query "select @@identity" to get the id that was created for the record.
---
b { font-weight: normal; }
|
|
|
|
|
thanks Guffa for the reply ill check it out
Sorry for the pre tag
|
|
|
|
|
yes,
Rows = table.Select("select @@identity");
in Sql Server
INSERT INTO jobs (job_desc,min_lvl,max_lvl)
VALUES ('Accountant',12,125)
SELECT @@IDENTITY AS 'Identity'
@@IDENTITY is SQL system variable
datatable have very SQL method , So you think dataset like a small SQl server
Agree ...
|
|
|
|
|
I am just starting to look into MSBuild. Wonder if anyone could offer any pointers? Would the following be an easy thing to do?
- Build a set of .CSProj files, in dependency order
- Specify the 'reference path' as to pick up the correct dependies
- Override what is in the project file and output to a build folder.
Would MSbuild fully support this?
Thanks in advance
Aj
|
|
|
|
|
I have a need to grab the mouse and move it to specific locations in a target window, approximately once a second.
Each time I grab the mouse, I save it's current position and put it back when i am done. However, I do not want to grab the mouse if the User is currently using it (like when pressing the left button for a drag) in some OTHER application as that causes undesirable effects and is a MAJOR irritation to the User.
I think I need to get information about the mouse buttons that is system-wide in scope (not form-specific nor thread-specific).
I hope that makes sense.
Any ideas?
Thanks.
|
|
|
|
|
You might use the MouseEnter and MouseLeave events to keep track of
the presence/absence of the mouse in your application.
Remark: some special care may be required when you also use menus, since
clicking them seems to interact with the normal Enter/Leave sequences.
Luc Pattyn
|
|
|
|
|
thanks for response ... but that does not help ... i need to know when the mouse is IN USE, not when it has left MY form.
|
|
|
|
|
OK , sounds much like activity detection; this is used e.g. by screen savers,
so I suggest you look at one of the many screen savers on CodeProject.
Furthermore, you could look at a "global system hook" (as explained in
http://www.codeproject.com/csharp/globalsystemhook.asp[^]).
Luc Pattyn
|
|
|
|
|
thank you, luc ... will do
|
|
|
|
|
hi. I want to share a file (.cs) in two projects. I am writing server-client type seperate project s, they run at the same time, I have classes that I use both of them. I want to share a .cs file say sharedClasses.cs and want it to be compiled from the new code file. normally without this, I always copy the same code to other project's sharedClasses.cs..
|
|
|
|
|
I would make a project for main functions, compilled to a library, and one project for the client and server type, but in one solution. First compile the class, and after that the client and server.
|
|
|
|
|
I'd put the files you want to share into a dll
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
In Solution explorer, chose the projet you wish to shsre the file TO., right click and choose add->existing item.
browse to the file you wish to share and select it. BEFORE CLICKING THE ADD BUTTON, click the down arrow on the right of the add button, and choose "add as link" from the drop down. The selected file will now be shared to your project, rather than copied to it...
Who'd a thunk it - button cross bred with a combo. Took me for ever to stumble across that non-intuitive POS.
|
|
|
|
|
I have afew questions regarding the tab page control:
1) I have to force the user to not change the page untill a database is loaded. I used the invalidating event to force the user not to change focus untill the dataset is loaded. the only problem is:
i don't kow how to put the condition: dataset.tables.count!=0 is right??
and
does the validating event actually worg between tab pages?
2) I want certain tab pages to be either disabled (I mean to appear on the tab control disabled, not all the controls on it to be disabled) or invisible(likevise)
how do i do that?
rzvme
|
|
|
|
|
rzvme wrote: i don't kow how to put the conditio
1)If you use .Net 2.0 there is an event called DataSet.Initialized, and a property called DataSet.IsInitialized. When the Dataset finishes initialization, the event fires, and the property is set to true.
rzvme wrote: 2) I want certain tab pages to be either disabled (I mean to appear on the tab control disabled, not all the controls on it to be disabled) or invisible(likevise)
how do i do that?
2) I don't think I caught up with you, but if I got you right, then you don't want to hide, nor disable the tabpages and the inner controls, yet you still don't want to allow changing the current page. You can handle TabControl.SelectedIndexChanged event, and check IsInitialized in it. If it wasn't true, revert the selected index to the page you desire.
Regards
|
|
|
|
|
1) you may write :dataset.tables[tablename].Rows.count!=0
2) tabpagechange event can handle this.
Sorry ...
|
|
|
|
|
yes, but how do i get the page(index or name) from wich the index/name was chaged? the tab control doesn't have a last selected page or last selected index property.
Another problem is the fact, i think, the tabcontrol selected index changed occurs after the tabpageenter event.
-- modified at 1:48 Sunday 29th October, 2006
rzvme
|
|
|
|
|
in the namr og god
hi.
where i can get (ocr) for programing in mysoftwar?
tankyou.
|
|
|
|
|
You mean you want to make your program an OCR engine? In what language? The easiest way is to use office interop if it has OCR in it. Otherwise you'd have to buy an OCR component.
Regards
|
|
|
|
|
Hi There....
I am looking to iterate through A form's Controls collection. However i am also interested in control which are the child of panels. Is there any built support in WinForms? Or is the solution just to write my own little recursive method?
Thanks in advance
Aj
|
|
|
|
|
Hi,
yes recursion is the way to go:
private void LoopThroughControls(Control c) {
foreach (Control subControl in c) {
LoopThroughControls(c);
}
}
Within your Form just call: LoopThroughControls(this);
Robert
|
|
|
|
|
Thanks Robert - Quite an elegant little solution there....
|
|
|
|