Posted By: pivson (Pijte pivo, je zdrave !) on 'CZprogram'
Title:     Re: M$ Windows dotaz
Date:      Fri Oct 12 21:26:59 2001

> Cau!
> 
>    Mel bych dotaz: Pokud pouzivam v programu funkce RegisterClass, 
> CreateWindow a LoadIcon na tvorbu HLAVNIHO okna programu, musim na konci
> nutne 
> udelat UnregisterClass, DestroyIcon a DestroyWindow aby Wokenice neprisly o 
> zdroje, nebo to za mne udelaji samy? Ted tam nemam ani jedno z toho a zda
> se, 
> ze se nic spatnyho nedeje... 
Z helpu:

The LoadIcon function loads the specified icon resource from the executable 
(.exe) file associated with an application instance. 

Note  This function has been superseded by the LoadImage function.

A tady je napsano (obecne ve Win32 to plati):

The system automatically deletes these resources when the process that 
created them terminates, however, calling the appropriate function saves 
memory and decreases the size of the process's working set. 

Register class (opet help)

Windows 95: All window classes registered by a .dll are unregistered when the 
.dll is unloaded.

Windows NT/2000: No window classes registered by a .dll are unregistered when 
the .dll is unloaded. A .dll must explicitly unregister its classes when it 
is unloaded. 

All window classes that an application registers are unregistered when it 
terminates. 

 
A co se tyce DestroyWindow - muzes to wokno zrusit jakkoliv - WM_DESTROY, ... 
zpusobu je vic. Ale nejak bys ho zavrit mel....

Az jednoho dne zavres aplikacia system na 5 sekund vytuhne - tak so se prave 
snazi uvolnovat tvoje pozapinany handly :o)


 

Pivson I a posledni, z bozi vule pivar

    A co budou delat cesi ???
                                     Deme na pivo !

Search the boards