DECLARE SHORT DrawIcon IN Win32API; > INTEGER Hdc, INTEGER X, INTEGER Y, INTEGER hIcon >* You'll need to replace the following declaration >DECLARE INTEGER ExtractIcon IN Shell32; > INTEGER hInst, STRING @lpszExeFileName, INTEGER nIconIndex >* with the following. >DECLARE INTEGER ExtractAssociatedIcon IN Shell32; > INTEGER hInst, STRING @lpszExeFileName, INTEGER nIconIndex >DECLARE INTEGER GetClassLong IN Win32API; > INTEGER hWnd, INTEGER nIndex >DECLARE INTEGER GetDC IN Win32API; > INTEGER hWnd >DECLARE INTEGER ReleaseDC IN Win32API; > INTEGER hwnd, INTEGER hdcNow you should add the following properties to the form: HInstance, HDc, and HIcon and assign them as follows
ThisForm.HInstance = GetClassLong(ThisForm.HWnd, -16) >ThisForm.HDc = GetDC(ThisForm.HWnd) >ThisForm.HIcon = ExtractAssociatedIcon(ThisForm.HInstance, lcfilename, 0)Now in the Paint and Show methods of the form
= DrawIcon(This.HDc, 12, 12, This.HIcon)This displays the icon at 12, 12 (pixels) of the form's client area.
= ReleaseDC(This.HWnd, This.HDc)in the form's destroy event.
"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."
- Ephesians 4:29-30 NIV
Dare to Question -- Care to Answer
Time is like water in a sponge, as long as you are willing you can always squeeze some.
--Lu Xun, Father of Modern Chinese Literature