MadBoy Posted November 20, 2006 Share Posted November 20, 2006 I have this little problem. It's a part of application and not standalone working but it should be enough. What it does: Application stays in the background after TCP connection. It awaits for any incoming call from server that my application is connected to. When it receives any data it is supposed to show GUI Window on my screen with BUTTON called "SEND" and send specially prepared line back to server (or not send if i press escape). It works preety great but to moment you press Enter or Space or click on the button once. If application will lag for a moment and you press that button twice it seems like it waits till GUI Window shows up again and then it doesn't wait for you to click on the button but does it automagically which is not what i want!!! Any help guys? While 1 $tcp_receive_data = TCPRecv($pci_connection, 2048) If $tcp_receive_data <> "" Then $macro_start = TimerInit() $tcp_receive_data = StringStripWS($tcp_receive_data, 8) GUICtrlSetData($label[1], $tcp_receive_data) GUISetState(@SW_SHOW, $GUISend) WinSetOnTop($GUISend, "", 1) $macro_time = TimerDiff($macro_start) If $balloon_tip = "Yes" Then TrayTip("Information:", $tcp_receive_data, 5, 1) $time = TimerInit(); start timer Do $msg[1] = GUIGetMsg() Select Case $msg[1] = $GUI_EVENT_CLOSE GUISetState(@SW_HIDE, $GUISend) ExitLoop Case $msg[1] = $button[1] $status = TCPSend($pci_connection, $tcp_command & " " & $tcp_receive_data) GUISetState(@SW_HIDE, $GUISend) ExitLoop EndSelect Until TimerDiff($time) > 8000; check timeout $macro_time = Round($macro_time, 4) sleep(100) Wend MadBoy " My little company: Evotec (PL version: Evotec) 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