Click here to Skip to main content
15,903,012 members
Home / Discussions / C#
   

C#

 
GeneralRe: Controlling the Mouse pointer Pin
Nick Parker13-Aug-02 9:54
protectorNick Parker13-Aug-02 9:54 
GeneralRe: Controlling the Mouse pointer Pin
imran_rafique13-Aug-02 10:13
imran_rafique13-Aug-02 10:13 
GeneralRe: Controlling the Mouse pointer Pin
Nick Parker13-Aug-02 10:59
protectorNick Parker13-Aug-02 10:59 
QuestionTransparent color? Pin
Rickard Andersson209-Aug-02 6:12
Rickard Andersson209-Aug-02 6:12 
AnswerRe: Transparent color? Pin
Anonymous9-Aug-02 7:06
Anonymous9-Aug-02 7:06 
AnswerRe: Transparent color? Pin
Nick Parker9-Aug-02 11:00
protectorNick Parker9-Aug-02 11:00 
AnswerRe: Transparent color? Pin
James T. Johnson9-Aug-02 15:21
James T. Johnson9-Aug-02 15:21 
GeneralThe Wierdest Think Ever! Pin
Joel Matthias9-Aug-02 5:28
Joel Matthias9-Aug-02 5:28 
public class Shell
{
	[StructLayout(LayoutKind.Sequential)]
	private struct SHFILEOPSTRUCT
	{
		public System.IntPtr hWnd;
		public System.Int32 wFunc;
		[MarshalAs(UnmanagedType.LPStr)]
		public System.String pFrom;
		[MarshalAs(UnmanagedType.LPStr)]
		public System.String pTo;
		public System.Int32 fFlags;
		public System.Int32 fAnyOperationsAborted;
		public System.IntPtr hNameMappings;
		[MarshalAs(UnmanagedType.LPStr)]
		public System.String lpszProgressTitle;
	}

	[DllImport("shell32.Dll")]
	private static extern System.Int32 SHFileOperation(ref SHFILEOPSTRUCT lpFileOp);

	private enum FileOpFunc {Delete = 3}
	private enum FileOpFlags {Silent=0x04, AllowUndo=0x40, NoConfirmation=0x10}

	static public void MoveFileToRecycleBin(string filePath)
	{
		SHFILEOPSTRUCT fileop = new SHFILEOPSTRUCT();
		fileop.wFunc = (int)FileOpFunc.Delete;
		fileop.pFrom = filePath;
		fileop.fFlags = (int)(FileOpFlags.Silent|FileOpFlags.AllowUndo|FileOpFlags.NoConfirmation);
			
		SHFileOperation(ref fileop);
			
		//System.Windows.Forms.MessageBox.Show("Hello");

		//if(SHFileOperation(ref fileop) != 0)
		if(System.IO.File.Exists(filePath))
			throw new System.IO.IOException("Could not move " + filePath + " to the recycle bin.");
	}
}

GeneralRe: The Wierdest Think Ever! Pin
Joel Matthias9-Aug-02 5:31
Joel Matthias9-Aug-02 5:31 
GeneralRe: The Wierdest Think Ever! Pin
Joel Matthias9-Aug-02 8:50
Joel Matthias9-Aug-02 8:50 
Generalgetting the size of the working area Pin
Nnamdi Onyeyiri9-Aug-02 1:13
Nnamdi Onyeyiri9-Aug-02 1:13 
GeneralRe: getting the size of the working area Pin
Andreas Philipson9-Aug-02 1:52
Andreas Philipson9-Aug-02 1:52 
GeneralList of files Pin
Nnamdi Onyeyiri8-Aug-02 23:46
Nnamdi Onyeyiri8-Aug-02 23:46 
GeneralRe: List of files Pin
James T. Johnson9-Aug-02 0:25
James T. Johnson9-Aug-02 0:25 
GeneralRe: List of files Pin
Nnamdi Onyeyiri9-Aug-02 0:28
Nnamdi Onyeyiri9-Aug-02 0:28 
GeneralRe: List of files Pin
Paul Watson9-Aug-02 0:51
sitebuilderPaul Watson9-Aug-02 0:51 
GeneralRe: List of files Pin
Nnamdi Onyeyiri9-Aug-02 0:53
Nnamdi Onyeyiri9-Aug-02 0:53 
GeneralRe: List of files Pin
Paul Watson9-Aug-02 0:58
sitebuilderPaul Watson9-Aug-02 0:58 
GeneralRe: List of files Pin
Nnamdi Onyeyiri9-Aug-02 0:59
Nnamdi Onyeyiri9-Aug-02 0:59 
GeneralRe: List of files Pin
leppie9-Aug-02 21:56
leppie9-Aug-02 21:56 
QuestionNetwork Protocol Design? Pin
Steven Behnke8-Aug-02 21:26
Steven Behnke8-Aug-02 21:26 
GeneralRunning C# Appz Pin
Trevor Vuong8-Aug-02 21:10
sussTrevor Vuong8-Aug-02 21:10 
GeneralRe: Running C# Appz Pin
James T. Johnson8-Aug-02 21:44
James T. Johnson8-Aug-02 21:44 
GeneralRe: Running C# Appz Pin
leppie8-Aug-02 22:47
leppie8-Aug-02 22:47 
GeneralRe: Running C# Appz Pin
Anonymous9-Aug-02 4:15
Anonymous9-Aug-02 4:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.