What is equivalent usage of sendmessage()[WINDOWS] in MAC OS X? - c

I have a ContextualMenuPlugin and an application. When user clicks the option from context menu i need to send a message to my app. In windows i achieved this using sendmessage() function. But i'm new to MAC OS X. Can any one please help me, by giving some api's or functions which will enlighten this situation?

You have plenty of choices on how to get messages into an application on your Macintosh.
The ways I'm thinking of include Apple Events or sockets or kqueues, but there's other stuff I've never even worked with that might even be more useful & appropriate (such as Distributed Objects). Check out this duplicate and/or related question and maybe you'll see a useful answer in there for you that you can build upon.
B.T.W.: how did you construct your Contextual Menu Plugin? Is it in Carbon or Objective C or is it some codeless plugin or plist or? The answer to that question probably will dictate a lot towards how you will be able to talk from your plugin to your app.

If you want to control just your application you might want to look into AppleScript. Using that solution has the added benefit that your users could also use it to automate things via scripting.

Related

Show windows form over locked screen

I'm developing an application to run in background. This application is used to capture user’s activity on their system. Application is working very fine.
Now, I need to display a windows form over locked screen. Just like this:
Can any one help me! How can I show any windows form over locked screen?
Not possible, for security reasons no application should be shown when the screen is locked.
The only thing remotely similiar might be a Kiosk App:
Is the Windows.ApplicationModel.LockScreen namespace available for non-kiosk use?
There are a few different things here that are probably confusing things. unfortunately they are not very common scenarios so documentation is lacking.
You can use the Windows.ApplicationModel.LockScreen namespace for customising the display of the lock screen. This can be used to change the wallpaper or notification counts. It is probably the most common form of lock screen customization as it can be done by any app.
You can also use the functionality in this namespace to create an alternative lock screen. This could have different behaviour to the process of swipe up and enter password/PIN or Microsoft Hello face detection.
Creating such an app and distributing through the store requires extra permissions than 3rd party developers typically have.
"Kiosk mode" apps are created as apps that run above the lock screen. Such apps have no real connection to lock screen replacements but are related in their use of similar underlying elements of the OS.
In terms of what you are trying to achieve, it sounds like you should be able to do this by declaring the windows.lockScreen extension and then using LockApplicationHost to do the actual unlocking. As mentioned above the lack of a way for 3rd parties to distribute such apps through the store means there is a lack of documentation in this area but it should be possible.
One thing to take note of in such an app is an under even greater memory/resource constraints than a typical app and so you should keep this in mind during your planning and development.
I know this is an old question but for anyone still looking:
It is a security risk don't do it.
If you still want to do it this could help: SampleHardwareEventCredentialprovider
You will have to play with WinAPI and CredentialProviders but it is working demo and will show simple windows dialog with a button at lockscreen

Cooperation tool group: coding in C

Is there any tool, similar to codepad, writing code in C language that I can share my code with a group and my group can make changes and simultaneous views in real time editing?
I can't tell you enough that this is going to make your work more difficult if you're planning on using this for anything other than something like a code review. However, it's called a real-time collaborative editor. There are a ton of them. I used one on linux a while back that I can't remember the name of, but in the mean-time, let wikipedia start you off...
http://en.wikipedia.org/wiki/Collaborative_real-time_editor
Edit:
The tool I used on Linux that worked well was called Gobby.
There are a bunch of others in this question on SO Real time tool for collaborative coding
Sorry for resurrecting an old question but I thought I should share this.
I usually use Collab.Center (http://collab.center). Some features I like about it better than others are:
Online, real-time collaborative coding
Support for a lot of languages (40+, I think) (EX: C, C++, Java, HTML/CSS/JS, PHP, etc)
Text and Video (Webcam) chat (Requires Sign-In)
Syntax highlighting, auto-closing brackets, matching brackets, etc.
Ability to manage all your documents (Requires Sign-In)
Private documents (Requires Sign-In)
I think it would be great for you and your group, if you haven't already found an alternative.

Feature tracking WinForms

I would like to extend my WinForms app, which a feature that allows me to monitor which functions are used by the users.
The idea is to count how many times e.g. a button has been clicked, or a popup was opened.
I want to know which features are used more or less often by the users.
Any ideas how this can be done? (Or even if somebody solved this problem already)
tia,
Martin
The only mechanism I can think on to do what your looking for is to use a logger like log4net / Log4PostSharp to log details to a log file on the machine, this would give you details on usage for that particular client. You would have to create a custom attribute that you could decorate your methods with that would result in something being written out to the log file, otherwise your code would end up littered with code to implement the logging!
Have a look at this article too, it uses Log4PostSharp with AOP (Aspect Oriented Programming) which would make the implementation of the logging much more cleaner (uses attributes).
http://www.codeproject.com/KB/dotnet/log4postsharp-intro.aspx
You can find some if you google for the term "application analytics" instead of "feature tracking".
I have found the following products:
includeapp.com
Software Statistics Service
Dotfuscator for .NET, DashO for Java
FusionAnalytics
Flurry Analytics
OpenSpan Desktop Analytics
DeskMetrics
EQATEC Analytics
Rapidengines
I might say that I also plan to create such a product. When it will be Beta I will add it to the list.

Best Way to automatically find links to your content?

So, here is the task I've found myself thinking of. Pretend for a moment, that I have a large body of content. I want to see what websites are linking to my content. I know that I could look into TrackBack or PingBack but what about those that aren't using tools capable of dealing with that?
It would seem that some form of Web Crawler that looks for pages linking to the original document might be useful. My question to the greater community is what would be the best way to get started here? Do TrackBack and PingBack do more than I assume? Are there services or tools out there that already do what I'm thinking?
Google is your friend!
Use the link prefix:
link:whatsite.com
And yes, trackbacks do more.
If you have HTTP referers setup in your logs, you can mine them.
You can even discover pages taht does not know about.
Else, there is the paying Linkscape from Seomoz or the free majesticSEO (if you confirm ownership of the domain).
MajesticSEO has a bigger backlink index and an API (need to login!).

Apache module FORM handling in C

I'm implementing an Apache 2.0.x module in C, to interface with an existing product we have. I need to handle FORM data, most likely using POST but I want to handle the GET case as well.
Nick Kew's Apache Modules book has a section on handling form data. It provides code examples for POST and GET, which return an apr_hash_t of the key+value pairs in the form. parse_form_from_POST marshalls the bucket brigade and flattens it into a buffer, while parse_form_from_GET can simply reference the URL. Both routines rely on a parse_form_from_string routine to walk through each delimited field and extract the information into the hash table.
That would be fine, but it seems like there should be an easier way to do this than adding a couple hundred lines of code to my module. Is there an existing module or routines within apache, apr, or apr-util to extract the field names and associated data from a GET or POST FORM into a structure which C code can more easily access? I cannot find anything relevant, but this seems like a common need for which there should be a solution.
I switched to G-WAN which offers a transparent ANSI C scripts interface for GET and POST forms (and many other goodies like charts, GIF I/O, etc.).
A couple of AJAX examples are available at the GWAN developer page
Hope it helps!
While, on it's surface, this may seem common, cgi-style content handlers in C on apache are pretty rare. Most people just use CGI, FastCGI, or the myriad of frameworks such as mod_perl.
Most of the C apache modules that I've written are targeted at modifying the particular behavior of the web server in specific, targeted ways that are applicable to every request.
If it's at all possible to write your handler outside of an apache module, I would encourage you to pursue that strategy.
I have not yet tried any solution, since I found this SO question as a result of my own frustration with the example in the "Apache Modules" book as well. But here's what I've found, so far. I will update this answer when I have researched more.
Luckily it looks like this is now a solved problem in Apache 2.4 using the ap_parse_form_data funciton.
No idea how well this works compared to your example, but here is a much more concise read_post function.
It is also possible that mod_form could be of value.

Resources