PDA

View Full Version : Help.


Kick
02-10-2009, 03:05 PM
Why not work this code?

hWND = Application.GetWndHandle();
Result = DLL.CallFunction("shell32.dll", "ExtractIcon", hWND..",\"".._SystemFolder.."\\shell32.dll\",-1", DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL);
And is it possible to draw the icon file in the project, with its handle using ExtractIcon?
__________________________
Sorry for my English .. translated with Google

Kick
02-10-2009, 04:11 PM
Question withdrawn.
Obtained such a code:
hWND = Application.GetWndHandle();
hDC = WinApi.GetDC(hWND);
strPathFile = _SystemFolder.."\\shell32.dll";
nXPos = 30; nYPos = 30;
for i=1, 10 do
hIcon = DLL.CallFunction("shell32.dll", "ExtractIconA", hWND..",\""..strPathFile.."\","..i, DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL);
DLL.CallFunction("user32.dll", "DrawIcon", hDC..","..nXPos..","..nYPos..","..hIcon, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
DLL.CallFunction("user32.dll", "DestroyIcon", hIcon, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
nYPos = nYPos + 32;
end
Is it possible to reduce the size of icons?

Kick
02-10-2009, 04:30 PM
Issue. After minimize/restore the window icons are not redrawn. How can I fix it?