Renfield
Messages postés17287Date d'inscriptionmercredi 2 janvier 2002StatutModérateurDernière intervention27 septembre 202174 23 juil. 2004 à 15:26
exact... j'apprends un truc, encore, grâce à toi EB
"After a successful call to SetWindowRgn, the system owns the region specified by the region handle hRgn. The system does not make a copy of the region. Thus, you should not make any further function calls with this region handle. In particular, do not delete this region handle. The system deletes the region handle when it no longer needed."
toujours lire les petites lignes en bas.....
cs_EBArtSoft
Messages postés4525Date d'inscriptiondimanche 29 septembre 2002StatutModérateurDernière intervention22 avril 20199 23 juil. 2004 à 14:46
Désolé de te contre dire Renfield mais une fois que l'on a appelé SetWindowRgn, le systeme est propriétaire de la l'objet, par consequent on ne peut plus utiliser le handle et le systeme se charge de sa libération.
23 juil. 2004 à 15:26
"After a successful call to SetWindowRgn, the system owns the region specified by the region handle hRgn. The system does not make a copy of the region. Thus, you should not make any further function calls with this region handle. In particular, do not delete this region handle. The system deletes the region handle when it no longer needed."
toujours lire les petites lignes en bas.....
23 juil. 2004 à 14:46
cf: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pantdraw_2him.asp
@+
23 juil. 2004 à 07:03
en effet, ton code n'est pas parfait (lequel l'est ? ;) )
juste que tu crées une région.... il faut donc la supprimer....
Declare Function DeleteObject Lib "gdi32" Alias "DeleteObject" (ByVal hObject As Long) As Long
Dim hRgn as long '# HANDLE de la région
Private Sub Form_Unload()
DeleteObject hRgn
End Sub
Private Sub Fermer_Click()'Quitter l'Application !!
MsgBox "ABC Skinner 2004(R)",0,"Auteur"
Unload Me
End Sub
Private Sub Form_Load()
hRgn = CreateEllipticRgn(0, 0, 300, 200)
SetWindowRgn hWnd, hRgn , True
End Sub