Solved

Field taking fouus

Posted on 2004-09-21
6
146 Views
Last Modified: 2010-05-02
I am a vb6 developer.  I have problem setting focus on a field if I run the program using the shell statement.  If I run the application not using the shell statement things works fine.
Any answers?
0
Comment
Question by:BHoward
6 Comments
 
LVL 4

Assisted Solution

by:avi247
avi247 earned 125 total points
ID: 12118232
Could you elaborate with an example\code.
0
 
LVL 19

Assisted Solution

by:arif_eqbal
arif_eqbal earned 125 total points
ID: 12119576
Use AppActivate after Shell and try
0
 
LVL 10

Assisted Solution

by:anv
anv earned 125 total points
ID: 12119631
hi BHoward

Please elaborate ur question and can u provide us the code ..??
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 125 total points
ID: 12119692
try using CreateProcess() API.

-Brian
0
 

Author Comment

by:BHoward
ID: 12136506
Hi Guys,

I'm trying to help a friend who is new to vb6.  what he is trying to do from a menu item on his primary form, fire up a stand application called phonebook.  as long as he does it using this method

On Error Resume Next
    Response = Shell("Phonebook.exe", 1)  ' Run phonebook.
    AppActivate Response                         ' Activate phonebook
On Error GoTo 0

he is trying to setfocus on a combobox. nothing happens.  in the development mode of phonebook you can run it in the development and everthing works great.  You can execute the compiled phone and its works ok.   it doesn't work using the above code.  


how do you use the CreateProcess() API?

Thanks,
Bill

0
 

Author Comment

by:BHoward
ID: 12136691
Hi Guys,

I solved it myself.  
changing the statement from
   Response = Shell("Phonebook.exe", 1)  ' Run phonebook.
to
  Response = Shell("Phonebook.exe", vbNormalFocus)  ' Run phonebook.

fixes the problem

Bill


0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question