Ok, I've fixed it. I Forgot to assign a value to _SCREEN.Caption before running the form. It seems that if _SCREEN.Caption is empty then all windows with no caption are made invisible. I guess that makes sense.
>Hi All,
>
> I've created a VFP6.0 EXE that I want to run as a service on W2K/NT servers. The EXE consists of a form and I like the form to appear without menus and without the VFP background. I've used the following code to remove the background and menus:
>
>* ----- Set the variables required to remove the foxpro window
>cdll = "USER32.DLL"
>
>DECLARE integer FindWindow IN &cDLL integer, string
>DECLARE integer ShowWindow IN &cDLL integer, integer
>
>SW_Maximise = 3
>SW_ShowNormal = 1
>SW_ShowMinimised = 2
>SW_ShowGone = 0
>
>ThisForm.AddProperty("ShowState",0)
>ThisForm.AddProperty("FoxHWND","")
>ThisForm.AddProperty("FoxGone","")
>
>ThisForm.ShowState = SW_ShowNormal
>NullPointer = 0
>ThisForm.FoxHWND = FindWindow(NullPointer,_Screen.Caption)
>
>* ----- Hide the main window
>Thisform.Foxgone = ShowWindow(Thisform.FoxHWND,SW_ShowGone)
>
>
>This code works ok in so far as it removes the background and menus, but it also makes any other instance of VFP invisible. Does anyone know how I can apply the above code to the instance of VFP that it was called from and not all instances of VFP?
>
>Thanks,
>Gavin...