News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Newly made process terminator

Started by xandaz, January 26, 2021, 08:58:11 PM

Previous topic - Next topic

xandaz

    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

xandaz

    Menu coodinates fixed. Working well. Thanks guys

xandaz

   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

jj2007


xandaz

   it's not working so well. i'll get it fixed right away

xandaz

  The terminateProcess function is crashing the app. Why the hell is that? Can u take a look JJ. Thanks

jj2007

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

xandaz

   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

jj2007

I've never used LVIF_PARAM, but I know that LVIF_TEXT works fine

xandaz

    whar's the reverse macro of  ustr$?

xandaz

   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

xandaz

   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

xandaz

   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.

Greenhorn

Does SHGetFileInfo return a handle to an image list ?

Are the parameters of SendMessage (hLV, LVM_SETIMAGELIST, ...) not twisted ?
Kole Feut un Nordenwind gift en krusen Büdel un en lütten Pint.

xandaz

   Yes it does, but it offers even worse results than using ExtractAssociatedIcon. There's got to be another way to do this. Thanks