473,762 Members | 8,011 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>
combo.

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 1273
> ... 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>
combo.


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

11
2705
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; }
5
3493
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....
4
3536
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...
3
3947
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.
3
2182
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"
2
1312
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?
11
3163
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...
4
5927
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...
1
3386
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
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9378
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,...
0
9989
jinu1996
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...
1
9927
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7360
isladogs
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...
0
6640
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5268
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...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3510
muto222
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.