>>>>I have a top level form EXE and I want to run it from another VFP app and have it minimized. I am running: run /n2 MYAPP.EXE and it isn't being minimized. Any ideas?
>>>>TIA!
>>>
>>>David,
>>>Use shellexecute.
>>>
>>>
#define SW_HIDE 0
>>>#define SW_SHOWNORMAL 1
>>>#define SW_NORMAL 1
>>>#define SW_SHOWMINIMIZED 2
>>>#define SW_SHOWMAXIMIZED 3
>>>#define SW_MAXIMIZE 3
>>>#define SW_SHOWNOACTIVATE 4
>>>#define SW_SHOW 5
>>>#define SW_MINIMIZE 6
>>>#define SW_SHOWMINNOACTIVE 7
>>>#define SW_SHOWNA 8
>>>#define SW_RESTORE 9
>>>#define SW_SHOWDEFAULT 10
>>>#define SW_FORCEMINIMIZE 11
>>>#define SW_MAX 11
>>>
>>>declare long ShellExecute in "shell32.dll" ;
>>> long hwnd, string lpszOp, ;
>>> string lpszFile, string lpszParams, ;
>>> string lpszDir, long nShowCmd
>>>
>>>ShellExecute(0,'open','c:\mypath\myapp.exe',0,0,SW_SHOWMINIMIZED)
Cetin
>>
>>I tried this and it doesn't work on either of my applications. They are top-level apps with a minimized button activated. I even tried sending a parameter to the EXE to set the WindowState in the Init and that hasn't worked.
>
>Check offending code in app. You can try this on a well-known executing such as winword.
>Cetin
Yes, I did try it on Notepad and it worked. As George said, there must be something in the app that is preventing it from minimizing. I did work on passing parameters to the EXE and based on the parameters it would be normal or minimized. I was able to get an APP to work but when I created the EXE I got a Syntax error. Back to the drawing board.
Thanks!