Click to See Complete Forum and Search --> : Zip with Vb


dammansky
May 15th, 2001, 07:47 AM
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.

cksiow
May 15th, 2001, 07:54 AM
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

Cimperiali
May 15th, 2001, 07:55 AM
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.

GeorgeT
October 24th, 2001, 08:23 AM
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.

dammansky
October 24th, 2001, 09:03 AM
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

GeorgeT
October 24th, 2001, 09:13 AM
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?

Cimperiali
November 14th, 2001, 05:30 AM
This may be interesting:
http://www.codeguru.com/vb/gen/vb_graphics/fileformats/article.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

Cimperiali
July 19th, 2002, 04:22 AM
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 (http://www.codeguru.com/forum/showthread.php?s=&threadid=199964)

TimCottee
July 19th, 2002, 08:11 AM
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!

klt
July 19th, 2002, 09:09 AM
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!

DRUNKEN_MASTER
September 13th, 2002, 03:56 PM
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...

Cimperiali
September 16th, 2002, 03:53 AM
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....

praymond
September 16th, 2002, 07:51 AM
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

Cimperiali
September 16th, 2002, 08:08 AM
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...