auto response "vbYes" button in VB 
Author Message
 auto response "vbYes" button in VB

Hi all big brothers and sisters,

I wrote a QuickBasic 4.5 that just simply prompting user a question with a
Y/N option.  If a user select Y, it will print, you selected YES.
If user select N, it will print, you selected NO.  This is not what I want
it to be.  What I want is an auto-response by redirect input from a text
file.  See example below:

source file: assign2.exe (will prompt user for Y/N:)
answer file: answer.txt (store a an 8-bit Y character)

assign2.exe < answer.txt

I want this line to get an input from a redirect file, e.g answer.txt
which has a value of Y.  So, if this program is ran, it automatically make
decision base on a pregiven value either Y or N that store in answer.txt

I did this in QuickBasic 4.5 and it worked, but I couldn't make it work in
Visual Basic 4,5,6.  Because VB has a vbYes and vbNo button which you can
store in answer.txt file like in text-mode.  Please help me if anyone know
workaround in VB that can preset a value for vbYes button.

This is what I want in VB to look like when assign2.exe is ran:

Are you sure you want to format?
Yes or No button

Instead of getting an input from user, I want to get an input from a
redirect file like answer.txt

Thanks You,
Sam

--
Posted via CNET Help.com
http://www.*-*-*.com/



Tue, 07 Jan 2003 03:00:00 GMT  
 auto response "vbYes" button in VB

Is the VB app that pops up the MsgBox written by you?  If so, don't even pop
up the box, just get the value from the file and do your work...

It the app is not written by you, you'll have to resort to finding the
window handle of the message box (or its parent) and sending that window a
message.

-Dan


Quote:
> Hi all big brothers and sisters,

> I wrote a QuickBasic 4.5 that just simply prompting user a question with a
> Y/N option.  If a user select Y, it will print, you selected YES.
> If user select N, it will print, you selected NO.  This is not what I want
> it to be.  What I want is an auto-response by redirect input from a text
> file.  See example below:

> source file: assign2.exe (will prompt user for Y/N:)
> answer file: answer.txt (store a an 8-bit Y character)

> assign2.exe < answer.txt

> I want this line to get an input from a redirect file, e.g answer.txt
> which has a value of Y.  So, if this program is ran, it automatically make
> decision base on a pregiven value either Y or N that store in answer.txt

> I did this in QuickBasic 4.5 and it worked, but I couldn't make it work in
> Visual Basic 4,5,6.  Because VB has a vbYes and vbNo button which you can
> store in answer.txt file like in text-mode.  Please help me if anyone know
> workaround in VB that can preset a value for vbYes button.

> This is what I want in VB to look like when assign2.exe is ran:

> Are you sure you want to format?
> Yes or No button

> Instead of getting an input from user, I want to get an input from a
> redirect file like answer.txt

> Thanks You,
> Sam

> --
> Posted via CNET Help.com
> http://www.help.com/



Wed, 08 Jan 2003 03:00:00 GMT  
 auto response "vbYes" button in VB
Dan,

The VB app that pops up the MsgBox is not written by me.  It's a third
party vendor.  I know how to do the one that is written by myself, but not
by the third party vendor.  Dan, do you have a very completed short
program that does this kind of stuff?  I mean very very short that just do
simple thing like Yes or No button.  If you do, it would be a great
helpful to clarify me this issue.

Thanks You,
Sam

Quote:

> Is the VB app that pops up the MsgBox written by you?  If so, don't even
pop
> up the box, just get the value from the file and do your work...

> It the app is not written by you, you'll have to resort to finding the
> window handle of the message box (or its parent) and sending that window
a
> message.

> -Dan



> > Hi all big brothers and sisters,

> > I wrote a QuickBasic 4.5 that just simply prompting user a question
with a
> > Y/N option.  If a user select Y, it will print, you selected YES.
> > If user select N, it will print, you selected NO.  This is not what I
want
> > it to be.  What I want is an auto-response by redirect input from a
text
> > file.  See example below:

> > source file: assign2.exe (will prompt user for Y/N:)
> > answer file: answer.txt (store a an 8-bit Y character)

> > assign2.exe < answer.txt

> > I want this line to get an input from a redirect file, e.g answer.txt
> > which has a value of Y.  So, if this program is ran, it automatically
make
> > decision base on a pregiven value either Y or N that store in
answer.txt

> > I did this in QuickBasic 4.5 and it worked, but I couldn't make it
work in
> > Visual Basic 4,5,6.  Because VB has a vbYes and vbNo button which you
can
> > store in answer.txt file like in text-mode.  Please help me if anyone
know
> > workaround in VB that can preset a value for vbYes button.

> > This is what I want in VB to look like when assign2.exe is ran:

> > Are you sure you want to format?
> > Yes or No button

> > Instead of getting an input from user, I want to get an input from a
> > redirect file like answer.txt

> > Thanks You,
> > Sam

> > --
> > Posted via CNET Help.com
> > http://www.help.com/

--
Posted via CNET Help.com
http://www.help.com/


Sat, 11 Jan 2003 03:00:00 GMT  
 auto response "vbYes" button in VB
I could create something rather small, but I'd need some more specifics. For
instance, the easiest way is to identify the MsgBox's parent's window
handle. This can most easily be accomplished by using FindWindow and passing
the caption of the window you're using. To make it even easier, if you know
the caption of the messagebox and also know that it is fairly unique and
will never change for the sake of your application, you could look for the
window handle directly and send the Ok button a click message.

Essentially it comes down to identifying the window (or parent window) that
needs the message sent and sending it some kind of message.

More importanly, why do you need to automatically press Ok to a MsgBox?
Maybe some other technique would work better. For instance, if pressing Ok
to a message box is just clearing an error and closing the app, maybe you
could just close the app directly.

-Dan


Quote:
> Dan,

> The VB app that pops up the MsgBox is not written by me.  It's a third
> party vendor.  I know how to do the one that is written by myself, but not
> by the third party vendor.  Dan, do you have a very completed short
> program that does this kind of stuff?  I mean very very short that just do
> simple thing like Yes or No button.  If you do, it would be a great
> helpful to clarify me this issue.

> Thanks You,
> Sam


> > Is the VB app that pops up the MsgBox written by you?  If so, don't even
> pop
> > up the box, just get the value from the file and do your work...

> > It the app is not written by you, you'll have to resort to finding the
> > window handle of the message box (or its parent) and sending that window
> a
> > message.

> > -Dan



> > > Hi all big brothers and sisters,

> > > I wrote a QuickBasic 4.5 that just simply prompting user a question
> with a
> > > Y/N option.  If a user select Y, it will print, you selected YES.
> > > If user select N, it will print, you selected NO.  This is not what I
> want
> > > it to be.  What I want is an auto-response by redirect input from a
> text
> > > file.  See example below:

> > > source file: assign2.exe (will prompt user for Y/N:)
> > > answer file: answer.txt (store a an 8-bit Y character)

> > > assign2.exe < answer.txt

> > > I want this line to get an input from a redirect file, e.g answer.txt
> > > which has a value of Y.  So, if this program is ran, it automatically
> make
> > > decision base on a pregiven value either Y or N that store in
> answer.txt

> > > I did this in QuickBasic 4.5 and it worked, but I couldn't make it
> work in
> > > Visual Basic 4,5,6.  Because VB has a vbYes and vbNo button which you
> can
> > > store in answer.txt file like in text-mode.  Please help me if anyone
> know
> > > workaround in VB that can preset a value for vbYes button.

> > > This is what I want in VB to look like when assign2.exe is ran:

> > > Are you sure you want to format?
> > > Yes or No button

> > > Instead of getting an input from user, I want to get an input from a
> > > redirect file like answer.txt

> > > Thanks You,
> > > Sam

> > > --
> > > Posted via CNET Help.com
> > > http://www.help.com/

> --
> Posted via CNET Help.com
> http://www.help.com/



Sat, 11 Jan 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Disabling "BACK"/"FORWARD" buttons

2. Disabling "BACK"/"FORWARD" buttons

3. response.write("<br>")

4. Response.contenttype = "application/vnd.ms-excel"

5. "Nested" response.write

6. "Response"

7. Response.Write Server.HTMLEncode ( "Joe Schmoe")

8. getobjectcontext("response")

9. "Auto List Members" kills my database

10. "How-To" Auto Update Problems

11. "Auto-Archive" applet

12. Help needed with RunAddon, "Database Refresh Shape", auto refresh

 

 
Powered by phpBB® Forum Software