|
Hi~
How to create a new instance of the process if the process is already created in pocket pc? (E.g The "test.exe" is running and i try to run "test.exe" again but no new process is created.)
Thanks
|
|
|
|
|
don't know about pocket. in .NET regular framework this will work:
System.Diagnostics.Process pr1 = new System.Diagnostics.Process();
pr1.StartInfo.FileName = "test.exe";
pr1.Start();
System.Diagnostics.Process pr2 = new System.Diagnostics.Process();
pr2.StartInfo.FileName = "test.exe";
pr2.Start();
there are no facts, only interpretations
|
|
|
|
|
Hi All,
does anyone know how to get a windows Forms application to retrieve the name of the machine it is running on?
Thanks
Mark
|
|
|
|
|
As is often the case, I found the answer myself, just after posting this!!
In case others have this same question you just retrieve System.Environment.MachineName;
M
|
|
|
|
|
hello everybody,
in first time sorry about my english.
I'm doing an application that must count the number of pages people prints in the printer installed in the server. This application will run in a windows server 2003. since now, I've been using Active Directory (IADsPrintQueueOperations, IADsPrintJob,etc) to pause, resume and cancel the document from the print queue and to read the number of pages of the document. the problem arrives when somebody print some copies of a word pad or pdf or Internet Explorer document. When this happens, the program only count the first copy, but allow to print all the copies.
I've been reading and I've found that I have to use the API "winspool.drv" with the functions EnumJobs or GetJob, to look the TotalPages or something like that, but I don't know how to use it and I've not found any example in c# (only in visual basic or c++, and i don't know).
Someone can help me?
thanks
|
|
|
|
|
Hi!John,
Thank you! I know I made a mistake.Sorry.
Good luck!
momer
|
|
|
|
|
Dear CPians,
I have written a userControl in C#.Net. I want to add XP Visual Styles to it. Any idea How to go for it?
Any article links or examples would be helpful.
Note: there are several articles both in CP as well as in msdn which deals with adding the XP Visual Style to the application whereas I need to add the XP Visual Styles to the UserControl only.
Regards,
Jay.
|
|
|
|
|
|
Hey.....Please do not try to be smart.....
Those who are posting the problem in the forum, first try to get the info using Google..
If you have some suggestion, you are welcome.
Otherwise..please do not kill the thread.
|
|
|
|
|
I posted a link containing all references to articles on codeproject that have to do with XP Visual Styles. I wasn't trying to be a smart ass; I suggest you read some.
Any remotely useful information on my blog will be removed immediately.
Judah Himango
|
|
|
|
|
hi,
i have a big problem concerning reading the Barcode , As after i design it it fails at the test as it dosn't meets the standards so if anyone has any idea about a refrence to that standards plz send it to me
thanx in advance
|
|
|
|
|
|
In my C# code:
public class Win32
{
......
[DllImport("Setupapi.lib", CharSet=CharSet.Auto)]
public static extern IntPtr SetupDiGetClassDevs(
[In]System.Guid ClassGuid,
[In]string Enumerator,
[In]IntPtr hwndParent,
[In]int Flags
);
......
}
public class usbdevice
{
......
hDevInfo = Win32.SetupDiGetClassDevs(Win32.GUID_DEVINTERFACE_USB_DEVICE, //usb class GUID
null, // Enumerator
Win32.DIGCF_PRESENT | Win32.DIGCF_DEVICEINTERFACE); //flags
......
}
when invoke the SetupDiGetClassDevs(),a error occurs,it says:
"An unhandled exception of type 'System.DllNotFoundException' occured in usbdevice.exe"
"Additionas information:Unable to loas DLL (Setupapi.lib)".
what's the problem?
Thanks!
new IntPtr(null),
|
|
|
|
|
.NET wants you to import the DLL, not the LIB:
[DllImport("Setupapi.dll", CharSet=CharSet.Auto)]
|
|
|
|
|
Good day to all!
My boss wants my windows form NOT to be shutdown by users using the End Task in the task manager. Is there a way to solve this problem? If none, is there a way that if my Windows App is terminated using task manager's End Process, Windows will automatically open again the application or worst shutdown windows perhaps. In-short, the application must always run on the users computer, after logging-in, and theres no way for the users to turn-off the application.
Thanks and sorry for my bad english.
|
|
|
|
|
There's no way that I know of to do what you want. You can write another app that checks every now and then if your app is running, and if not, it restarts it. But the user can kill that app.
I would recommend you to write a service. They run in a system account (not just for the logged user) and to manipulate them (start, stop and so on) the user requires administrative privileges.
Search CP for some examples of writing services.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
|
I'm not entirely sure, if this would help against "End Task", but try canceling the closing event:
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
e.Cancel = true;
}
www.troschuetz.de
|
|
|
|
|
I don't know if it will work or not but you can try overriding the wndProc and intercepting the shutdown message that windows sends to your app.
There is a message called WM_QUERYENDSESSION
protected override void WndProc(ref Message m)
{
if (m.Msg == 0x0011)
{
}
base.WndProc (ref m);
}
I don't know how you can stop it closing from there but you could
always re-open your app.
You will have to check that WM_QUERYENDSESION is the message that is called though. If it's not then try searching through the windows header files, one of them has a list of different messages.
Hope this helps.
Kev
|
|
|
|
|
Technically, no there is no way to that. End Task goes to great lengths to see if your app will shutdown on it's own first, and when all else fails, it will force your app closed and release your processes memory. Note, I didn't say open resources and handles!
There is an exception to this. If your app was being debugged at the time, it usually can't force your app closed.
I don't know of any examples of this technique being used, or any other to stop this from happening. It just seems like a BAD idea. Probably why you don't see the technique laying around all over the 'Net.
The workaround is a monitoring app like the others have posted. But, there is nothing stopping the user from terminating that either.
As for everything else you posted... These sound like the requirements for a Service app.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have some crystal reports that are shown in pdf format to allow for printing. My problem is that I am not sure how to change the default location that they are generated in. Eg, in WinXP the location is in the iusr temp folder, and Win 2003 its in c:\windows\temp
I want to specify a folder in which the temporary files can be created, instead of allowing it to do as it pleases. The code I am using is:
DataSet ds = rt.transListingGetByMeterNo(MeterNumber);
ReportDocument rep = new ReportDocument();
rep.Load(Server.MapPath("Crystal\\transactionListingRpt.rpt"));
rep.SetDataSource(ds.Tables[0]);
MemoryStream oStream;
oStream = (MemoryStream)rep.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
Response.Clear();
Response.Buffer= true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(oStream.ToArray());
Response.End();
|
|
|
|
|
Hi,
I have developed a chat application (Chat client and Server both) in c-sharp. I have used Sockets to communicate between client and Server.
Now I want to give functionlity in my chat client to connect via proxy server. I have to support the following proxy types i.e.
- HTTP 1.1 proxy
- Socks ver 4
- Socks ver 5
I want to get an idea that in order to support for proxy (specially for HTTP 1.1), will it affect the the way I am reading and writing to/from client-Server applications. Or I only need to write routine to connect via proxy and rest of the code will be same.
Please let me also know if anybody has any sample regarding this.
Regards,
Kamran
|
|
|
|
|
|
is there anybody out there, who knows how to use a variable in HTML which was defined in c#.
in c# i use the variable EmbedText.Text=this.openFileDialog();
i want to use that same variable in HTML e.g. <html><value=mms://StreamServer/EmbedText.Text></html>
Jug-Head
|
|
|
|
|
public virtual void Sort(
IComparer comparer
}
public virtual void Sort(
int index,
int count,
IComparer comparer
)
My arrayList contain some objects. Why the first method cannot sort the entine list but the second one can? (calling the second one by input 0, myList.Count, myComparer).
|
|
|
|