|
-
Sep 2nd, 2008, 07:25 AM
#1
Thread Starter
Lively Member
[RESOLVED] (VB6) ShellExecute - A Problematic thing !!
Hi All,,
Thing I am doing -
I need to open a outprocess exe, based on some parameters.
I did it by using ShellExecute function as bellow -
ret = ShellExecute(hwnd, "Open", App.Path & "\test.exe", strParameter, vbNullString, SW_SHOWNORMAL)
the strParameter I passed is the value to text file which is opened from within this Exe.
Now, as a second step I want to check if the exe is loaded or not.
and if its loaded then I want to restore the exe back to topmost.
can I get some help to workaround with this,,,,
Thanks in advance to all of u.....
-
Sep 5th, 2008, 01:46 AM
#2
Re: (VB6) ShellExecute - A Problematic thing !!
Hai amolt,
FindWindow()
Thre is another option which i have never tried.
GetModuleUsage()
http://search.msdn.microsoft.com/Def...us&refinement=
Last edited by Fazi; Sep 5th, 2008 at 01:55 AM.
-
Sep 6th, 2008, 05:50 AM
#3
Thread Starter
Lively Member
Re: (VB6) ShellExecute - A Problematic thing !!
Hi Fazi,,
Thanks for reply,,,
I did it already using FindWindow .. need to work bit more with FindWindow.
The main problem I had is that my called VB Application have dynamic caption.
Secondly I am not able to search for called application from class as my calling VB Applications (through called application get open) open windows are also of same class.
So, for this I Enumerated among all open windows and read each windows title by GetWindowText api, then I done a matching with this title.
If its found then to go for show application to foreground stuff.
As searching I read from MSDN that AppActivate method can be used to activate application, the MSDN says that this function can also accept the return value of Shell function as
MyAppID = Shell("C:\WORD\WINWORD.EXE", 1) ' Run Microsoft Word.
AppActivate MyAppID ' Activate Microsoft Word.
I tried with this by passing the return value of ShellExecute function, but nothing happens.
Could you please tell me that -
What is the difference between return values of ShellExecute and Shell function ?
Is the way I am working with right now "FindWindow" is correct or shall I make use of AppActivate too ?
Regds,
-
Sep 6th, 2008, 07:13 AM
#4
Re: (VB6) ShellExecute - A Problematic thing !!
Do all the title changes or a partial caption remain all the time ?
YOu can even try with a partial caption
http://www.vbforums.com/archive/index.php/t-316924.html
-
Sep 11th, 2008, 04:32 PM
#5
-
Oct 7th, 2008, 02:28 AM
#6
Thread Starter
Lively Member
Re: (VB6) ShellExecute - A Problematic thing !!
Hi All
I ll be back after a long time on this issue as engaged in solving other issues, after this one .....
Need to say that this thing is solved!!!! Hurray !!
I checked for every window opened and after matching its caption to my parameter .... then if the window to whom I am looking was found just use ShowWindow ... it works!!
Thanks to all of you!!!
-
Oct 7th, 2008, 02:41 AM
#7
Thread Starter
Lively Member
Re: (VB6) ShellExecute - A Problematic thing !!
Hey I cannot see the Resolved Option to Mark this thread resolved !!!!!!!!
-
Oct 7th, 2008, 04:15 AM
#8
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|