Jump to content
Flaccid_Jack

Window Manager Process - high resource use and freezing computer - (Locked)

Recommended Posts

Hello, 

I have a GUI with scroll bars  that is displaying ~100 buttons (with bmp skins) and scrolling causes the window manager process to work overtime and even freeze explorer for a few seconds.

I hide and disable all buttons that aren’t on the screen, but that doesn’t seem to help at all.

Any tricks for this?

Thanks!

Share this post


Link to post
Share on other sites

without looking at the code?

I'd say look into AdlibRegister if you have any.  The Scrolling maybe?

Hiding and disabling buttons wouldn't do anything as the controls still exist.

If you are using Opt("GUIOnEventMode", 1), then ensure you have some sleep in the While loop.


hmm... I guess I have to have a signature...

Share this post


Link to post
Share on other sites
Func BuildSpellbookGUI()

For $i = 0 To 699
   If $Mana[$i] > 0 Or $CastRangeMax[$i] > 0 Then
      $NewName = StringSplit($Image[$i],"\")
      If UBound($NewName) > 1 Then
         If UBound($NewName) > 5 Then
            $ImageName[$i] = StringTrimRight($NewName[6],4)&".bmp"
            $Image[$i] = @TempDir & '\pics\'&$ImageName[$i]
;~          MsgBox("","",$Image[$i])
         EndIf
      EndIf
   EndIf
Next
   $DynamicLabel21 = 0
   Opt("GUIOnEventMode", 1)
   Global $BuildSpellbookGUI=GuiCreate("Spellbook Builder", 850, 200, @DesktopWidth/4.6, 45, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX))
   GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEButton")
   GUISetBkColor(0xE0FFFF)
   Global $hTab_WinConjuration = GUICreate("", 860, 900, 0, 0, $WS_POPUP, $WS_EX_MDICHILD, $BuildSpellbookGUI)
   GUISetBkColor(0xE0FFFF)
   _GUIScrollbars_Generate($hTab_WinConjuration, -1, 45000)
   $ActiveWindow = "$hTab_WinConjuration"
   $y_local0 = 70
   $y_local1 = 70
   For $i = 0 To 699 Step 2
      If $i = 100 Then
         Global $hTab_WinIncantation = GUICreate("", 860, 900, 0, 0, $WS_POPUP, $WS_EX_MDICHILD, $BuildSpellbookGUI)
         _GUIScrollbars_Generate($hTab_WinIncantation, -1, 45000)
         GUISetBkColor(0xE0FFFF)
         $y_local0 = 70
         $y_local1 = 70
      ElseIf $i = 200 Then
         Global $hTab_WinCreature = GUICreate("", 860, 900, 0, 0, $WS_POPUP, $WS_EX_MDICHILD, $BuildSpellbookGUI)
         _GUIScrollbars_Generate($hTab_WinCreature, -1, 45000)
         GUISetBkColor(0xE0FFFF)
         $y_local0 = 70
         $y_local1 = 70
      ElseIf $i = 400 Then
         Global $hTab_WinAttack = GUICreate("", 860, 900, 0, 0, $WS_POPUP, $WS_EX_MDICHILD, $BuildSpellbookGUI)
         _GUIScrollbars_Generate($hTab_WinAttack, -1, 45000)
         GUISetBkColor(0xE0FFFF)
         $y_local0 = 70
         $y_local1 = 70
      ElseIf $i = 500 Then
         Global $hTab_WinEnchantment = GUICreate("", 860, 900, 0, 0, $WS_POPUP, $WS_EX_MDICHILD, $BuildSpellbookGUI)
         _GUIScrollbars_Generate($hTab_WinEnchantment, -1, 45000)
         GUISetBkColor(0xE0FFFF)
         $y_local0 = 70
         $y_local1 = 70
      ElseIf $i = 600 Then
         Global $hTab_WinEquipment = GUICreate("", 860, 900, 0, 0, $WS_POPUP, $WS_EX_MDICHILD, $BuildSpellbookGUI)
         _GUIScrollbars_Generate($hTab_WinEquipment, -1, 45000)
         GUISetBkColor(0xE0FFFF)
         $y_local0 = 70
         $y_local1 = 70
      EndIf
      If $Mana[$i] > 0 Or $CastRangeMax[$i] > 0 Then
         $Button2[$i] =  GuiCtrlCreateButton("Remove", 290, $y_local0+40, 120, 45)
         GUICtrlSetOnEvent (-1, "Button2")
         $Button[$i] =  GuiCtrlCreateButton($i, 10, $y_local0, 280, 400, $BS_BITMAP)
         GUICtrlSetOnEvent (-1, "Button")
         GUICtrlSetImage($Button[$i],$Image[$i])
         $Label[$i] = GuiCtrlCreateLabel("Count: "&$DynamicLabel[$i], 320, $y_local0, 100, 20)
         $Label2[$i] = GuiCtrlCreateLabel("(Points: "&$DynamicLabel2[$i]&")", 320, $y_local0+20, 100, 20)
         $ButtonPos[$i] = Round($y_local0 / 16,0) - 14
         $y_local0 += 440
      EndIf
      If $Mana[$i+1] > 0 Or $CastRangeMax[$i+1] > 0 Then
         $Button2[$i+1] =  GuiCtrlCreateButton("Remove", 700, $y_local1+40, 120, 45)
         GUICtrlSetOnEvent (-1, "Button2")
         $Button[$i+1] =  GuiCtrlCreateButton($i+1, 420, $y_local1, 280, 400, $BS_BITMAP)
         GUICtrlSetOnEvent (-1, "Button")
         GUICtrlSetImage($Button[$i+1],$Image[$i+1])
         $Label[$i+1] = GuiCtrlCreateLabel("Count: "&$DynamicLabel[$i+1], 730, $y_local1, 100, 20)
         $Label2[$i+1] = GuiCtrlCreateLabel("(Points: "&$DynamicLabel2[$i+1]&")", 730, $y_local1+20, 100, 20)
         $ButtonPos[$i+1] = Round($y_local1 / 16,0) - 14
         $y_local1 += 440
      EndIf
   Next
   GUIDelete($LoadingGUI)
#Region -Child GUIs-
   GUISetFont(15, 700, 0, "Times New Roman", 1)
   GUISetState(@SW_SHOW,$BuildSpellbookGUI)
   GUISetState(@SW_SHOW,$hTab_WinConjuration)
   Global $hTab_WinConjurationChild = GUICreate("", 150, 85, -151, 85, $WS_POPUP, $WS_EX_MDICHILD, $BuildSpellbookGUI)
   Global $Label1x = GuiCtrlCreateButton("Conjurations", 10, 10, 120, 70, $SS_CENTER)
   GUICtrlSetOnEvent (-1, "ButtonCon")
   GUISetBkColor(0xD1FFFF)
   GUISetState(@SW_SHOW)
   Global $hTab_WinIncantationsChild = GUICreate("", 150, 85, -151, 170, $WS_POPUP, $WS_EX_MDICHILD, $BuildSpellbookGUI)
   Global $Label1xx = GuiCtrlCreateButton("Incantations", 10, 10, 120, 70, $SS_CENTER)
   GUICtrlSetOnEvent (-1, "ButtonInc")
   GUISetBkColor(0xC3FFFF)
   GUISetState(@SW_SHOW)
   Global $hTab_WinCreaturesChild = GUICreate("", 150, 85, -151, 255, $WS_POPUP, $WS_EX_MDICHILD, $BuildSpellbookGUI)
   Global $Label1xc = GuiCtrlCreateButton("Creatures", 10, 10, 120, 70, $SS_CENTER)
   GUICtrlSetOnEvent (-1, "ButtonCre")
   GUISetBkColor(0xB4FFFF)
   GUISetState(@SW_SHOW)
   Global $hTab_WinAttacksChild = GUICreate("", 150, 85, -151, 340, $WS_POPUP, $WS_EX_MDICHILD, $BuildSpellbookGUI)
   Global $Label1xv = GuiCtrlCreateButton("Attacks", 10, 10, 120, 70, $SS_CENTER)
   GUICtrlSetOnEvent (-1, "ButtonAtt")
   GUISetBkColor(0xA7FFFF)
   GUISetState(@SW_SHOW)
   Global $hTab_WinEnchantmentsChild = GUICreate("", 150, 85, -151, 425, $WS_POPUP, $WS_EX_MDICHILD, $BuildSpellbookGUI)
   Global $Label1xa = GuiCtrlCreateButton("Enchantments", 10, 10, 120, 70, $SS_CENTER)
   GUICtrlSetOnEvent (-1, "ButtonEnc")
   GUISetBkColor(0xA9FFFF)
   GUISetState(@SW_SHOW)
   Global $hTab_WinEquipmentChild = GUICreate("", 150, 85, -151, 510, $WS_POPUP, $WS_EX_MDICHILD, $BuildSpellbookGUI)
   Global $Label1xs = GuiCtrlCreateButton("Equipment", 10, 10, 120, 70, $SS_CENTER)
   GUICtrlSetOnEvent (-1, "ButtonEqui")
   GUISetBkColor(0xA9FFFF)
   GUISetState(@SW_SHOW)
   Global $hTab_ChosenSpellsChild = GUICreate("", 150, 85, -151, 595, $WS_POPUP, $WS_EX_MDICHILD, $BuildSpellbookGUI)
   Global $Label1xs = GuiCtrlCreateButton("Show My Spellbook", 10, 10, 120, 70, $SS_CENTER)
   GUICtrlSetOnEvent (-1, "ShowMySpellsButton")
   GUISetBkColor(0xA9FFFF)
   GUISetState(@SW_SHOW)


   $Child2 = GUICreate("", 239, 80, 860, 50, $WS_POPUP, $WS_EX_MDICHILD, $BuildSpellbookGUI)
   GUISetFont(17, 700, 3, "Times New Roman")
   GUISetState(@SW_SHOW)
   GUISetBkColor(0xD9FFFF)
   $Label_12 = GuiCtrlCreateLabel($HumanMage1String, 10, 5, 239, 30, $SS_CENTER)
   GUISetFont(12, 700, 0, "Times New Roman")
   Global $Label1 = GuiCtrlCreateLabel("Total Point Count:"&$DynamicLabel21, 10, 35, 239, 60, $SS_CENTER)

   $Child3 = GUICreate("", 239, 300, 860, 130, $WS_POPUP, $WS_EX_MDICHILD, $BuildSpellbookGUI)
   $Pic_7 = GuiCtrlCreatePic($HumanMage1, 0, 0, 239, 300,-1)
   GUISetState(@SW_SHOW)
   GUISetBkColor(0xE0FFFF)

   $Child4 = GUICreate("", 239, 100, 860, 430, $WS_POPUP, $WS_EX_MDICHILD, $BuildSpellbookGUI)
   GUISetFont(14, 800, 0, "Times New Roman")
   $Labelsearch = GuiCtrlCreateLabel("Search for Spell:", 15, 25, 150, 25, $SS_CENTER)
   GUISetFont(11, 500, 0, "Times New Roman")
   Global $Button_Enter = GUICtrlCreateButton("ok", 15, 50, 60, 25, $BS_DEFPUSHBUTTON)
   GUICtrlSetOnEvent (-1, "ButtonSearch")
   GUICtrlSetState($Button_Enter,$GUI_HIDE)
   Global $Input1 = GUICtrlCreateInput("", 15, 50, 150, 21)
   GUISetState(@SW_SHOW)
   GUISetBkColor(0xA9FFFF)
   $Child5 = GUICreate("", 239, 300, 860, 530, $WS_POPUP, $WS_EX_MDICHILD, $BuildSpellbookGUI)
   GUISetState(@SW_SHOW)
   GUISetBkColor(0xA9FFFF)
   GUISetFont(14, 800, 0, "Times New Roman")
   Global $LabelSound = GuiCtrlCreateLabel("Sound:", 0, 25, 239, 25, $SS_CENTER)
   Global $LabelFilter = GuiCtrlCreateLabel("Filters:", 0, 85, 239, 25, $SS_CENTER)
   GUISetFont(11, 500, 0, "Times New Roman")
   Global $Button_SoundOff = GUICtrlCreateButton("Off", 57, 50, 60, 25, -1)
   GUICtrlSetOnEvent (-1, "ButtonSoundOff")
   Global $Button_SoundOn = GUICtrlCreateButton("On", 122, 50, 60, 25, -1)
   GUICtrlSetOnEvent (-1, "ButtonSoundOn")
   Global $Button_Air = GUICtrlCreateButton("Air", 15, 120, 40, 25, -1)
   GUICtrlSetOnEvent (-1, "Air")
   Global $Button_Water = GUICtrlCreateButton("Water", 56, 120, 40, 25, -1)
   GUICtrlSetOnEvent (-1, "Water")
   Global $Button_Arcane = GUICtrlCreateButton("Arcane", 97, 120, 40, 25, -1)
   GUICtrlSetOnEvent (-1, "Arcane")
   Global $Button_Earth = GUICtrlCreateButton("Earth", 138, 120, 40, 25, -1)
   GUICtrlSetOnEvent (-1, "Earth")
   Global $Button_Fire = GUICtrlCreateButton("Fire", 179, 120, 40, 25, -1)
   GUICtrlSetOnEvent (-1, "Fire")
   Global $Button_Holy = GUICtrlCreateButton("Holy", 15, 150, 40, 25, -1)
   GUICtrlSetOnEvent (-1, "Holy")
   Global $Button_Dark = GUICtrlCreateButton("Dark", 56, 150, 40, 25, -1)
   GUICtrlSetOnEvent (-1, "Dark")
   Global $Button_Nature = GUICtrlCreateButton("Nature", 97, 150, 40, 25, -1)
   GUICtrlSetOnEvent (-1, "Nature")
   Global $Button_War = GUICtrlCreateButton("War", 138, 150, 40, 25, -1)
   GUICtrlSetOnEvent (-1, "War")
   Global $Button_Mind = GUICtrlCreateButton("Mind", 179, 150, 40, 25, -1)
   GUICtrlSetOnEvent (-1, "Mind")
   Global $Button_Mind = GUICtrlCreateButton("Export Spell List", 69, 220, 100, 35, -1)
   GUICtrlSetOnEvent (-1, "Export_Spell_List")



#EndRegion -Child GUIs-
   While 1
      If _SoundStatus($aSound) = "stopped" Then _SoundPlay($aSound)
   Sleep(100)

   WEnd

Opt("GUIOnEventMode", 0)
EndFunc

Hey Big Daddy,

Didnt know if my script would be too ugly to be helpful  heres the func.

 

edit-

I can add the exe with all the resources fileinstalled if you really wanted to recreate it.

Edited by Flaccid_Jack

Share this post


Link to post
Share on other sites

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...