Solved

Field taking fouus

Posted on 2004-09-21
6
142 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

757 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

22 Experts available now in Live!

Get 1:1 Help Now