dzSpy - Spy and Task Manager App - Open Source

Discussion in 'Share Your Creations' started by dzt, Jun 25, 2007.

  1. dzt

    dzt Active Member Licensed User


    1. About Open Source
    First of all I'd like to say that as "Open Source Definition" explains in,
    dzSpy is NOT a really Open Source Project for now. It will be very soon as I'll post the source code of dzHW and NotifyIcon libraries.

    2. What is dzSpy?
    dzSpy is Spy application like Microsoft Spy++ which comes with Visual Studio, and simultaneously is a Task Manager application like the Windows one.
    Ii is made with Basic4PPC (I'll post sometime my thoughts in a kind of review, about this genius programming tool).
    It uses three external libraries, TreeView.dll by Erel and dzHW.dll, NotifyIcon.dll by me.
    I took special care about having the same exactly functionality in desktop and mobile version.

    3. Setup instructions
    For the desktop pc it must be installed .NET 1.1 and for the device .NETCF 1.0. Copy dzSpy.exe (or dzSpyDesktop.exe), Treeview.dll, dzHW.dll (or dzHWdesktop.dll) and NotifyIcon.dll (or NotifyIconDesktop.dll) to a folder and run dzSpy.exe (or dzSpyDesktop.exe)
    You can download executables, .ico file and libraries from here (just to save forum's disk space)
    B4PPC source code only is attached below

    4. Quick user instructions
    In Apps listbox shows currently active applications. Pressing the "Close" button it sends to the app a WM_CLOSE (similar to AppClose) message. The app should close or refuse to close (like CancelClose)
    Pressing the "Activate" button it tries to make the app the first in Z-order window
    Warning: I decided not to hide any apps from the listbox so be careful of what apps are you going to close. You may face bizarre behaviour.
    In Processes listbox shows running processes. You can terminate processes by pressing the "Kill Process" button. dzSpy now don't ask but demands from the process to terminate. Be very careful of what processes are you killing.
    In Windows TreeView you can see all active Windows with their children. Shows Handle, Class name, Window Text, (Left, Top, Width, Height). It is a complete view of what is going on to your PC or Mobile device.

    5. External Libraries
    dzSpy's dzHW.dll (and dzHWdesktop.dll) is an enhanced version of the library I have posted here
    It has a lot of new functions. I'll post a short description for each of them soon with the source code in "Useful Library" thread.
    NotifyIcon.dll (and NotifyIconDesktop.dll) is a new library helping to put an Icon to SystemTray (desktop version) and an Icon to Notification Area (device version). The mobile version is based on NotifyClient sample found on MSDN. For the device to work right needs a 16x16 pixels icon (not the usual 32x32). Your .ico resource file may include more icons than one.
    Feel free to use this libraries to your projects

    6. How to improve dzSpy?
    This app I hope is useful as it is, but can be very improved. The user interface is awful and can be
    better. It needs testing in several machines (I run it in few by myself), bug fixes, a better icon, a setup and a help file (.chm). And of course someone can add more functionality, like system info, storage cards info, DeviceID, remaining battery info, make it run on startup, or whatever anyone can think.
    Are there in this community any members who like to contribute to this project to make it a teamwork (of course we'll change its name to b4ppcSpy or something)?

    I hope this app should be useful to someone.

    Best regards

    Attached Files:

  2. conf

    conf Member

    It's amazing. I love NotifyIcon library so much ! Thank for your sharing ! :D :D :D
  3. Erel

    Erel Administrator Staff Member Licensed User

    dzt, thank you for sharing this great project.
    It is really inspiring to see your work here. :sign0188:
  4. dzt

    dzt Active Member Licensed User

  5. mjcoon

    mjcoon Well-Known Member Licensed User

    I'm trying to develop shared creation "Simple MP3 Player" which happens to use NotifyIcon.dll. However the version I downloaded seems to have only NotifyIconDesktop.dll so I guess it was only compiled for Windows.

    I can compile for Windows too. But when I added the device versions of the DLLs it uses and try to compile optimised for the device I get:

    "error CS1501: No overload for method 'NotifyIcon' takes '1' arguments"

    The line in question merely has:

    ni.New1("Form1") ' New Notifyicon

    Needless to say this line compiles for the desktop, and non-optimised for the device, so what is the problem?

  6. agraham

    agraham Expert Licensed User

  7. mjcoon

    mjcoon Well-Known Member Licensed User

    Thank you Andrew, I was hoping that the application can be made both Desktop (which it was as found) and also Device. It already uses ControlEx.dll, so using NotifyIcon from that would be preferable.

    But when I tried to remove NotifyIcon.dll and replace ControlEx.dll with ControlsExDevice.dll and ControlsExDesktop.dll I now get a complaint from B4PPC "An item with the same key has already been added". Do I have to perform some deeper purge to make the switch?

    Cheers, Mike.
  8. agraham

    agraham Expert Licensed User

    It sounds like you have both ControlsExDevice Dummy and ControlsExDesktop added to the desktop and I'm afraid that you can't do this. This is why I prefixed my post above "If it's a device application". You will need to remove ControlsExDesktop from your device project and you will need a separate project for the desktop version of your app.

    However I don't understand why you are removing ControlsEx as there is (deliberately) no overlap in functionality with ControlsExDevice and they will work together.
  9. mjcoon

    mjcoon Well-Known Member Licensed User

    Thank you Andrew. I hadn't appreciated that ControlsEx works together with ControlsExDe... But at least I had put the two ControlsExDe... on their corresponding sides of the Components dialogue! However I still cannot compile for the device, which is maybe what you are telling me. I had thought that the list of DLLs is separate, as implied by the Components dialogue, so I don't understand why a whole separate project is required.

    I'm not really bothered about the Notify/Suspend aspect, so I'll probably leave that alone now that it doesn't seem to be tripping the code up.

    Best regards, Mike.
  10. agraham

    agraham Expert Licensed User

    If you can't then I suspect you have removed ControlsExDeviceDummy from the desktop instead of ControlsExDesktop. The optimising compiler assumes that the structure of the desktop and device libraries are identical and uses the structure it derives from the desktop library when it compiles. This is why a "dummy" desktop library is required when functionality is required in a device library that is not present on the desktop. The dummy desktop library looks like the device library but the functionality missing on the desktop is implemented as do-nothing code.
  11. derez

    derez Expert Licensed User


    As for your original question :

    If you use version 03 of NotifyIcon then you should initialize the object without an argument:


    and make sure you have an icon attached to your program.

    Thats' all !
  12. mjcoon

    mjcoon Well-Known Member Licensed User

    Thanks for that explanation, I now understand why the same project cannot be recompiled for device as for desktop, and how to tweak it between the two.

    Off-topic, I tried to use a TrackBar (partly because the code already uses one as a volume control) to follow the playing of a music file and allow the user to move the playing point. But I find that the _ValueChanged call-back is triggered each time the program adjusts the pointer to follow progress, generating a double alteration (very audibly). If I used a scroll-bar instead, would this be avoided? (In other words, _ValueChanged reacts only to user action.)

    Cheers, Mike.
  13. agraham

    agraham Expert Licensed User

    I don't think so but you could try something like this

    ' TBchanged is a Global variable 

       TB.Value = something
       TBchanged = 

    Sub TB_ValueChanged
    If Not(TBchanged) Then
    ' do whatever
       End If
       TBchanged = 
    End Sub
  14. mjcoon

    mjcoon Well-Known Member Licensed User

    Thanks, Andrew, I have implemented exactly that solution. Rather clunky, but it works!

    Cheers, Mike.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice