Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Releasing forms programmatically
Message
 
À
20/12/2022 07:19:05
Lutz Scheffler
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:
01685535
Vues:
54
J'aime (1)
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform