CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 14 of 14

Thread: Zip with Vb

  1. #1
    Join Date
    May 2000
    Location
    Belgium, Bruges
    Posts
    146

    Zip with Vb

    hi,

    Is there a way to avoid the begin screen of winzip ("i Agree" and "Quit").

    I Run zip with the shell function and i wander if you can use a parameter to avoid this screen.
    Or is there a way to close that screen with sendmessage. I tried this:

    Dim result as Long
    Dim result2 as Long
    Dim leave as Boolean
    result = FindWindow(vbNullString, "WinZip")
    If result > 0 then
    result2 = SendMessage(result, wm_keydown, ???, 0)
    result2 = SendMessage(result, wm_keyup, ???, 0)
    End If



    but i don't know what to fill in for the ???. (I tried using spyxx.exe, but there i see that the number of the button changes.


    Any help appreciated.



  2. #2
    Join Date
    Apr 2000
    Posts
    737

    Re: Zip with Vb

    try to use the Visual Studio utility call SPY to check what message that is being sent to Winzip when you press the button "I Agree".

    HTH

    cksiow
    http://vblib.virtualave.net - share our codes


  3. #3
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Zip with Vb

    you should register winzip...

    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  4. #4
    Join Date
    Oct 2000
    Posts
    58

    Re: Zip with Vb

    Hi,

    So, is there any way to avoid the begin screen of winzip ("I Agree" and "Quit")? I have the same task, did anybody got a solution. Thanks.


  5. #5
    Join Date
    May 2000
    Location
    Belgium, Bruges
    Posts
    146

    Re: Zip with Vb


    private Sub Zip_File(Src as string, trgt as string)
    zipIT = "c:\program files\winzip\winzip32 -a "
    unzipIT = "c:\program files\winzip\winzip32 -e "
    Shell (zipIT & Chr(34) & trgt & Chr(34) & " " & Chr(34) & Src & Chr(34))
    End Sub

    'call of the function
    Call Zip_File("E:\Example.zip ", "E:\example.txt")





    To unzip the file use the exe file with the -e paramaeter

    i use this, and it works fine


  6. #6
    Join Date
    Oct 2000
    Posts
    58

    Re: Zip with Vb

    Thanks, it works fine for me too. But did you find how to avoid the start screen of winzip ("I Agree" and "Quit")? Were you able to use SendMessage function?


  7. #7
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Zip with Vb

    This may be interesting:
    http://www.codeguru.com/vb/gen/vb_gr...cle.php/c6743/

    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Michael
    and all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

    The Rater
    Last edited by Cimperiali; March 15th, 2004 at 04:56 PM.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  8. #8
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    An hint from MKSa...

    Serach in this thread for MKSa code, and change "Ok" to
    "I Agree".
    Make code run after winzip window is showing up.
    It will press the I agree button. Thsi does not
    make that window hide, but make it disappear really soon...
    Press the "I Agree" button via code
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  9. #9
    Join Date
    Apr 2000
    Location
    Southampton, UK
    Posts
    329
    Or a completely different alternative:

    http://www.info-zip.org/

    Winzip compatible zip / unzip libraries for VB. Do it all without requiring the use of Winzip itself!
    TimCottee
    I know a little about a lot of things and a lot about very little.

    Brainbench MVP For Visual Basic
    http://www.brainbench.com

    MCP, MCSD, MCDBA, CPIM

  10. #10
    Join Date
    Jun 2002
    Location
    Dallas Area
    Posts
    15

    wzunzip(command line version)

    wzunzip is an addon command line version. I "shell" this command all the time and it works great. No windows popping up! I redirect the output to a file, read file and dump to a VB window!

  11. #11
    Join Date
    Sep 2002
    Posts
    59
    Cimperiali I tried the code and changed "Ok" to "I Agree"... but it didnt work. I can get the handle of the winzip window but I can't get the handle of the "I Agree" button. I even did some research and tried different things:

    hchildwnd = FindWindowEx(hwnd, ByVal 0&, "Button", "I Agree")
    hchildwnd = FindWindowEx(hwnd, ByVal 0&, "Button", "I &Agree")

    and the original...

    hchildwnd = FindWindowEx(hwnd, ByVal 0&, vbNullString, "I Agree")

    but each gave me 0 as a return value...

    Can you or anyone else give a try and let me know if it works for you... thxs...
    DrUnKeN MaStEr

  12. #12
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Winzip masters have been smarter...

    TRying to get captions of objects with enumchildwindow returns cations of many objects (included the "Ordering info..." button) but not of the "I Agree" or "Quit" button. It seems as if those two buttons have not a caption but an image on them....
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  13. #13
    Join Date
    Apr 2001
    Location
    Mississauga, CANADA
    Posts
    199
    Forgive me if I am wrong, but the problem that you are getting is due to the fact you are using an Un-Registered program (WinZip). One way around this is to register the program and pay the license fee. (really inexpensive). I don't think this board was envisioned as a place to provide hacks to programs, nor should we as users rate this thread. Again, if I am wrong, I apologize. But if I am right......
    My $.02 worth.
    Paul
    Last edited by praymond; September 16th, 2002 at 07:58 AM.

  14. #14
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Thumbs up To praymond

    Of course, you're right: register it is the correct solution. But speaking of "how to press a button on anther Pgm knowing caption of window and of button" is really an interesting issue, and this is why I entered the discussion. Again, you'ree right about the "registering" thing, and you're right also about thehis board isssue...
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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

Featured