I've some Winform App which controls over some COMobject (start record and stop record)
When I'm launching the winform app, I actually start recording by uisng COMobject.
The problem is how to stop the record (closing Winform app where on close event I'll stop record).
So how do I fire this event ? I was thinking to kill the WinForm app, but it seems not to be working...
any ideas ?
Thanks
Related
I have a Winforms app and usually when a user runs an app the UI of the app visible only, but if you set in settings open as Console app, as a result, each time when the app will be opened the terminal will be opened as well (BTW I need this option to be enabled in my case).
Problem is that I have a logic in Closing form event and it works well if a user closes the app by clicking on the cross at the top of the app window, but if they close the app by click cross on the terminal window the app doesn't get any closing events. It just terminates the app process.
So, the question is - is there a way to catch the closing event if the user tries to close the app through the closing terminal instead of closing the app?
Is there a way to restart my Codename One app when it comes to foreground after putting it to background?
I would like to restart it as if I close and open again app, also if I have only putted it in background without closing it.
Thank you
When you come back from background start() is invoked again (but not init(Object)) you can just show the first Form whenever that is invoked.
I would suggest using some special logic there as you might not want to do that if you went to the background for a couple of seconds only but that depends on your app type...
In our WPF application We open one window for authentication as showdialog and set owner as Mainwindow. After authentication we open another window as showdialog and set owner as Mainwindow then close the previous window using coding. When close the second window manually, the focus changed automatically to some other applications. Any help on this is highly appreciated.
Thanks
To avoid all trouble with MessageBox class, always show message box from dispatcher thread and set it's owner window properly.
MessageBox class uses Win32 api with the same name, and it should not be called from background threads.
In this case, simple Dispatcher.Invoke call will fix the issue.
First things first, this problem only happens while working in Citrix XenApp seamless mode (which, in simplest of words means the actual app is running on some citrix host but it is simulated as residing in your own desktop). I will take this up with Citrix Support as well but just wanted to poll the group in case someone faced a problem like this before.
I have a WPF app which uses Winforms NotifyIcon to reside in system tray until mouse clicked. In Citrix seamless mode, as user clicks the icon in system tray, the popup flashes and immediately closes on its own.
The Popup window is a vanilla one created with StaysOpen as FALSE and same works in every other environment.
Any suggestions ? This is what I've noticed so far:
The window stays open if I use StaysOpen as true. But then I don't have a way to close the window manually when it loses focus. LostFocus Event doesn't get fired on popup when user clicks outside.
In citrix seamless mode, the MouseEnter event is captured but MouseLeave is NOT so the approach of closing the window if user mouse is outside the window for X secs is not achievable.
Tried the workaround of starting the popup with Staysopen as FALSE and then reset staysopen after like 2 secs so that the pop sticks. It works but a soon as I set StaysOpen as FALSE once the timer is hit, the pop up closes on its own.
Without all these workarounds, if a user quickly clicks (leftclick) on the window before it disappears, the pop up sticks so I tried few ways to simulate the mouse click on the popup as it opens up but that doesn't cut it either.
Thanks
I can't help you with specific advice for tweaking your app to work around the issue, however there is always the hit it very hard with a hammer approach, i.e. tell consumers of your app to disable seamless for your application:
http://support.citrix.com/article/CTX116357/
Update: I pinged the original seamless dev - he said it sounds like a bug where seamless is not correctly routing all the necessary mouse messages between client and server. He said the best way to diagnose this was to run the Spy++ tool on the XenApp server and on the client, and then compare the messages each side sees to identify what messages are not getting translated. Since it sounds like a genuine bug, your best bet is to raise a support ticket with Citrix support and provide them with a sample app that can repro the bug.
I have a hopefully trivial question. Currently, my company works with a rather obscure language (SyngergyDE) and we need to call a SilverLight application inside our product. Unfortunately, this obscure 3rd party language only (currently) supports the opening of WPF screens. So with that said, I thought I'd develop a small WPF user control that contains a "WebBrowser" control and navigate to the silverlight application's URI. This works fine, and I'm able to see the SL application. Here is my question - we have a "Close" button on the SL application, and when users "Click" that button, we want the window to close.
Does anyone have any suggestions on how we can communicate the "Closing of the SL App" to the WPF user control, so that the entire WPF user control closes as well?
Thanks everyone,
-Tom
Attach an event handler to the WebBrowser.Navigated event.
Have the close button in the Silverlight application use:-
HtmlPage.Window.Navigate(new Uri("about:blank", UriKind.Absolute));
When the Navigated event fires in WPF with the url "about:blank" then its time to close the control.
Use Javascript and the HTML DOM as the glue here.
For example, when the SL app close button is clicked, have Silverlight trigger some Javascript code that sets a flag, or alternately, raises some HTML document event.
The WPF control could poll that flag in the HTML + Javascript, or alternately listen for that HTML document event, then close the user control.