Solved

Field taking fouus

Posted on 2004-09-21
6
143 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Use Multiple Forms 4 49
VB6 add a minute to the date time value 8 63
Need VBS version of Excel date conversion 4 65
message box in access 4 41
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

867 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now