473,837 Members | 1,646 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

a "Global" application - is this possible?

I am currently working on a project that I am interested in porting to Win32
or .NET, but I don't know where to get started. I have quite a bit of
experience with MFC, and I have been working with C# for the last few months
and I feel like if I know where to start looking, I can do this.

The current app is for Mac OS X and is being built with Cocoa and
Objective-C. Bascially, it is a system service that allows users to paste
things to the system clipboard and then the service performs work on that
data. The service can be triggered easily by pressing a cntrl-shift-<key>

I have been reading the .NET 2.0 docs and the Win SDK for a couple of hours,
and I am not sure if what I want to do is possible in Windows though. The
best thing would be for the user to copy the data to the clipboard, and then
press a key-board combo to notify the service. It seems like I cannot do
this though, as the key events are specific to the WinForm in which they are
triggered. Is it possible to intercept these? Would this be considered a
security issue? If so, what could I do to achieve this type of functionality?

I would love for the user to be able to do copy some data from Internet
Explorer or any other third-party app, and then with a key-combo be able to
call my service to handle that copied data.

What is the proper way to attain this type of behavior in .NET or Win32?
Thank you for your time and help.
Mar 6 '06 #1
2 1276
> ... it is a system service that allows users to paste
things to the system clipboard and then the service performs work on that
data. The service can be triggered easily by pressing a cntrl-shift-<key>

First, I don't think you need a service. Your app reads user supplied data
on the clipboard which is meaningful only if a user is signed on. If that is
true, then an ordinary app that runs when a user signs on and quits when the
user signs off should suffice. This app does not need to present a gui to
the user - it just needs to be running.

Second, there are two general activation techniques like you described,
namely a global hot key and a global hook. Search for "global hot key"
and/or "SetWindowsHook Ex" for some info. I have no experience with either,
but global hot key looks promising. These are win32 items, and I'm unaware
of any support for them in .net (I use 1.1, maybe there is something in 2.0).

An alternative activation approach would be a tray icon program and the
mouse. The user would put something on the clipboard and then click an icon
typically in the lower right corner of his screen. The icon is tied to a
program of yours (what you have been calling a service), and the click is
enough to activate it (one click operation). If you need options, the click
could cause a short menu to pop up, and the user selects his option (two
click operation). There is support in .net for this kind of thing.

Mar 6 '06 #2
Thanks so much for the pointers, I will check hot the global hot key. You
are right it does not need to be a service, that would be a bit overkill.
Since the hot key is Win32, I guess I will switch to MFC/Win32 for this app.
Thanks again for the help!

Mar 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: mrbog | last post by:
I have an array/hash that stores path information for my app. As in, what directory this is in, what directory that's in, what the name of the site is, what the products are called, etc. It's called $glb. So, every function so far looks like this: function something() { global $glb; }
by: j | last post by:
Anyone here feel that "global variables" is misleading for variables whose scope is file scope? "global" seems to imply global visibility, while this isn't true for variables whose scope is file scope. If you have a variable whose scope is file scope in another translation unit, you have to provide a local declaration to access that variable from the other translation unit. Also, I don't see "global variable" used once in the standard....
by: BB | last post by:
Hello all, I might be missing something here, but am trying to understand the difference between using application-level variables--i.e. Application("MyVar")--and global variables--i.e. public myVar as string, etc. It seems to me that the scope and duration are the same, as they both are there while the application is running, and both go away when it quits. I presume that one difference is that the application state can be "flushed," such...
by: Pierre | last post by:
Hello, In an aspx page (mypage.aspx) from a web projet, I would like to get the value of a variable of the projet that is declared as public in a module. The variable can be called from anywhere in the code behind page and in the class files, but when I try to call it from an aspx page, it raises an error. <%=myvar%> in mypage.aspx raise an error : the name "myvar" is not declared.
by: Ernesto | last post by:
Within the scope of one Python file (say myFile.py), I'd like to print a message on ANY exception that occurs in THAT file, dependent on a condition. Here's the pseudocode: if anyExceptionOccurs(): if myCondition: print "Here's my global exception message"
by: Sir Psycho | last post by:
Is there a way to set a global variable without using the Session object? I basically want to be able to track if a visitor is logged in without starting a Session. Is there such a thing as a global variable that stays alive?
by: eBob.com | last post by:
I have this nasty problem with Shared methods and what I think of as "global storage" - i.e. storage declared outside of any subroutines or functions. In the simple example below this "global" storage is ButtonHasBeenClicked. In this simple example code in Form1 calls a routine in Module1 which then calls code back in Form1 (subroutine WhatEver). WhatEver needs to access ButtonHasBeenClicked but the reference to ButtonHasBeenClicked...
by: =?Utf-8?B?QWxleCBNdW5r?= | last post by:
My Web application is developed in C# Visual Studio 2005 Professional. After deploying the application to the production server I am getting the following error: <%@ Application Codebehind="Global.asax.cs" Inherits="WebApplication.Global" Language="C#" %> I found numerous references to this problem on the web and tried what seems like a few (tens) suggestions, at least the ones I was able to understand. But alas no luck. Pleeeeeeeease...
by: Tom Berger | last post by:
Just a short question concerning exception handling.... All of my applications contain an event handling in the Main() like this one: static void Main() { // declare global exeption handler Application.ThreadException += new
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.