The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Phoenix on April 25, 2006, 09:58:28 PM

Title: HddMon - The Next Generation
Post by: Phoenix on April 25, 2006, 09:58:28 PM
In attached file you will find a new version of HddMon. There are a lot of changes, so i have started a new topic.

In this version, the disks are monitored by volume instead of device, so it is possible to show more detailed information by drive letters. You also can see, which volume(s) support performance requests.

The read/write activity is shown by two icons in the system notification area. If you want to, choose "details" from popup menu to see activity by volume, supported or all detected volumes. You can set the alpha value of the details window as well.

This one was tested on WindowsXP Pro SP2 (32bit) and W2K SP4.

Two problems remain: the icons in SNA look ugly with W2K although there are different iconsets selected for XP and W2K. I need serious help with this because i cant figure out what happens. The W2K-icons are 16 by 16, 256 colours. Maybe W2K only displays 16-colour-icons in SNA?

The other problem is - W2K again - when you do a selection from the details window menu, the tooltip of the SNA-icons is covered by the details window. This problem was not seen on my XP-box until now.

An other interesting behaviour is, that the kind of suppurted drives is different depending on OS - i have an old 64k USB Flash Drive where performance requests are supported by W2K-drivers but not by XP-drivers(!?)

Regards, Phoenix

EDIT: New Version uploaded
- drag of details window enabled
- snap details window to the screen edge(s)
- restores position of details window
- you should delete "HKEY_CURRENT_USER\Software\HddMon -> Init" before running if you have the previous version
- Win98 bug solved
EDIT: New Version uploaded (with source)

[attachment deleted by admin]
Title: Re: HddMon - The Next Generation
Post by: Mark Jones on April 25, 2006, 10:19:28 PM
Very nice! :toothy

The "details" and "...reported drives" are very nice features indeed. :U

Curious though, is it supposed to make two circular icons in the taskbar?
Title: Re: HddMon - The Next Generation
Post by: PBrennick on April 25, 2006, 10:32:20 PM
I have five drives, 2 reporting.  IMO, it should be 5 drives, 3 reporting.  Evidently, the USB drive is not handled?  I think if details is showing, lose the balls. Also, would be nice to dock the details wherever a person wants to though you may already have the best place.  I will probably change the color of the detail window.  It is hard for me to see (personal problem).

All in all, pretty cool, though.  XPHESP2

Paul
Title: Re: HddMon - The Next Generation
Post by: MichaelW on April 26, 2006, 12:44:45 AM
My system, running Windows 2000 SP4, has two partitions on the ATA HDD, an ATAPI CD-RW, an ATAPI Zip drive, and a 3.5-inch diskette drive. HDDMon detects 5 drives, and it shows the C and D partitions on the HDD and the Zip drive as reporting, even when the Zip drive has no disk inserted. It does not show the CD-RW drive as reporting when it has a CD inserted, or when I read from the CD. In the details the indicators for the CD-RW and diskette drive are yellow, and never show any activity even when I am accessing the drives. The Zip drive shows read activity when I read from it and write activity when I write to it. When I access the Zip drive drives C and D show write activity, but I think this may have something to do with caching.

Under Windows 2000, after spending hours trying, I could not produce any non-rectangular icon that had a reasonable appearance in the notification area, even when the icon looked good elsewhere.
Title: Re: HddMon - The Next Generation
Post by: hutch-- on April 26, 2006, 01:03:18 AM
Seems to work fine here. A win2000 box with 4 x 120 gig HDDs, each partitioned to 4 partitions, it detects 19 drives and reports 16 which is correct, a floppy and 2 x DVD drives make the other 3.

The "Details" option looks grayed out and is a bit hard to read, perhaps a popup window would be easier to read.
Title: Re: HddMon - The Next Generation
Post by: Phoenix on April 26, 2006, 07:34:52 PM
Thanks to all for testing and feedback!

After all it seems to work without problems...

Mark: yes, it was my intention to have two icons in the taskbar (i didn't know that this is possible before)

PBrennick: it is a secret to me if USB drives support performance requests or not... my 80gig USB harddisk is supported, but no flash drives here on my XP box. Docking the details window on custom places on the screen is the next thing to work on for me..

MichaelW: CD or DVD drives are not supported by performance requests in this way, i have to look up the way to do it. If you select "show --> detected" not suported volumes are shown with yellow color. Nice to know, ZIP works!

hutch-- : 19 drives, thats a lot! Perhaps you could add a multicard reader to see if all 26 possible work?  :lol  The details option becomes grayed out if details window is active, or does it look grayed out anyway?

Does anybody have some time to review the code? Its the first time that i work with gdi and backbuffer, so any advice would be appreciated... i usually prefer gdi+.

Regards, Phoenix
Title: Re: HddMon - The Next Generation
Post by: PBrennick on April 26, 2006, 08:02:50 PM
Phoenix,
I am sure that a lot of people wouldn't mind reviewing your code.  You certainly have done a great job for a first try with gdi and backbuffer.  I use Ewayne's apploader and it is docked top right and I would like to put yours right next to it.  I also think us old guys will see it better up there.  I will certainly take a look at what you gave us.

Paul
Title: Re: HddMon - The Next Generation
Post by: Phoenix on April 26, 2006, 09:22:55 PM
PBrennick,

thanks a lot  :U
Quoteus old guys will see it better up there
Thats me, too... (YOB 1961) :lol
Title: Re: HddMon - The Next Generation
Post by: MichaelW on April 26, 2006, 10:14:44 PM
When I do a search of a directory on C or D, in the details both drives show the same activity.

[EDIT]

Ignore this part, I just remembered that I was experimenting with the system DLL's the last time I used the system, and I don't even remember what I learned from the experiments :(

When I tried to run HDDMon under Windows 98 SE instead of a message box with szOsInfoT and szOsInfo, I got:

A message box with:

Error Starting Program

The HDDMON.EXE file is linked to missing export USER32.DLL:SetLayeredWindowAttributes.

And another with:

C:\WINDOWS\Desktop\HDDMon.exe

A device attached to the system is not functioning.

[/EDIT]

I have had it running for 22 hours now, and the accumulated CPU time is 51 seconds. An average utilization of .06% is probably low enough :U

Title: Re: HddMon - The Next Generation
Post by: John on April 27, 2006, 12:14:48 AM
Phoenix,
I like most of the new stuff, especially doing it by supported volumes. I have to say that I much prefer the one icon from the previous version though to the two used here. Just my opinion though. Functionally it is fantastic on my computer. Nice work!
Title: Re: HddMon - The Next Generation
Post by: six_L on April 27, 2006, 12:57:17 PM
Hello,Phoenix
The attached file HddMon.zip can't be unziped.
Title: Re: HddMon - The Next Generation
Post by: Phoenix on April 27, 2006, 05:13:50 PM
Thanks John  :U Anybody else thinking that one icon in the system notification area is better?

Hello six_L, try this: http://www.7-zip.org/ if you like or try downloading it again.. the archive seems to work ok for me.
Title: Re: HddMon - The Next Generation
Post by: six_L on April 28, 2006, 08:56:53 AM
Thanks you,Phoenix
it works ok.
Title: Re: HddMon - The Next Generation
Post by: Phoenix on April 30, 2006, 01:01:04 AM
Updated Version uploaded with first post:

- drag the details window to your favourite position - as requested by PBrennick  :lol
- details window snaps (only) to screen edges
- placement on the screen is restored

Before running this version, you should delete "HKEY_CURRENT_USER\Software\HddMon -> Init" in registry if you tried the last one.

Still need to solve the Win 98 errors (Thanks MichaelW).

Have fun!
Phoenix
Title: Re: HddMon - The Next Generation
Post by: Phoenix on April 30, 2006, 03:12:09 PM
QuoteWhen I tried to run HDDMon under Windows 98 SE instead of a message box with szOsInfoT and szOsInfo, I got:
New Upload: Solved by using run-time dynamic linking for SetLayeredWindowAttributes function.

QuoteI have had it running for 22 hours now, and the accumulated CPU time is 51 seconds. An average utilization of .06% is probably low enough
MichaelW, how did you measure this?!
Title: Re: HddMon - The Next Generation
Post by: asmrixstar on April 30, 2006, 07:30:56 PM
I had the same problem with the system icons the trick is :
Use Loadimage api instead of Loadicon which seems to screw up colors!

I learned this from CPUIdle ! thx
Title: Re: HddMon - The Next Generation
Post by: Phoenix on April 30, 2006, 09:46:58 PM
Thanks a lot asmrixstar!

I have changed ExtractIcon to LoadImage. If anyone has the time, and a W2K box, could you give it a try and tell me how the icons look like? Thanks!

[attachment deleted by admin]
Title: Re: HddMon - The Next Generation
Post by: hutch-- on April 30, 2006, 10:24:33 PM
It looks fine on my win2k sp4. I found the Alpha setting, set it to zero and the greyed look went away. I started a few large programs and the light indicators appear to work by disk drive rather than partition. It correctly lists all of the fixed drived and when I select the option Detected Drives, it should the other three, 2 CDs and a floppy.
Title: Re: HddMon - The Next Generation
Post by: MichaelW on April 30, 2006, 11:46:59 PM
Quote from: Phoenix on April 30, 2006, 03:12:09 PM
QuoteI have had it running for 22 hours now, and the accumulated CPU time is 51 seconds. An average utilization of .06% is probably low enough
MichaelW, how did you measure this?!

I just opened up Task Manager and on the Processes tab read the CPU Time for the HddMon process. I had recorded the time when I started it so I knew how long it had been running.

Title: Re: HddMon - The Next Generation
Post by: PBrennick on May 01, 2006, 03:54:16 AM
Phoenix,
I have a sense of humor so I did not mind that I was driven crazy for a bit after setting Alpha to 90% and the details disappeared and would not come back.  Once it occurred to me, I had to guess, as you say nothing, that it might just be invisible and then had to guess where to right click to get the Alpha setting submenu so I could make it visible again.  Don't you think you should make a provision for idiots such as myself who just like to play to see if I can cause an app to groan?  Especially if you start allowing docking in various places?

Paul
Title: Re: HddMon - The Next Generation
Post by: Phoenix on May 01, 2006, 07:44:29 AM
MichaelW, i did not know about that feature  :red

PBrennick: I'm sorry for driving you crazy  :(, but on my monitor i can see the details window even with an Alpha of 90%. So you think the maximum selectable Alpha percentage should be, lets say 50 or 60%?
Title: Re: HddMon - The Next Generation
Post by: PBrennick on May 01, 2006, 07:58:00 AM
Phoenix,
My goodness, don't do that!!  Just give us a way to alter the Alpha settings from the two icons (right click) in the notification area.

I do not think this problem is unique to my machine but maybe to laptops?  I do not know but all I know is that I don't think you should cripple your efforts!  I love your program and even though it is not dockable yet, I already have it in my startup.

Paul
Title: Re: HddMon - The Next Generation
Post by: Phoenix on May 01, 2006, 08:18:09 AM
OK, alter the Alpha settings from notification area icons is on the "to do" list...
Quoteand even though it is not dockable yet
Dockable to what? It should - hopefully - dock to screen edges. Do you think of (permanent) docking to other windows? Well, that seems to be a more complex and difficult task for me... Enumerate all windows, ok; check if we are close to their borders, ok; but what is to to if these windows are about being moved, minimized or whatever?
Title: Re: HddMon - The Next Generation
Post by: PBrennick on May 01, 2006, 08:29:51 AM
Phoenix,
I just want to be able to move it and dock it top right of the desktop where I am docking the AppLoader utility.  We already discussed this once before.

BTW:  If I am currently showing Details, should it not keep that setting even when the machine is rebooted (by utilizing HKEY_CURRENT_USER\SOFTWARE\HddMon).

Paul
Title: Re: HddMon - The Next Generation
Post by: PBrennick on May 01, 2006, 08:45:43 AM
Phoenix, sorry to be a pain but there is one more problem.  Even though I right click the invisible area and change the alpha to zero percent and get a visible detail window when I reboot and click show details, I am back to an invisible details window and when I right click it it is back to 90%.  I think you should update the registry whenever the Alpha setting is modified.

Paul
Title: Re: HddMon - The Next Generation
Post by: Phoenix on May 01, 2006, 01:40:03 PM
PBrennick,

in attached file is HddMon with a couple of changes:


However, i'm sorry, but i cannot understand (perhaps because of my bad english) whats going wrong with docking on screen edges? It should work....

[attachment deleted by admin]
Title: Re: HddMon - The Next Generation
Post by: PBrennick on May 02, 2006, 01:44:26 AM
Phoenix,
I like the program as it is and it is too difficult to address the language barrier, so I think I will be thankful for all your efforts and run it the way you designed it.

One thing, though, for example; if the details window is dockable tell me how to dock it in the top, right hand corner of the desktop?

EDIT: I forgot to say thanks for addressing all my concernes in this last update!

Paul
Title: Re: HddMon - The Next Generation
Post by: PBrennick on May 02, 2006, 01:59:06 AM
Phoenix,
I have tested the changes and everthing works.  I feel confident when I play with the program, now, and no longer worry that things will become a problem.

Paul
Title: Re: HddMon - The Next Generation
Post by: Phoenix on May 02, 2006, 09:01:43 PM
Paul,

thank you very much for your support and patience!

Please let me ask one more question: is a "docking" window a window that has a small bar (lets say ~6 pix wide) visible on screen and shows its contents when you move the mouse over it? Something like biteriders startbar posted on this forum?

In last posted version is a bug: it does not update the drives in details window if "reported" mode is selected and an additional supported drive is added/removed. Fixed in attached file.

Phoenix

[attachment deleted by admin]
Title: Re: HddMon - The Next Generation
Post by: Mark Jones on May 02, 2006, 09:33:47 PM
Hi Phoenix, would it be possible to add a toggle to hide the two tray icons? The new icons and docking bar look great by the way. :bg

p.s. I've always thought that a "docking" window meant it was "self-aligning" to another window or edge of the screen (so it is working correctly.)
Title: Re: HddMon - The Next Generation
Post by: Phoenix on May 02, 2006, 09:55:27 PM
Hi Mark,

Quote from: Mark Jones on May 02, 2006, 09:33:47 PM
would it be possible to add a toggle to hide the two tray icons?
Should be simple, i'll have a look at it. Thanks for your suggestion!

Quote from: Mark Jones on May 02, 2006, 09:33:47 PM
p.s. I've always thought that a "docking" window meant it was "self-aligning" to another window or edge of the screen (so it is working correctly.)
Thats what i think, too. But there are a lot of different terms floating around: magnetic, docked, floating etc. so i have problems to understand what PBrennick actually means. I googled a lot about "docked windows" but this did not help...

EDIT: I even tried to get a copy of "Ewayne's apploader" but this was not successfull. Does anybody know where to get it? (It's Freeware, I suppose)
Title: Re: HddMon - The Next Generation
Post by: Ghirai on May 02, 2006, 11:01:54 PM
I get 2 drives detected, 0 reported :'(

I'm running XP SP2 Pro, and have 2 logical part. on a 300 GB Maxtor, primary IDE master.
Title: Re: HddMon - The Next Generation
Post by: PBrennick on May 03, 2006, 06:45:54 AM
Mark,
I am attaching Ewayne's AppLoader project, it is really a great program.  Now, abut this docking thing, you guys are ganging up on me!  :bg :boohoo:  Anyway, I may be causing a confusing here and making things mre difficult t understand than they need t be.

From this point on, let's leave the word docking out of this discussion.  Phoenix,of course, I d not have a recent copy of the project but I can work around  that.  You have created a dialog box without a title bar, etc., that has a cool method to control its transparency and is used to display the activity of reporting HDDs.  I have alterred the code to change the location of the this 'details' window.

done:   
    pop    ecx                  ; ecx = 2*borderwidth of dialog window
    mov    edx,eax
    shl    eax,4                ; eax*16
    shl    edx,3                ; edx*8
    add    eax,edx              ; dwDetectedDrives*24= ClientWidth in eax
    add    eax,ecx              ; total width of dialog
    push   ecx
    add    ecx, 730
    sub    rct.right,eax        ; left position of dialog
    sub    rct.bottom,ecx       ; top position of dialog
    pop    ecx
    add    ecx, 16


This works for me and positions the dialog box right where I want it but the code is not written currectly as it is referencing the location as an offset from the bottom of the desktop so if you are using any other resolution other than 1024x768 there will be a problem.  I am just too tired and will look at it again after I get some sleep or maybe, by then you will have fixed it.  I just want you to understand what I would like to see as an option.

Paul


[attachment deleted by admin]
Title: Re: HddMon - The Next Generation
Post by: PBrennick on May 03, 2006, 12:41:06 PM
Phoenix,
Okay, this is the second set of changes, they work correctly and are not video mode dependent as my first set of changes were.  I do not have a good copy of your sources that includes all your recent changes.  Will you please consider reposting the sources?  Thank you, in advance.

done:   
    pop    ecx                  ; ecx = 2*borderwidth of dialog window
    mov    edx,eax
    shl    eax,4                ; eax*16
    shl    edx,3                ; edx*8
    add    eax,edx              ; dwDetectedDrives*24= ClientWidth in eax
    add    eax,ecx              ; total width of dialog
    add    ecx, 16
    sub    rct.right,eax        ; left position of dialog
    mov    rct.bottom, 1        ; top position of dialog


Okay, so, if you want, you could take your original routine and give it an option name referring to bottom-right and take my routine and give it an option name referring to top-right.  In your menu system the user can select either preference.  If you get AppLoader you can see how eWayne utilizes offsets to nudge his stuff left and right, up and down.  Lotsa stuff to have fun with.

Paul
Title: Re: HddMon - The Next Generation
Post by: Phoenix on May 03, 2006, 05:43:57 PM
Quote from: Ghirai on May 02, 2006, 11:01:54 PM
I get 2 drives detected, 0 reported

That are bad news. Do you use XP drivers or other (3rd party)  drivers?
Title: Re: HddMon - The Next Generation
Post by: Phoenix on May 03, 2006, 06:00:47 PM
Quote from: PBrennick on May 03, 2006, 12:41:06 PM
Will you please consider reposting the sources?
Updated with first post!

Thank you for posting eWayne's AppLoader, very nice and interesting tool!

So, i see want you want to do. In addition to the capability to drag the details window on the screen whereever you want by moving the mouse with left mouse button down, your intention is to add some predefined positions to the popup menu like "left-top" or "bottom-right"? That should be an easy task. Additional, i think an option "fix actual position" to disable accitental move could be a good idea?

Please let me know what you think. Thanks in advance.
Title: Re: HddMon - The Next Generation
Post by: PBrennick on May 03, 2006, 06:35:41 PM
Phoenix,
Yes and yes.  We think alike.  I will do some modes on the predetermined positions and then we can compare notes.  If I get pushy, just say so, I can handle it.
Paul
Title: Re: HddMon - The Next Generation
Post by: Phoenix on May 03, 2006, 08:07:13 PM
Paul,

i did a quick implementation of the four positions selectable by details menu. You might have a look at attached file (with source) if you like. The "Fix Position" option is not implemented, but i am now too tired to continue.

[attachment deleted by admin]
Title: Re: HddMon - The Next Generation
Post by: PBrennick on May 03, 2006, 08:39:21 PM
Phoenix,
It sure does not take you long to get these ideas implimented.  Well, that is all 'I' can think of.  It has been fun and I really like this application!  If there are any further tests you need to have done ...

Paul
Title: Re: HddMon - The Next Generation
Post by: Phoenix on May 04, 2006, 06:09:47 PM
Quote from: PBrennick on May 03, 2006, 08:39:21 PM
Well, that is all 'I' can think of.  It has been fun and I really like this application!  If there are any further tests you need to have done ...

Paul, thank you very much for your help an suggestions, this little project is a lot of fun for me with your support! There are some more ideas that i want to get working, for example to show the details window in vertical order too as an option. However, i think some kind of "reorganization" (?) should be done, as only one window is needed to do the job... aso. This will take some time.

Again, thanks a lot!

Phoenix
Title: Re: HddMon - The Next Generation
Post by: John on May 05, 2006, 01:11:47 AM
Hi Phoenix,
Since it seems like you are indeed enjoying this I wonder if you'd be interested in making an option to hide the tray icons when the details window is showing? It would also be nice to be able to use one icon but I think I already mentioned that ;). I was going to modify the code myself, since you were nice enough to provide the code, and make it so that it flips between red, green, and off with red being the higher priority to display. Another idea for a predetermined position would be center top so it shows in the middle of the screen while "docked" to the top.

It still looks great and I really like the idea of showing the drives vertically in the details pane!

Keep up the good work!
Title: Test results
Post by: gabor on May 05, 2006, 06:26:29 AM
Hello!

Nice work! I have WinXP SP1, 1 HD with 3 partitions, a 3,5 floppy, a DVD-ROM/CDRW combo drive, 2 virtual CD/DVD ROMs (Daemon Tools) and an USB pen drive.
All these drives are detected, only the real HDD drives are reporting. When I access the emulated CD drives, I get HDD activity on the partision that contains the mounted image file. (This could be considered as correct behavior, since your app is a HDD monitor.)
Was your intension to monitor HDD activity or you want to report every drive's activity?

Greet job, I especially like the icons in the notification area. (Good to have a working code about this topic for later... :bg )

Greets, Gábor
Title: Re: HddMon - The Next Generation
Post by: Phoenix on May 05, 2006, 06:56:01 PM
Quote from: gabor on May 05, 2006, 06:26:29 AM
When I access the emulated CD drives, I get HDD activity on the partision that contains the mounted image file. (This could be considered as correct behavior, since your app is a HDD monitor.)
This should be correct, since the hard disk is affected (the image file is just a file located on a specific volume, i think)

Quote from: gabor on May 05, 2006, 06:26:29 AM
Was your intension to monitor HDD activity or you want to report every drive's activity?
Well, this one started as a disk monitor (MichaelW's idea initially) but i started to look how other types of volumes as cd roms can be monitored (any suggestion?). I am also trying to understand the different behavior on XP systems (PartMngr) and W2K systems, which at least differs in performance request support for USB-drives (monitoring works on W2K, not with XP) - short answer: yes and yes  :lol

Quote from: John on May 05, 2006, 01:11:47 AM
I wonder if you'd be interested in making an option to hide the tray icons when the details window is showing? It would also be nice to be able to use one icon but I think I already mentioned that ;)
On the "to do" list  :lol but may take a while as i am very busy now with other projects (not coding)

Quote from: John on May 05, 2006, 01:11:47 AM
It still looks great and I really like the idea of showing the drives vertically in the details pane!
Same as above, on list...

As i said before, i think its about time to make up a new project as there are now more things i want to get working and they should be in design from beginning and not added by tinkering. It should also be possible to see more information on all detected volumes like size, type etc.

So any suggestion is greatly appreciated, thank you all for your support!

Regards, Phoenix
Title: Re: HddMon - The Next Generation
Post by: Cobra on December 17, 2006, 05:18:18 PM
Thank you for this great little app. It's a keeper for me.  :U