How can Windows Sidebar Gadget communicate with my desktop app? - windows

I've got a .NET 2.0 Windows desktop application (time-sheets) which i develop and wanted to add a Gadget interface to it (so that app runs hidden and is controlled via the gadget).
What is the easiest way to get my gadget to communicate to my app?
An idea that i had was to have a built-in web server inside the app, and the gadget controls communicates with the app using ajax. However i'm hoping there's a simpler solution.

You didn't specify what technology the gadget and app were written with, so it's hard to answer. Assuming you can use .NET, WCF with a named-pipes binding would be very simple. Just a few lines of code to set it up.

We use win32 APIs in one of our gadgets' ActiveX control to communicate with other instances of the same gadget. Unfortunately, I can't give you the code (because I don't have permission and I don't write the .net stuff) but it boils down to using a window (in your case the application window) as a server and the gadget ActiveX control as the client and use the SendMessage function.
You can see an example of using COM interop with windows desktop gadgets at http://www.codeproject.com/KB/gadgets/GadgetInterop.aspx
NB: make sure the interop assembly is in the application's directory and NOT the gadget directory, otherwise you'll run into problems when updating/uninstalling the gadget.

Related

Access desktop application UI

This will be OS dependant so here goes:
Windows 7/8/10
I'd like to be able to access a desktop application UI from another application (that I've written).
I'd like to be able to simply pass some mouse and keyboard inputs from my application to the external one.
Is this possible and if so, where do I start? Is there some Windows API that I can do this with?
I know I can use the Microsoft detours API to hook into Direct3D applications/games, but not sure about regular desktop applications.

Wrapper around web-app under Windows

I have an application with web interface. Unfortunately, it has all disadvantages of being a web page:
It doesn't have a standalone window, so users cannot manage it via the taskbar.
Users see the address line with something like 'http://localhost:8080' that is not a good idea for home users.
If users click on a tray icon, there is no way to activate the tab in a browser, which contain the application interface.
So, it would be nice to have a wrapper application with a browser within.
In case of IE I know it's possible to create a window with Trident ActiveX component. But what if it's Windows XP with IE6 but installed latest Chrome? I'd like to prefer Chrome since it supports a lot more features which the user will never see.
So, is there a way to wrap a page into Chrome/Firefox and make it look like a standalone application, if one of them is presented in the user's system? (The application shouldn't install anything large, so Chromium build is not an option).
P.S. I'm not interested in supporting other platforms than Windows.
Regards,
Take a look at Chrome Apps.
I hope helps you.

Where can I start creating a Windows application?

I want to create an application to run on a Windows 7 PC with a touch screen that is a sort of toolbox with large icons optimized for touch screens.
I need it to include a file browser with a hard coded path. That way I can auto launch the application and they will be taken to the folder right away. I would also like a section where I can put "Useful Applications" shortcuts so that they do not have to go through the start menu or the desktop.
Can someone guide me where I can start learning how I can do this? I would most likely code in C#
Get started with Windows Runtime apps. You can write a Windows Runtime app in a variety of languages, such as C# or C++ with XAML, C++ with DirectX, and JavaScript with HTML/CSS. Now you can easily create apps for Windows devices and Windows Phone from a single project.
https://dev.windows.com/en-us/getstarted

How to restrict external application accessing my windows application

We have a windows application created using Visual Basic 6.0.
An external application accesses the controls and data present in the forms (screens) of our VB application and prompts validation messages to the user. We assume that the external application is using the 'FindWindow', 'FindWindowEx' API functions present in the user32.dll to access our application using the logic as explained in the following link.
Get Text From Specific Textboxes From External Application - Visual Basic .Net
Is it possible to restrict the external applications from accessing the controls and data present in the forms (screens) of our VB application? Is there any method to restrict this anonymous access?
Thanks in Advance.
Thanks,
Sujatha.
One of the easiest ways to fend off hijackers is to substitute controls from How To Install the Microsoft Windowless Controls for VB6 for many of the intrinsic controls.
This simple step thwarts a lot of the parasites.
Your program hands the text over. The VB6 forms package is doing it for you. Subclass the window and kill the GetText message. See https://www.google.com.au/search?q=vb6+subclass+form.

Win32 Console application or CLR -->windows form application?

I have to have a form as a gui,but i also need to write using win32 API as i need to create another process the moment the application is launched...
I created Win32 console-->empty project..then there was an option to add windows form as UI...Is it possible????...as i have chosen the base project to be win32 console application.
But i really need the form in the application.
C++/CLI is perfectly able to show a Windows Form in a console program, just as a windows console program is perfectly allowed to call CreateWindow. However, if you choose console as the output file mode then the console window is still going to show up to your user in addition to whatever forms you create.
You don't need to use the bare Windows API to create processes. See System.Diagnostics.Process.

Resources