
One of two functions doesn't function on Windows 95 (it does work on Windows NT)
Hi,
I have problem with folowing code on Windows 95, although it works on
Windows NT !?!
This code is give you an idea of what I'm plnning to do:
'Execute MSDE Uninstall app
Cmd = GetWinDir & "\IsUninst.exe -m" & GetWinDir &
"\sql70.mif -f""C:\MSSQL7\uninst.isu"" -C""C:\MSSQL7\sqlsun.dll"""
Shell Cmd, vbMinimizedNoFocus
'Here I'm waiting for the uninstall program to show
While FindWindow(vbNullString, "Confirm File Deletion") = 0
Sleep 100
DoEvents
Wend
'Ok I found the messagebox , the messagebox contains a Yes-button which is
default and has a hotkey Alt-Y, now I want to send both Alt-Y and the
Enter-key
just to be sure I hit the Yes-button!
lHandle = FindWindow(vbNullString, "Confirm File Deletion") 'I fetch the
handle of the window
SendMessage lHandle, WM_SETFOCUS, 0&, 0& ' I let the form have the focus
SendKeys "%Y" , True 'Send Alt-Y to press the Yes-button
SendKeys "{ENTER}" , True 'Just to be sure, I slam the enter key at the
form
I pass here but the form is still there, like I said it works on Windows
NT , I don't know what doesn't work, the SendMessage with the setfocus
clause, or the SendKeys
While FindWindow(vbNullString, "Remove Programs From Your Computer") = 0
'This loop 'hangs' because the first form is still visible
Sleep 1000
DoEvents
Wend
Anyone can help me out ?
Thanks in advance,
Pete