Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Releasing forms programmatically
Message
 
À
20/12/2022 07:27:59
Lutz Scheffler (En ligne)
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01685522
Message ID:
01685538
Vues:
46
Hi Lutz,

This method search windows opennend from VFP and test if it's messagebox (class is #32770) or not.

MartinaJ

>Hi Martina,
>
>Nice. Do you do this by default, or do you need to know if the MB is open?
>
>Lutz
>
>>Hi,
>>
>>Messageboxes are not problem:
>>
>>
>>   PROCEDURE DirectCloseMessagebox()
>>      LOCAL ARRAY laWind(1)
>>      LOCAL lnCount,lii,lcCaption,liOwner,lcClass,liLen
>>
>>      lnCount = AWINDOWS("laWind",1,_VFP.hwnd) && VFP2c32.fll
>>      FOR lii=1 TO lnCount
>>          lcCaption=GetWindowTextEx(laWind(lii))  && WINAPI
>>
>>          liOwner=GetWindow(laWind(lii),GW_OWNER)  && WINAPI
>>          IF _VFP.hwnd=liOwner
>>             lcClass=SPACE(254)
>>             liLen=GetClassNameA(laWind(lii),@lcClass,LEN(lcClass))  && WINAPI
>>             IF liLen>0 AND LEFT(lcClass,liLen)=="#32770"
>>*                debugout lcCaption+" "+TRANSFORM(laWind(lii),"@0")+" "+TRANSFORM(liOwner,"@0")+" "+lcClass
>>                SendMessage(laWind(lii), WM_CLOSE, 0, 0)  && WINAPI
>>             ENDIF
>>          ENDIF   
>>      NEXT    
>>   ENDPROC
>>
>>
>>
>>MartinaJ
>>
>>>>Thanks. Sounds like a similar situation. I'll see whether a similar solution will help.
>>>>
>>>>Tamar
>>>
>>>The most important is, that the stucked code where the modal form is called must run to end before the form closes. It will not run while the form is closing or in queryunload. So, if one closes the form, the code is left in a undefined state. Cursors, for example, are gone.
>>>
>>>For that you need to go back to the event loop, and recall the closing after a while. If you see a different way to end the method out of queryunload let me know, now it's awkward and looks slow.
>>>OTOH I use this to close report preview as well. Form knows about active preview and how to kill it. Messageboxes remain a problem.
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform