Jump to content

create NOT RESPONDING situation for testing


punisa
 Share

Recommended Posts

Good morning (CET)!

I'm configuring a PC for public display only, it will run Media Player Classic in Fullscreen. As I won't be around once it gets installed, I need to make sure it runs fine.

I found this code which I recall did work:

If _NotResponding("Media Player", "", 1) Then
Else    
EndIf


Func _NotResponding($title, $text, $closeIfHung = 0)
    $hWnd = WinGetHandle($title, $text)
    If $hWnd == "" Then

     
    EndIf
    $retArr = DllCall("user32.dll", "int", "IsHungAppWindow", "hwnd", $hWnd)
    If @error == 0 Then
        If $retArr[0] == 1 Then
            If $closeIfHung Then
                ProcessClose(WinGetProcess($title, $text))
            EndIf
            Return 1
        EndIf
    Else
        Return 0
    EndIf
EndFunc

But how do I test it ? :o

Obviously I need to make MPC non responsive first, any trick how would I do that? I tried some shady stuff, like loading false files, but MPC is one brave piece of freeware it is :D

Anyways, all suggestions are welcome :)

carpe diem

Link to comment
Share on other sites

Good morning (CET)!

I'm configuring a PC for public display only, it will run Media Player Classic in Fullscreen. As I won't be around once it gets installed, I need to make sure it runs fine.

I found this code which I recall did work:

If _NotResponding("Media Player", "", 1) Then
Else    
EndIf


Func _NotResponding($title, $text, $closeIfHung = 0)
    $hWnd = WinGetHandle($title, $text)
    If $hWnd == "" Then

     
    EndIf
    $retArr = DllCall("user32.dll", "int", "IsHungAppWindow", "hwnd", $hWnd)
    If @error == 0 Then
        If $retArr[0] == 1 Then
            If $closeIfHung Then
                ProcessClose(WinGetProcess($title, $text))
            EndIf
            Return 1
        EndIf
    Else
        Return 0
    EndIf
EndFunc

But how do I test it ? :D

Obviously I need to make MPC non responsive first, any trick how would I do that? I tried some shady stuff, like loading false files, but MPC is one brave piece of freeware it is :D

Anyways, all suggestions are welcome :o

You might be able to suspend it's process. It has been discussed on this forum, so try the search.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You might be able to suspend it's process. It has been discussed on this forum, so try the search.

:)

"suspend process" is the magic word ! Thanks : ) I was searching high and low, but didn't have a clue what to type in.

carpe diem

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...