this.verticalProgressBar1.Location = new System.Drawing.Point(18, 19);\r
this.verticalProgressBar1.Name = "verticalProgressBar1";\r
this.verticalProgressBar1.Size = new System.Drawing.Size(15, 203);\r
+ this.verticalProgressBar1.Step = 1;\r
this.verticalProgressBar1.TabIndex = 12;\r
// \r
// customTrackBar1\r
using NAudio.CoreAudioApi;\r
using System.Windows.Forms;\r
using System.IO;\r
-using System.Runtime.InteropServices;\r
using System.Threading;\r
\r
namespace AudioRecorder {\r
\r
public partial class MainForm : Form, IMainForm {\r
\r
- [DllImport("user32.dll")]\r
- public static extern int SendMessage(IntPtr hWnd, int wMsg, int wParam, int lParam);\r
-\r
//private const String CONFIG_FILE = "Resources/configuration.json";\r
private const String CONFIG_FILE = "Configuration/audiorecorder.json";\r
\r
saveAudioDeviceToConfig();\r
timeCodeWorker = new TimeCodeWorker(timecodeLabel);\r
//CreatenewThreadToListenMasterPeekVolume();\r
+ \r
}\r
catch (Exception e) {\r
MessageBox.Show(e.Message, StringResources.ERROR_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Error);\r
try {\r
if (recording) {\r
if (volumeHeight >= settings.getLoudValue())\r
- SendMessage(verticalProgressBar1.Handle, 1040, 2, 0);\r
+ //SendMessage(verticalProgressBar1.Handle, 1040, 2, 0);\r
+ verticalProgressBar1.ForeColor = Color.Red;\r
else\r
- SendMessage(verticalProgressBar1.Handle, 1040, 1, 0);\r
+ // SendMessage(verticalProgressBar1.Handle, 1040, 1, 0);\r
+ verticalProgressBar1.ForeColor = Color.Green;\r
verticalProgressBar1.Value = (int)volumeHeight;\r
}\r
} catch (Exception e) {\r
using System.Text;\r
using System.Threading.Tasks;\r
using System.Windows.Forms;\r
+using System.Runtime.InteropServices;\r
\r
namespace AudioRecorder {\r
class VerticalProgressBar : ProgressBar {\r
\r
+ [DllImport("uxtheme.dll", CharSet = CharSet.Unicode)]\r
+ public extern static int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string pszSubIdList);\r
+\r
+ public VerticalProgressBar() {\r
+ Style = ProgressBarStyle.Blocks;\r
+ \r
+ }\r
+\r
+ protected override void CreateHandle() {\r
+ base.CreateHandle();\r
+ try {\r
+ SetWindowTheme(this.Handle, "", "");\r
+ }\r
+ catch { }\r
+ }\r
+\r
protected override CreateParams CreateParams {\r
get {\r
CreateParams cp = base.CreateParams;\r