Page 2 of 2 FirstFirst 12
Results 41 to 61 of 61

Thread: My Windows API Library - New version available for download

  1. #41

    Thread Starter
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: My Windows API Pack - Now available for download :)

    The first release of this library is now available for download See the first post in this thread or my signature for a link and anyone that uses it please let me know if you have any feedback (good or bad!)

    Thanks
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  2. #42

    Re: My Windows API Pack - Now available for download :)

    Downloaded, will take a look at.

  3. #43

    Thread Starter
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: My Windows API Pack - Now available for download :)

    cheers let me know if you find any problems
    Last edited by chris128; Jul 4th, 2010 at 05:50 PM.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  4. #44
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: My Windows API Pack - Now available for download :)

    Hey.Done a little reverse engineering on the dll (hope you forgive me that ) and i can say it's very well structured.Although i don't have vs so i can't use it or any need at the moment for the specific API's but your "networking" i think will help a lot of people.
    I have an out of topic question though.Did you use the xml file to store the comments?Can this be done?I was only away of using the 3 " ' " or system.componentmodel .
    Errr so any links on that...err of topic?
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  5. #45

    Re: My Windows API Pack - Now available for download :)

    That is what that is sapator. The XML file is generated by VS.

  6. #46
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: My Windows API Pack - Now available for download :)

    Manually or automatic?
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  7. #47

    Re: My Windows API Pack - Now available for download :)

    Unless you mess with settings, typically automatic.

  8. #48
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: My Windows API Pack - Now available for download :)

    Hm.
    Funny i've never gave notice....
    Anyway don't wanna spam with irrelevant things.Thanks.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  9. #49

    Thread Starter
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: My Windows API Pack - Now available for download :)

    Quote Originally Posted by sapator View Post
    Hey.Done a little reverse engineering on the dll (hope you forgive me that ) and i can say it's very well structured.
    Thanks and no worries, anyone who wants the source code just send me a PM/email.

    I have an out of topic question though.Did you use the xml file to store the comments?Can this be done?I was only away of using the 3 " ' " or system.componentmodel .
    Errr so any links on that...err of topic?
    All I did was the 3 " ' " like you mentioned above each method and it creates the comment fields like "<summary>" etc and it stores them in the XML file automatically. The XML file is in your Bin\Release folder when you build the solution and as long as that file is in the same folder as the DLL then you will see the comments in intellisense when you use methods from that DLL.
    Oh but any normal comments (ie not ones in a <summary> or <param> tag etc) will not be included in the XML file.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  10. #50
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: My Windows API Pack - Now available for download :)

    Thanks.As i said i never did notice that.Probably cuz i usually pack everything.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  11. #51

    Thread Starter
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: My Windows API Pack - Now available for download :)

    Added some new stuff to this today so will be releasing a new version soon I plan on releasing updated versions quite often rather than waiting until I've got loads of new stuff.

    The main addition in this version will be some power management methods, which will be in a new class named NativePowerScheme. There will be plenty of other new stuff as well though - I've listed all of the items I'm planning to add to it below (some of which I've already got finished and others are still a work in progress). Oh and the first 2 methods in this list are ones that were intended to go into the last version but I had some issues that meant that didn't happen... got them working properly now though.

    NativeNetwork.ReleaseIPAddresses
    Releases all v4 IP addresses that were acquired via DHCP

    NativeNetwork.RenewIPAddresses
    Renews all v4 IP addresses that were acquired via DHCP

    NativePowerScheme.GetAvailablePowerSchemes
    Gets a list of all power schemes, with basic information such as the name, description and index

    NativePowerScheme.GetActivePowerScheme
    Gets the currently active power scheme

    NativePowerScheme.SetActivePowerScheme
    Sets which power scheme is active

    NativeOperatingSystem.RenameComputer
    Renames the local computer to the specified new name. If the computer is part of a domain then the domain account for the computer is renamed as well

    NativeOperatingSystem.DeleteUserProfile
    Deletes a user's profile and all user related settings

    NativeOperatingSystem.UserProfilesDirectory (property)
    Returns the root directory path where all user profiles are stored (I dont think there is an environmental variable for this but if anyone knows of one then let me know and I wont bother including this)

    NativeFileSystem.EmptyRecycleBin
    Empties the recycle bin

    NativeFileSystem.GetRecycleBinItemCount
    Returns the number of deleted items in the recycle bin and the total size of the recycle bin

    NativeWindow.GetWindowFromTitle
    Finds a window that has the specified title and creates a NativeWindow instance from it (which includes the title, handle, owning process and window icon)

    NativeWindow.GetWindowFromPartialTitle
    Returns a list of all windows that have a title that contains the specified string - useful if you dont know the entire title of the window

    NativeWindow.MakeTopMost
    Makes the specified window a "topmost" window so that it always appears on top of all other windows

    NativeWindow.GetActiveWindow
    Gets the window that currently has focus and creates a NativeWindow instance from it (so includes window title, owning process, handle etc)


    As always, if anyone has any suggestions for any particular methods they want to see in this next version then let me know
    Last edited by chris128; Jul 8th, 2010 at 04:25 PM.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  12. #52

    Re: My Windows API Pack - Now available for download :)

    Good list of addons chris, can't wait for the next version.

  13. #53
    Fanatic Member Arve K.'s Avatar
    Join Date
    Sep 2008
    Location
    Kyrksæterøra, Norway
    Posts
    518

    Re: My Windows API Pack - Now available for download :)

    Hi Chris,

    First of all, let me just say that this is a fantastic piece of work . I am using your API pack to get icons from .exe- and .dll-files, and it works like a charm

    However, I am creating a taskbar sort-of-thingy, which consists of two forms -- frmMain and frmBar. The thing is that when mouse position.X equals My.Computer.Screen.WorkingArea.Width, frmBar moves in front of the other windows using Me.BringToFront() and Me.Activate(). This works great when I run the app under the IDE (VS2010), but when VS is not running, the form is always flashing a bit (according to MSDN this is because my application is not the active application). So I was trying to use your method .NativeWindow.StopFlashWindow to make it stop flash right after Me.Activate, but I can't figure out how to do it...
    So I was thinking maybe you (or someother) can give me an example on how to use it??

    Edit:
    Problem solved
    vb Code:
    1. Cjwdev.WindowsApi.NativeWindow.StopFlashWindow(Me.Handle) 'duh


    Arve
    Last edited by Arve K.; Jul 17th, 2010 at 05:34 PM. Reason: typos
    Arve K.

    Please mark your thread as resolved and add reputation to those who helped you solve your problem
    Disclaimer: I am not a professional programmer

  14. #54
    Fanatic Member Arve K.'s Avatar
    Join Date
    Sep 2008
    Location
    Kyrksæterøra, Norway
    Posts
    518

    Re: My Windows API Pack - Now available for download :)

    Btw, this (post 2) is the code I am using to get the mouse positions outside the form. Maybe this is something you could add to your API pack?
    Last edited by Arve K.; Jul 17th, 2010 at 04:27 PM. Reason: added some text...
    Arve K.

    Please mark your thread as resolved and add reputation to those who helped you solve your problem
    Disclaimer: I am not a professional programmer

  15. #55

    Thread Starter
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: My Windows API Pack - Now available for download :)

    Quote Originally Posted by _powerade_ View Post
    Hi Chris,

    First of all, let me just say that this is a fantastic piece of work . I am using your API pack to get icons from .exe- and .dll-files, and it works like a charm

    ...

    Edit:
    Problem solved
    vb Code:
    1. Cjwdev.WindowsApi.NativeWindow.StopFlashWindow(Me.Handle) 'duh

    Arve
    hey really glad it has helped you and yeah I see you figured out how to use the StopFlashWindow method.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  16. #56

    Thread Starter
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: My Windows API Pack - Now available for download :)

    For anyone interested, the new version (along with a list of all the new methods) is now available here: http://cjwdev.wordpress.com/2010/07/...2-1-available/

    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  17. #57
    Member
    Join Date
    May 2010
    Posts
    33

    Re: My Windows API Library - New version available for download

    Code:
    Cjwdev.WindowsApi.NativeNetwork.ReleaseIpAddresses()
    Keeps throwing this error:

    Code:
    A first chance exception of type 'System.ComponentModel.Win32Exception' occurred 
    in Cjwdev.WindowsApi.dll
    
    An attempt was made to reference a token that does not exist
    Any ideas? I'm definitely using DHCP.

  18. #58

    Thread Starter
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: My Windows API Library - New version available for download

    Thanks for letting me know - I tested it on my windows 7 machine as an admin and also as a standard user and it worked without an issue. However I just tried it on an XP machine I found that it worked as an admin but as a standard user I got the same error you mentioned. I had made a stupid mistake in the exception handling but I've fixed that now and uploaded the new version so it should now report the correct error (Access is denied - which you get because non admin users in XP cannot release IP addresses). I've uploaded the updated DLL so can you give that one a go and confirm that it gives you the correct error message now? Of course if you are not running this on XP or are running it on XP but as an admin then let me know as it's obviously a different issue that you are seeing. Download link for the new version is the same as before - http://www.cjwdev.co.uk/DeveloperCom...WindowsApi.zip

    Thanks
    Chris
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  19. #59
    Member
    Join Date
    May 2010
    Posts
    33

    Re: My Windows API Library - New version available for download

    Different error this time:

    Code:
    A first chance exception of type 'System.ComponentModel.Win32Exception' occurred 
    in Cjwdev.WindowsApi.dll
    
    The system cannot find the file specified
    I am running on WinXP Pro SP3 and my ID has local admin rights. I removed and re-added the dll in the references tab. Still no go. But this code works fine:

    Code:
    NativeOperatingSystem.Is64BitOperatingSystem

  20. #60

    Thread Starter
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: My Windows API Library - New version available for download

    Quote Originally Posted by cjconstantine View Post
    Different error this time:

    Code:
    A first chance exception of type 'System.ComponentModel.Win32Exception' occurred 
    in Cjwdev.WindowsApi.dll
    
    The system cannot find the file specified
    Ah I think I encountered that one when I was writing one of the other network card related methods. It was a while ago but I think in my case it was due to a virtual network card that some VPN software had installed - once I uninstalled the VPN software the error stopped being thrown so I assumed it was just a problem that that particular installation of the VPN software. Do you know if you have any virtual network cards on your PC?
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  21. #61
    Member
    Join Date
    May 2010
    Posts
    33

    Re: My Windows API Library - New version available for download

    Yeah, I have two VMWare virtual network adapters. And a large number of the PCs I'll be working with have VPN software ... I'll just have to use "ipconfig /release *"

    Great work on the API collection! AutoIt had a nice collection of service functions, if you were looking for ideas on functions to add to your API: http://www.autoitscript.com/forum/in...howtopic=80201

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width