473,385 Members | 1,642 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1250
> ... 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 "SetWindowsHookEx" 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
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...
5
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...
4
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...
3
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...
3
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...
2
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...
11
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"...
4
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.