Hey guys. Made this little app to terminate process alike the TaskManager. There ae still some issues regarding the position of the menu but works fine. Thanks guys. You're the best
Menu coodinates fixed. Working well. Thanks guys
I was thinking how you get the icons for each process but haven't found out how to do it. Doesn anyone know how? Thanks in advance
Compliments, that looks very nice :thumbsup:
it's not working so well. i'll get it fixed right away
The terminateProcess function is crashing the app. Why the hell is that? Can u take a look JJ. Thanks
Quote from: xandaz on January 26, 2021, 11:45:08 PMCan u take a look JJ
For reasons that I don't understand I can build your source but the exe does not list any processes - and getting that list is not a big deal, see below. Mysteries of Windows :sad:
include \masm32\MasmBasic\Res\MbGui.asm
GetProcessArray()
GuiControl MyList, "listbox", MbProc$()
GuiControl Status, "statusbar", wStr$("%i processes found", MbProc$(?))
GuiEnd
Very good JJ. Are you aware of any incompatibility between LVIF_TEXT and LVIF_PARAM in the LV_ITEM struct? When i mention LVIF_PARAM no text is shown. Thanks
I've never used LVIF_PARAM, but I know that LVIF_TEXT works fine
whar's the reverse macro of ustr$?
For further notice LVIF_TEXT+LVIF_PARAM only works for items. Doesnt work for subitems. I leave her the process enumerater/terminator for y'all. Thanks
Hi guys. I've been having a hard time with LVM_SETIMAGELIST. I used SHGetFileInfo to get the icons index but when i call LVM_SETIMAGELIST it returns NULL. here's a portion of the code: mov hToolhelp,rv(CreateToolhelp32Snapshot,TH32CS_SNAPALL,0)
mov pe32.dwSize,sizeof PROCESSENTRY32
mov me32.dwSize,sizeof MODULEENTRY32
invoke Process32First,hToolhelp,addr pe32
invoke Module32First,hToolhelp,addr me32
invoke SHGetFileInfo,addr me32.szExePath,0,addr shfi,sizeof shfi,SHGFI_SMALLICON+SHGFI_SYSICONINDEX
push eax
invoke MessageBox,0,ustr$(eax),0,MB_OK
pop eax
invoke SendMessage,hLV,LVM_SETIMAGELIST,eax,LVSIL_SMALL
invoke MessageBox,0,ustr$(eax),0,MB_OK
m2m lvi.iImage,shfi.iIcon
I've been trying to get the icons either via SHGetFileInfo or ExtractAssociatedIcon but none of the two satisfy me. This is how it stands.
Does SHGetFileInfo (https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shgetfileinfow) return a handle to an image list ?
Are the parameters of SendMessage (hLV, LVM_SETIMAGELIST (https://docs.microsoft.com/en-us/windows/win32/controls/lvm-setimagelist), ...) not twisted ?
Yes it does, but it offers even worse results than using ExtractAssociatedIcon. There's got to be another way to do this. Thanks
Finally got it to work. Thanks you all.
Your example works, but the icons show the icons of the directory it's in. When I recompile the list seems empty. (Winclasses.asm I got this file from your previous posts.) Thank you, nice sharing.
no....thanks you.
I've been dwelling between SHGetFileInfo and ExtractAssociatedIcon/ExtractIcon functions. Either of the methods work badly. I'm not so confidant i can deliver a fully working example. Thanks guys
Best working example so far.
At last working. Still not very satisfyingly but works. Some icons seem to be mismatched. Thanks