Topics - mediaguycouk [ switch to compact view ]

Pages: prev1 2 3 [4] 5 6 7 8next
16
Found Deals and Discounts / Backup4All [December 22nd]
« on: December 17, 2008, 03:11 AM »
50% off Backup4All on Bits Du Jour

I'm personally on 3 and use it with Acronis True Image. Backup4All does my My Documents for quick backup and extraction and True Image does the whole hard drive.

http://www.bitsdujour.com/software/backupforall/

17
If I have a textbox in a form called 'textbox' and a class called 'class' is there any way of doing this?

Form1:
textbox.text = "";
Class class = new Class();
class.runfunction()

Class:
public void runfunction()
{
 form1.textbox.text = "Some text"; // This would never work, but how could it?
}

18
Developer's Corner / C# Drag and Drop fail
« on: November 11, 2008, 12:30 PM »
Hi all, I'm doing really badly on my first try at a drag and drop. I'm trying to have a listBox that can have a file dragged onto it from Windows Explorer

From the very simple example here - http://support.microsoft.com/kb/307966 I have

Set AllowDrop on the list to TRUE
Set the event DragDrop
Set the event DragEnter

I have the following code

Code: C# [Select]
  1. private void listFilesToConvert_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)
  2.         {
  3.             // DEBUG
  4.             MessageBox.Show("DragEnter");
  5.  
  6.             if (e.Data.GetDataPresent(DataFormats.FileDrop))
  7.                 e.Effect = DragDropEffects.All;
  8.             else
  9.                 e.Effect = DragDropEffects.None;
  10.         }
  11.  
  12.         private void listFilesToConvert_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
  13.         {
  14.             // DEBUG
  15.             MessageBox.Show("DragDrop");
  16.            
  17.             string[] s = (string[])e.Data.GetData(DataFormats.FileDrop);
  18.             int i;
  19.             for (i = 0; i < s.Length; i++)
  20.                 listFilesToConvert.Items.Add(s[i]);
  21.  
  22.         }

I can't say I understand it all, but it looks very similar to other code on the net. It's probably something simple but I can't work it out.

Neither debug message boxes fire.

Cheers

Graham R

19
Another question I'm stuck on.

I have two forms (for this example) called Main and Ffmpeg. Inside main there is a [Start] and a [Cancel] button. There is a Start_Clicked function and a Cancel_Clicked function.

Inside Start_Click I start ffmpeg (Ffmpeg ffmpeg = new Ffmpeg). This ffmpeg class opens up ffmpeg.exe and sends some arguments. (The code is in https://www.donationcoder.com/forum/index.php?topic=15549.0)

Now my question is, how can I send proc.Kill(); to ffmpeg? The Cancel_Clicked function doesn't know what ffmpeg is.

Advanced thanks for your help. Learning languages is damn near impossible without people like yourself that help!

Graham

20
Hi there. I'm back to C# and am getting by with web examples and a few books. However I'm stuck.

I've created a process and it happens to be FFMPEG

Code: C# [Select]
  1. System.Diagnostics.Process proc = new System.Diagnostics.Process();
  2.             //Some rubbish but long code removed
  3.             proc.EnableRaisingEvents = false;
  4.             proc.StartInfo.FileName = ffmpegLocation;
  5.             proc.StartInfo.Arguments = arguement;
  6.             proc.StartInfo.UseShellExecute = false;
  7.             if (showEncodingEngine)
  8.             {
  9.                 proc.StartInfo.CreateNoWindow = false;
  10.             }
  11.             else
  12.             {
  13.                 proc.StartInfo.CreateNoWindow = true;
  14.             }
  15.             proc.StartInfo.RedirectStandardOutput = false;
  16.             proc.StartInfo.RedirectStandardInput = false;
  17.             proc.StartInfo.RedirectStandardError = false;
  18.             proc.Start();
  19.             proc.WaitForExit();
  20.             proc.Close();

What I'd like to do is to have this process run in BelowNormal processor priority. I've found some things in the intelitext about it, but msdn isn't really helping me.

Psudo code would be

proc.Start();
proc.processorpriority = priority.BelowNormal;

But it isn't that easy...

Thanks for any help

Pages: prev1 2 3 [4] 5 6 7 8next
Go to full version