>>I don't know what run_with is. However you say it's something that shellexecutes :)
>
>Yes, its some George Tasker code I found in the code section..
>But the point is it uses shell execute.
>
>
>>BTW I think using ShellExecute's last parameter (showwindow-1) you might not need all these.
>
>I tried the parameters but it has no effect. I should mention it's only some applications that don't make it in front...
>
>>FindWindow supports 2 parameters, window title and class. You could pass only the class (title null-0) and check for mic.des. window.
>
>I checked this out about the class in the help file but I don't understand how it works and what you mean by "check for mic.des. window"..
>
>I also just began to check out CreateProcess API...A VB programmer on my team had luck using this for a similar problem in our vb app..
>
>But I haven't started on that.. Tryed search here for an example in VFP but I
>don't see one? Anyone try this out?
>
>Thanks!!
Tim,
declare integer FindWindow in win32API ;
string @ lpClassName, string @ lpWindowName
FindWindow(0,'Microsoft Visual Foxpro') && Search by title
FindWindow('WhatEverMicroDesignerClassIs',0) && search by class
This is from what I mentioned (I use a FLL...) in original message if helps :
void FAR RunProg(ParamBlk FAR *parm)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
char FAR *cmdStr = NullTerminate(&parm->p[0].val);
ZeroMemory(&si, sizeof (STARTUPINFO));
si.cb = sizeof (STARTUPINFO);
if ( !CreateProcess(NULL, cmdStr, NULL, NULL, FALSE,
NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi))
{
_RetInt(0,10);
return;
}
WaitForInputIdle (pi.hProcess, INFINITE);
CloseHandle (pi.hThread);
CloseHandle (pi.hProcess);
}
PS : CreateProcess part alone doesn't help. At the end I was forced to get hwnd.
Cetin