[RESOLVED] (VB6) ShellExecute - A Problematic thing !!
:confused: 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.....
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=
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,
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
Re: (VB6) ShellExecute - A Problematic thing !!
To bring the window to the foreground you can also use the SetForegroundWindow API.
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!!!
Re: (VB6) ShellExecute - A Problematic thing !!
Hey I cannot see the Resolved Option to Mark this thread resolved !!!!!!!! :mad:
Re: (VB6) ShellExecute - A Problematic thing !!
You can't find the "Mark thread resolved" option in the "Thread tools" menu? :ehh: