Beispiel #1
0
        public Form1(int iTimeout)
        {
            InitializeComponent();
            mainPanel            = new Panel();
            mainPanel.Dock       = DockStyle.Fill;
            mainPanel.AutoScroll = true;

            this.tabControl1.TabPages[0].Controls.Add(mainPanel);
            panels = new memorybar2[33];    //we have slots 1 to 32 plus one total bar

            //VMhelper vmh = new VMhelper();
            //vmh.test();
            //vmh.ShowMemory();
            VMusage.CeGetProcVMusage vmInfo = new CeGetProcVMusage();
            vmInfos = vmInfo._procVMinfo;

            createPanels();

            foreach (VMusage.procVMinfo vm in vmInfos)
            {
                textBox1.Text += vm.ToString() + "\r\n";
                updateBar((int)vm.slot, vm.name, (int)vm.memusage);
            }

            //memorystatus.MemoryInfo.GlobalMemoryStatus(ref memInfoStatus);
            //updateBar(0, "total " + memInfoStatus.dwAvailVirtual / 1000000, (int)(memInfoStatus.dwTotalVirtual));
            updateTotalMemBar();

            //start the background tasks
            vmiThread              = new vmInfoThread();
            vmiThread._iTimeOut    = iTimeout * 1000;
            vmiThread.updateEvent += new vmInfoThread.updateEventHandler(vmiThread_updateEvent);
        }
Beispiel #2
0
        public Form1(int iTimeout)
        {
            InitializeComponent();
            mainPanel = new Panel();
            mainPanel.Dock = DockStyle.Fill;
            mainPanel.AutoScroll = true;

            this.tabControl1.TabPages[0].Controls.Add(mainPanel);
            panels = new memorybar2[33];    //we have slots 1 to 32 plus one total bar

            //VMhelper vmh = new VMhelper();
            //vmh.test();
            //vmh.ShowMemory();
            VMusage.CeGetProcVMusage vmInfo = new CeGetProcVMusage();
            vmInfos = vmInfo._procVMinfo;

            createPanels();

            foreach (VMusage.procVMinfo vm in vmInfos)
            {
                textBox1.Text += vm.ToString()+"\r\n";
                updateBar((int)vm.slot, vm.name, (int)vm.memusage);
            }

            //memorystatus.MemoryInfo.GlobalMemoryStatus(ref memInfoStatus);
            //updateBar(0, "total " + memInfoStatus.dwAvailVirtual / 1000000, (int)(memInfoStatus.dwTotalVirtual));
            updateTotalMemBar();

            //start the background tasks
            vmiThread = new vmInfoThread();
            vmiThread._iTimeOut = iTimeout*1000;
            vmiThread.updateEvent += new vmInfoThread.updateEventHandler(vmiThread_updateEvent);
        }