Nemcija Posted July 29, 2008 Share Posted July 29, 2008 Hello. I'm working on a bigger network project written in au3 with much datatransfers and security stuff bla, thats the reason why i'm not posting the script here. (passwords, etc.) If i remove that this script wouldn't make sense und it wouldn't work so i try to describe my problem. The Userinterface is controlled in Eventmode (GUIOnEventMode 1) and additional by an adlib function. Func _Runtime() Global $GUI_Handle $GUI_Msg = GUIGetMsg(0) Select Case $GUI_Msg = $GUI_EVENT_CLOSE _GUI_Close() EndSelect $aCursorInfo = GUIGetCursorInfo($GUI_Handle) #region movingwindow ;[... not the problem ...] #endregion movingwindow If IsArray($aCursorInfo) Then #region buttons Global $GUI_Btn_Close, $GUI_Btn_Addons If _Runtime_Button($GUI_Btn_Close, $aCursorInfo) Then _GUI_Close() ElseIf _Runtime_Button($GUI_Btn_Addons, $aCursorInfo) Then _GUI_AddOns() EndIf #endregion buttons EndIf EndFunc _Runtime_Button is an extra buttonruntime for graphical buttons. It creates some graphical effects and returns whether the button was pressed this time or not. But thats also not the problem. _GUI_AddOns creates a new modal gui, where you can do some settings. And there is the problem. By opening this gui and its runtimeroutine (GUIOnEventMode 0) the program sometimes - not always / seems like random - breaks down and i have to stop it by task manager. I've tested and researched for that problem many hours. It only occurs if i use GUIRegisterMsg (for the whole ui) and GUIGetCursorInfo (in buttonruntime) together. If one of that isn't used everything works fine. If i only use GUIGetCursorInfo it works. If i only use GUIRegisterMsg it works. But i need both to realise some features. I think it is an autoit internal problem because, i absolutly don't know why it happens and because this problem occurs not regular but rather randomly. P.S: Please don't kill me for my english ^^ Thank you for helping Nemcija Attachment: How the result looks like [url=www.vergessene-welt.de][/url] Link to comment Share on other sites More sharing options...
smashly Posted July 29, 2008 Share Posted July 29, 2008 Hi, not sure if it's related to your problem... You say your gui is GUIOnEventMode 1, but in the function you post your using $GUI_Msg = GUIGetMsg(0). You can only use one or the other .. not both. Cheers Link to comment Share on other sites More sharing options...
Nemcija Posted July 29, 2008 Author Share Posted July 29, 2008 this is there because there is an other programpart where it is used with GUIOnEventMode 0 i know it isn't good to mix that up but at least it works in that way (less code) [url=www.vergessene-welt.de][/url] Link to comment Share on other sites More sharing options...
smashly Posted July 29, 2008 Share Posted July 29, 2008 I still think your problems are coming from the mix of GUIOnEventMode 1 and GUIGetMsg(0).The script is one or the other not both in the one script.Without seeing the rest of your code I think you'll be tackling this problem alone for the moment. Best of luck cheers. Link to comment Share on other sites More sharing options...
Nemcija Posted July 29, 2008 Author Share Posted July 29, 2008 (edited) Even without it, this "error" occurs. edit: Now I've rewritten all parts with GUIGetMsg and replaced it by GUICtrlSetOnEvent(-1,"GUIa_Btn*") It also works but this error occurs also randomly in that way i've discribed it. Edited July 29, 2008 by Nemcija [url=www.vergessene-welt.de][/url] Link to comment Share on other sites More sharing options...
BrettF Posted July 29, 2008 Share Posted July 29, 2008 Your FULL code will help a lot here.... We cannot magically fix it, without seeing everything.... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Nemcija Posted July 29, 2008 Author Share Posted July 29, 2008 (edited) sorry the full code is about some thousand lines with passwords and more But sorry i try to show you what you need: expandcollapse popupGlobal $GUIa_Active = 0 Global $GUIa_List_Server GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") Func _GUI_AddOns() AdlibDisable() Global $TMPa_AddonListe Global $CFG_TempDir,$CFG_MaxTries, $VAR_AviableAddonsB, $CFG_IniFile Global $GUIa_Handle,$GUI_Handle, $GUIa_Active, $GUIa_Btn_Close, $GUIa_List_Server, $GUIa_List_Client $GUIa_Title = "AddOns" $GUIa_Width = 655 $GUIa_Height = 325 $GUIa_Active = 1 $GUIa_Handle = GUICreate($GUIa_Title,$GUIa_Width,$GUIa_Height) $GUIa_Label_va = GUICtrlCreateGroup("Verfügbare Addons",5,5,300,288) $GUIa_List_Server = GUICtrlCreateCombo("Lade Liste ...", 15, 25, 280, 270, BitOR($CBS_SIMPLE, $CBS_DISABLENOSCROLL, $WS_VSCROLL)) GUICtrlSetState(-1,$GUI_DISABLE) GUICtrlCreateGroup("",-99,-99,1,1) $GUIa_Btn_Add = GUICtrlCreateButton("+",312,25,30,30) GUICtrlSetState(-1,$GUI_DISABLE) GUICtrlSetFont(-1,16,1000) GUICtrlSetColor(-1,0x00ff00) GUICtrlSetOnEvent(-1,"GUIa_BtnAdd") $GUIa_Btn_Remove = GUICtrlCreateButton("-",312,60,30,30) GUICtrlSetState(-1,$GUI_DISABLE) GUICtrlSetFont(-1,16,1000) GUICtrlSetColor(-1,0xff0000) GUICtrlSetOnEvent(-1,"GUIa_BtnRemove") $GUIa_Label_va = GUICtrlCreateGroup("Ausgewählte Addons",350,5,300,288) $GUIa_List_Client = GUICtrlCreateList("", 360, 25, 280, 265) GUICtrlSetState(-1,$GUI_DISABLE) GUICtrlCreateGroup("",-99,-99,1,1) $GUIa_Btn_Close = GUICtrlCreateButton("Schließen",$GUIa_Width-105,$GUIa_Height-25,100,20) GUICtrlSetOnEvent(-1,"GUIa_Close") GUISetState(@SW_SHOW,$GUIa_Handle) ;~ ;<Get list> ;[... Transfer bla bla ...] ;~ ;</Get list> If $GUIa_Active = 1 Then _GUIa_GetServerList() _GUIa_GetClientList() GUICtrlSetState($GUIa_List_Server,$GUI_ENABLE) GUICtrlSetState($GUIa_List_Client,$GUI_ENABLE) GUICtrlSetState($GUIa_Btn_Add,$GUI_ENABLE) GUICtrlSetState($GUIa_Btn_Remove,$GUI_ENABLE) EndIf While $GUIa_Active = 1 If WinActive($GUI_Handle) Then WinActivate($GUIa_Handle) Sleep(100) WEnd GUIDelete($GUIa_Handle) AdlibEnable("_Runtime",50) EndFunc Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $hWndCombo If Not IsHWnd($GUIa_List_Server) Then $hWndCombo = GUICtrlGetHandle($GUIa_List_Server) $hWndFrom = $ilParam $iIDFrom = BitAND($iwParam, 0xFFFF) $iCode = BitShift($iwParam, 16) Switch $hWndFrom Case $GUIa_List_Server, $hWndCombo Switch $iCode Case $CBN_EDITCHANGE _GUICtrlComboBox_AutoComplete($GUIa_List_Server) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc I hope it helps you understanding the problem. Thank you Edited July 29, 2008 by Nemcija [url=www.vergessene-welt.de][/url] Link to comment Share on other sites More sharing options...
Nemcija Posted July 29, 2008 Author Share Posted July 29, 2008 Uhm... maybe i should try it in an other way. is there any possibility to replace that what i'm doing by GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") by something similar? Nemcija [url=www.vergessene-welt.de][/url] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now