I need to disable a button from a third-party winforms application.
I got the buttons handle using Windows API and WinSpy++, and i have no problem disabling it.
That button is in a DialogBox control. My application is also a winforms app.
How can i be notified when the dialog box appear, so i can disable that button?
Is there an event that can fire when it appears or any workaround?
Thanks guys!
Related
I want to capture event when form in windows application using c# library
when application switches its page by clicking on next button or search buttons or any other means
Edit
I want to capture events generated by control tabs from library.
Please refer this link,,It shows events that is generated by control tabs.
https://msdn.microsoft.com/en-us/library/system.windows.forms.tabcontrol.selected(v=vs.110).aspx
You probably want to capture the Deactivated event of the Window.
I'm trying to programmaticly (from my own application) press a button that is located on another running windows (WPF) application.
Todo so, a handle to the button would be needed. There are plenty of posts about how to get such a handle.
However, it seem that WPF applications don't present handles for their graphical components:
https://www.experts-exchange.com/questions/25665615/Spy-or-Windows-Api-Functions-not-locating-controls-on-child-window.html
Any clues on how to achieve an automated press on a button in such an application?
I don't have control of the source code for the application with the button.
I believe you'll need to look into UI Automation https://learn.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-overview
i have application with one form, which i developed in c#. I would like to hide the form when a user clicks somewhere else then on the form or on the notification icon (in system tray). How could i do that?
I am not 100% sure you can do it with the standard event exposed by Visual Studio in the designer but if you could attach to the DeActivate event, or form lost focus, then you can call form.Hide
What are the ways to restrict the User to click a button more than once in Windows c# application ? I dont want them to click more than once, which leads to a problem.
Can i change the make the cursor invisible after clicking once or any cother can be done ?
Disable the button on the click event. No more click events will be generated.
(best option) Fix your code so there's no problem.
Disable the button when you get the first click event.
I created a usercontrol in c#, Leave and LostFocus are not fired if I switch to another program. How can I detect if the app loses focus?
Try your mainform's Deactivate event
If you switch to a differnt app, your custom control DIDN'T lose focus. At least not within the app it is in.
If you come back to your app, such as hitting it on the taskbar (and not by clicking on another control on the same app), your control will still have "focus".
This is where Form.Deactivate comes in handy.