Why is the window frozen "Not Responding"

You need some new stunning features ? Tell us here.
hoangdiemtinh
User
User
Posts: 97
Joined: Wed Nov 16, 2022 1:51 pm

Why is the window frozen "Not Responding"

Post by hoangdiemtinh »

I am new to PB.
My primary language is not US/UK. I am using Google Translate.

What solutions when using DisableGadget/DisableWindow without causing the window are not respoding ?
Last edited by hoangdiemtinh on Fri May 24, 2024 12:42 pm, edited 1 time in total.
PC: Windows 10 x64, 8GB RAM. PB ver: 6.x
--
I love PB5 vs PB6 :)
AZJIO
Addict
Addict
Posts: 2187
Joined: Sun May 14, 2017 1:48 am

Re: Why do I use DisableGadget/DisableWindow, immediately encounter "Not Responding" problem.

Post by AZJIO »

hoangdiemtinh wrote: Wed May 22, 2024 4:14 am I am new to PB.
My primary language is not US/UK. I am using Google Translate.
I use double check (screenshot)
QTranslate, Crow Translate (Linux), s3_translator (Alt+V)
hoangdiemtinh wrote: Wed May 22, 2024 4:14 am Why do I use DisableGadget/DisableWindow, immediately encounter "Not Responding" problem.
show your example
are you using the call on another thread?
hoangdiemtinh
User
User
Posts: 97
Joined: Wed Nov 16, 2022 1:51 pm

Re: Why is the window frozen "Not Responding"

Post by hoangdiemtinh »

Before that command, there are the following commands:

Code: Select all


#SHA1_ISO = "9989F522934D032C01BS4B1EAB2459CDB93C05TF"

Procedure.s get_SHA1(fn.s)
  UseSHA1Fingerprint()
  Protected.s sha1
  sha1 = FileFingerprint(GetCurrentDirectory() + fn, #PB_Cipher_SHA1)
  ProcedureReturn sha1
EndProcedure

Procedure.I check_SHA1()
  Protected.s ss, yy
   ss = get_SHA1(GetCurrentDirectory() + "my-iso.iso") ; this file is 5GB size
    yy = #SHA1_ISO
    If CompareMemoryString(@ss, @yy, #PB_String_NoCaseAscii) ! #PB_String_Equal
      ProcedureReturn #False
    EndIf
    ProcedureReturn #True
  EndIf
EndProcedure
 ...................
 .....................
 Repeat
  ev_WINDOW = WaitWindowEvent()
  Select EventWindow()
      ;
    Case #mainWin
      Select ev_WINDOW   
        Case #PB_Event_Gadget
          Select EventGadget()
            Case #Button_CHECK_SHA1
            If check_SHA1() = $False
            MessageRequester(":(", "SHA1 does not match.")
            EndIf
            ..........................
            ............
  
mainWin then show "Not Responding" , freeze...
PC: Windows 10 x64, 8GB RAM. PB ver: 6.x
--
I love PB5 vs PB6 :)
AZJIO
Addict
Addict
Posts: 2187
Joined: Sun May 14, 2017 1:48 am

Re: Why is the window frozen "Not Responding"

Post by AZJIO »

If no events come to the window within a couple of minutes, the window becomes frozen. Try running the task in a thread.
You can read the file in chunks - StartFingerprint(). And between reading, poll window events.
hoangdiemtinh
User
User
Posts: 97
Joined: Wed Nov 16, 2022 1:51 pm

Re: Why is the window frozen "Not Responding"

Post by hoangdiemtinh »

PC: Windows 10 x64, 8GB RAM. PB ver: 6.x
--
I love PB5 vs PB6 :)
Post Reply