Jump to content

Creating a new GUI screws up old GUI


Insolence
 Share

Recommended Posts

When my program loads up a module (seperate .exe) the first module becomes unusuable until the 2nd one is closed.

Why is this?

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

Oh sorry, I didn't realize more info was needed... here's the two GUI's:

$GUI = GuiCreate("iPFU Interface", 450, 200, 0, 0, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE)
GuiSetOnEvent($GUI_EVENT_CLOSE, "Close")

GUISetFont (8, 400, -1, "Verdana")

  ; ----------------------------------------------------------------------------
  ; Creating menu's
  ; ----------------------------------------------------------------------------
$helpmenu = GUICtrlCreateMenu ("Help")
$aboutitem = GUICtrlCreateMenuitem ("About",$helpmenu)
GUICtrlSetOnEvent(-1, "_DisplayLicense")

  ; ----------------------------------------------------------------------------
  ; Tabs
  ; ----------------------------------------------------------------------------
$tab = GUICtrlCreateTab ( -1, 0, 455, 200 )

DIM $TabItem[2]

_ArrayAdd($TabItem, GUICtrlCreateTabitem ("Modules"))
   GUICtrlCreateLabel ("Module(s):", 5, 25)
   $ModuleList = GUICtrlCreateList ( "", 5, 38, 200, 120 )
   GUICtrlSetOnEvent(-1, "_DisplayDescription")
   GUICtrlSetLimit(-1,200)
   
   GUICtrlCreateGroup ("Description", 208, 25, 240, 155)
   
   $LoadModule = GUICtrlCreateButton ("Load", 5, 150, 75)
   GUICtrlSetOnEvent(-1, "_LoadModule")
   $UnloadModule = GUICtrlCreateButton ("Unload", 80, 150)
   GUICtrlSetOnEvent(-1, "_UnloadModule")
   $AddModule = GUICtrlCreateButton ("Add", 127, 150, 75)
   GUICtrlSetOnEvent(-1, "_GetModulePath")
   
   $DescriptionLabel = GUICtrlCreateLabel ( "", 212, 40, 230, 130)
   
_ArrayAdd($TabItem, GUICtrlCreateTabitem ("Configuration"))   
   GUICtrlCreateLabel ("Username", 5, 25)
   $Username = GUICtrlCreateInput ( "", 70, 23, 150, 17)
   GUICtrlSetData(-1,_ReadConfig( $iPFUIni, "Username"))
   
   GUICtrlCreateLabel ("Password", 5, 46)
   $Password = GUICtrlCreateInput ( "", 70, 44, 150, 17, $ES_PASSWORD)
   GUICtrlSetData(-1,_ReadConfig( $iPFUIni, "Password"))
   
   GUICtrlCreateLabel ("Character", 5, 75)
   $Position = GUICtrlCreateCombo ( "1", 70, 73, 35, 17)
   GUICtrlSetData(-1,"2|3|4|5|6|7|8", _ReadConfig( $iPFUIni, "Character", "1"))
   
   GUICtrlCreateLabel ("Realm", 5, 96)
   $Realm = GUICtrlCreateCombo  ( "USWest", 70, 94, 75, 17)
   GUICtrlSetData(-1,"USEast|Europe", _ReadConfig( $iPFUIni, "Realm", "USEast"))
   
   GUICtrlCreateLabel ("Diablo.exe Path", 5, 130)
   $Path = GUICtrlCreateInput ( "", 100, 128, 250, 17)
   GUICtrlSetData(-1, _ReadConfig( $iPFUIni, "Path", "C:\Program Files\Diablo II\Diablo II.exe"))
   $GetPath = GUICtrlCreateButton ("Browse...", 355, 128, 60, 17)
   GUICtrlSetOnEvent(-1, "_GetD2Path")
   
   GUICtrlCreateGroup ("Delays", 230, 20, 200, 90)
   GUICtrlCreateLabel ("Send Key", 235, 40)
   $SendKey = GUICtrlCreateInput ( "", 312, 38, 25, 17)
   GUICtrlSetData(-1, _ReadConfig( $iPFUIni, "Send Key", "15"))
   GUICtrlCreateLabel ("Mouse Click", 235, 61)
   $MouseClick = GUICtrlCreateInput ( "", 312, 59, 25, 17)
   GUICtrlSetData(-1, _ReadConfig( $iPFUIni, "Mouse Click", "10"))
   GUICtrlCreateLabel ("Mouse Down", 235, 82)
   $MouseDown = GUICtrlCreateInput ("", 312, 80, 25, 17)
   GUICtrlSetData(-1, _ReadConfig( $iPFUIni, "Mouse Down", "10"))
   
   $SaveConfig = GUICtrlCreateButton ("Save Config", 5, 150)
   GUICtrlSetOnEvent(-1, "_SaveDefault")
   
;_ArrayAdd($TabItem, GUICtrlCreateTabitem ("Statistics"))
  ;$Statistics = GUICtrlCreateEdit ( "", 5, 25, 440, 155 )

  ; ----------------------------------------------------------------------------
  ; Show GUI, Close GUI, request user to configure if they haven't
  ; ----------------------------------------------------------------------------
GuiSetState(@SW_SHOW)

If _ReadConfig( $iPFUIni, "Been configured") = "" Then
   _MsgBox( 4, "iPFU", "As this is the first time running the program, please configure it under the 'Configuration' tab.")
EndIf

While 1
   $Modules_Check = IniRead( @ScriptDir & "\modules.ini", "Modules", "updated", 1)

   If $Modules_Check = 1 Then
      $Modules = _IniSplit( @ScriptDir & "\modules.ini", "modules", "installed", "", "," )
      For $i = 1 to $Modules[0]
         GUICtrlSetData($ModuleList,$Modules[$i])
      Next
      
      IniWrite ( @ScriptDir & "\modules.ini", "Modules", "updated", 0)
   EndIf

   Sleep(100)   
WEnd

$GUI = GuiCreate("iSpam configuration", 450, 200, -1, -1, $WS_OVERLAPPEDWINDOW)
GuiSetOnEvent($GUI_EVENT_CLOSE, "_Close")

GUISetFont (8, 400, -1, "Verdana")

  ; ----------------------------------------------------------------------------
  ; GUI elements
  ; ----------------------------------------------------------------------------
GUICtrlCreateLabel ( "Note: This program must be started WHILE you're already logged in, after you've pressed the 'Enter Chat' button.  Assumes window title is Diablo II.", 5, 5, 440, 30 )

GUICtrlCreateGroup ("Settings", 5, 35, 440, 160)
   
GUICtrlCreateLabel ( "Message", 10, 50 )
$Spam = GUICtrlCreateInput ( _ReadConfig( $iSpamINI, "Spam"), 80, 48, 360, 17)

GUICtrlCreateLabel ( "Delay (ms)", 10, 71 )
$Delay = GUICtrlCreateInput ( _ReadConfig( $iSpamINI, "Delay", 5000), 80, 69, 40, 17)

GUICtrlCreateLabel ( "Begin:", 125, 71 )
$Begin = GUICtrlCreateInput ( _ReadConfig( $iSpamINI, "Begin", 1), 165, 69, 25, 17)
GUICtrlCreateLabel ( "End:", 200, 71 )
$End = GUICtrlCreateInput ( _ReadConfig( $iSpamINI, "End", 3), 227, 69, 25, 17)
GUICtrlCreateLabel ( "Loops:", 265, 71 )
$Loops = GUICtrlCreateInput ( _ReadConfig( $iSpamINI, "Loops", 5), 305, 69, 25, 17)

$ClearQueue=GUICtrlCreateCheckbox ( "Clear queue", 345, 68 ) 
GUICtrlSetState ( -1, _ReadConfig( $iSpamINI, "Clear Queue", $GUI_UNCHECKED) )

GUICtrlCreateLabel ( "Channels -- _REALM_ and _NUMBER_ will be replaced with a variable.", 10, 92 )

Global $LBS_NOTIFY = 0x1, $WS_VSCROLL = 0x200000, $WS_BORDER = 0x800000;
$listBoxStyle = BitOr($LBS_NOTIFY, $WS_VSCROLL, $WS_BORDER)

$ChannelList = GUICtrlCreateList ( "", 10, 110, 300, 100, $listBoxStyle)


GUICtrlSetLimit(-1,200)
GUICtrlSetData(-1,"LoD Trading _REALM_-_NUMBER_")
GUICtrlSetData(-1,"LoD Ladder Trading _REALM_-_NUMBER_")
GUICtrlSetData(-1,"LoD Hardcore Trading _REALM_-_NUMBER_")
GUICtrlSetData(-1,"LoD Barbarian Trading _REALM_-_NUMBER_")
GUICtrlSetData(-1,"LoD Amazon Trading _REALM_-_NUMBER_")
GUICtrlSetData(-1,"LoD Necromancer Trading _REALM_-_NUMBER_")
GUICtrlSetData(-1,"LoD Paladin Trading _REALM_-_NUMBER_")
GUICtrlSetData(-1,"LoD Druid Trading _REALM_-_NUMBER_")
GUICtrlSetData(-1,"LoD Assasin Trading _REALM_-_NUMBER_")
GUICtrlSetData(-1,"LoD Sorceress Trading _REALM_-_NUMBER_")

GUICtrlCreateButton ("Save Config", 320, 111, 114)
GUICtrlSetOnEvent(-1, "_SaveiSpamSettings")

GUICtrlCreateButton ("Add to queue", 320, 136, 114)
GUICtrlSetOnEvent(-1, "_AddChannelToQueue")

GUICtrlCreateButton ("Start", 320, 161, 57)
GUICtrlSetOnEvent(-1, "_Start")

$End = GUICtrlCreateButton ("End", 377, 161, 57)
GUICtrlSetOnEvent(-1, "_Stop")  
  ; ----------------------------------------------------------------------------
  ; End funcs/while loop
  ; ----------------------------------------------------------------------------
GuiSetState(@SW_SHOW)

Not the entire scripts but I think that'll be enough.

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

It was meant not to be possible for people like you and Insolense to understand.

Translation:

Well, typically, when module one cohabitates an instance with module two respective to it's execution, it deliniates it's access until the depletion of dynamic proliferation.

to

Under normal circunmstances, when one program launches another, it waits until the second is finished.

EDIT: I see no code in Insolence's last post that shows the gui launching another gui, or the gui launching another program. I really don't know where to begin looking for the error.

EDIT 2: I see this is also far lacking from the total amount of his script, or even the part that causes the error.

Edited by this-is-me
Who else would I be?
Link to comment
Share on other sites

Script is avaliable here: (maybe you want to run it or something?)

http://insolence9.com/iPFU/iPFU.zip

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

OH!

Thank you very much Larry, I'll try that :idiot:

I assumed you all didn't want to see all the code, kinda tedious to read it.

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

are you trying to make it run d2? if so could just use the path through the regedit much easyer here could try somthing like this

$Path = RegRead ('HKEY_CURRENT_USER\' & 'Software\Blizzard Entertainment\Diablo II', 'InstallPath')
$Exe = 'Diablo II.exe'

Run ( $Path & '\' & $Exe )
Link to comment
Share on other sites

No I fixed it... thanks.

That was not the problem, and your code would look a little cleaner like this IMO:

$Path = RegRead ('HKEY_CURRENT_USER\Software\Blizzard Entertainment\Diablo II', 'InstallPath')

Run ( $Path & "\Diablo II.exe")
Edited by Insolence
"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
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...