How to detect a rightclick in an application - c#

my objective is to attach a context menu (vista and win7) whenever user right clicks a picture/file.
I've got the file portion down (ie, they right click on a file and my menu shows up) but I am having trouble understanding what I would need to do in terms of right clicking in firefox or ie .
I am trying to add a context menu whenever someone right clicks on an image file in IE or firefox. is that possible?

If you want to plug in to what happens inside the user's browser, you should probably write a browser extension to do that, instead of trying to hack up something awful that sort of does what you want maybe.

The best solution would be to develop a plug-in for the browser used by your user, whether it be for Internet Explorer, FireFox or Chrome etc..
Trying to create some sort of hack will only lead to a bad experience for your user so it's better to develop something that would work properly.
Here's a few links to get you going in the right direction:
Google Chrome: http://www.mattcutts.com/blog/write-chrome-extension/
Mozilla FireFox: https://developer.mozilla.org/en/Gecko_Plugin_API_Reference/Plug-in_Development_Overview
(I can't seem to find any for Internet Explorer)
I'm sorry i cannot give you a definitive answer but hopefully this should get the ball rolling for you at least.

is that possible?
NO
For Browsers: You need to develop an extension for each browser you want to support
For Desktop: http://www.codeproject.com/KB/cs/dateparser.aspx (ignore all the stupid istruction about how to catch the datetime )

Related

C# Selenium how to interact with chrome extension

I have successfully loaded my chrome profile with selenium that has pre-installed extensions.
The extension in question is called Private Internet Access, but i have tried others and cannot communicate with them
I am trying to figure out how i can open the extension below and enter username&password and click login button. I have tried finding the elements in by id and class but it doesnt find them. Can someone point me down the right line for this. Thanks
I've not had the ability to try this - however I've done a lot of work with Selenium and I've created my own chrome extension.
That extension popup in the top right actually a different web page. You won't be able to interact with it due to how it's presented, but you can navigate to it.
Try this:
Open up your extension, right click anywhere and select Inspect. This will open up devtools for the popup.
In devtools, go to the console and type document.url. This will give you the URL of that popup page. (you'll also see it at the top of the title bar)
That gibberish-looking bit in the middle doesn't change - it's your chrome extension identifier. From when I created my extension and 18 months worth of updates (including migrating from chrome extension manifest v2 to v3) it has not changed for me. I think you'll be safe to use it.
Go to that URL to make sure it works. In my case it's chrome-extension://ojhcleddagaoaplflbafhpekcciikdop/popup.html
You'll notice you'll lose some of the page styling compared to the popup. When you design the popup you give it fixed dimensions - when you open it as a normal webpage, you lose that and everything gets stretched.
Finally - for your automation - put that chrome-extension:\\ url as the first step in your selenium script and do your sign in. Then, carry on with the rest of your test.

Can we use Windows UI Automation API to automate web page in Internet Explorer?

We have a web application and we want to use Windows Native UI Automation API for .Net to automate that.
I've been looking into this for hours, but couldn't find anything. I can get to the windows parts of the internet explorer, like menu, minimize button, maximize button, close button etc but not able to go inside the page opened. I am wondering if it is possible at all. If it is, then can someone please point me to the right direction?
Thanks!
I ended up using WatiN along with Windows Automation API. Thanks everyone who showed interest in this. Appreciate it.

How to set location of IE toolbar created using BHO and Band Objects

I had to create a Toolbar for IE using C#. After much research in the internet and few examples from code project, I have created one. Even the horrible installer/uninstaller part is done. My toolbar basically Searchbar which does a search of the things that the user enter inside the text box. Im using Google and Bing as the search engine of which the user can choose anyone as per his/her convinience. However I would like to make few changes to the Toolbar and I'm wondering how to go ahead in that.
After installing the toolbar I'm finding it somewhere near the MenuBar(after the Tools and Help menu). Is there a way to change the location of the toolbar in IE Browser using C#
I would like to create an Icon somewhere in this area
How should i approach towards this?
I also want to add an uninstall button on which when the user clicks will uninstall the toolbar from IE.
So far I havent been able to achieve any of this. Any help would be really appreciated.

How to disable silverlight in IE webdriver?

Here is what I got:
an upload button, which works through silverlight if it is installed, or through html5 if there is no silverlight. So, I have 2 browsers to test: Chrome and IE. I did common uploading by sending keys to input element and it works good in chrome, but when it comes to IE - it is trying to use silverlight.
My question is how to disable silverlight or maybe there are some workarounds?
I found out that it is an add-on, so if somebody knows how to disable add-ons or launch iedriver with switches, please, let me know.
I looked through many documents about webdriver and it seem to be no way to disable add-ons or add switches for now. I hope this will save somebody's else time.

Disable other software besides Chrome

I need to write a program that forces Google Chrome to be in the front and disable all other actions like opening another program etc... I just need to have Google Chrome in front of the screen and that's all. I can't allow other programs to pop up.
Any ideas how it can be done?
Thank you!
Im pretty sure as far as you can get is a popup window that has no scrollbar or top bar, and can't be resized, but JS wont let you manipulate stuff outside the current window, just like you cant auto-click links inside an iframe
I highly doubt this is possible in Windows, and if it is it won't be ethical if used on home PCs. Will this be a kiosk style app?
You can control what appears in the browser to some extent, such as scrollbar-less windows but much more than that is impossible.
Definitely not ethical at all but applications such as Fortress 101 can do this. I have done similar things in the past using C and the Win32 API. I won't write the code for you but I basically did the following:
Find the desktop and hide it
Find and hide the taskbar
Find and destroy the start button
Capture special keypresses and prevent them from working as expected
You would also need to poll a process list because even doing all of that doesn't prevent the user from downloading a file and executing it. Thus if you found a new application in the process list, you could destroy it.
You could do this using user32.dll with C# but such an application would better be left to commercial software packages.

Categories

Resources