End Process from Task Manager using VB 6 Code

后端 未结 8 1312
被撕碎了的回忆
被撕碎了的回忆 2021-01-13 03:14

I need to kill an application roughly so I can get phantom subscriber of that application in my database (this can not be produced by closing the application). Manually, if

8条回答
  •  时光取名叫无心
    2021-01-13 03:41

    Karl Peterson's excellent archive of VB6 code has high quality sample code and full explanations using both WM_CLOSE and TerminateProcess. Accept no substitutes!

    One pitfall you might see in a lot of code out there is that sending WM_CLOSE to a single window handle you have isn't sufficient - most applications comprise numerous windows. The answer as implemented in Karl's code: Find all the top-level windows belonging to this application and send the message to each.

提交回复
热议问题