Loading Preferences in to a Mac Kernel Extension - c++

Greetings!
I am working on a kernel extension driver for OSX. It is a simple keyboard filter. I have preferences that are set through a preference pane regarding how this filter will act. I need to take the preferences from this preference pane and load them in to the kernel extension.
I have googled all over and haven't found anything regarding how to do this.
Is there a way to load a plist in to a preference pane? Perhaps into an OSDictionary or something?
Or, what would be the best way to get preferences from my preference pane into my kext?
Thanks!

The source code of this project will help you. It uses sysctl to communicate between the pref pane and the kext.

Looks like this is exactly what I am looking for:
Kext Controls and Notifications
Excellent.

Rather than a kernel extension, you might look into Quartz Event Services, as it is designed for user-land event filtering.

Related

Table/Grid using MFC

I just started developing an MFC application for the first time and I'm hoping to get more familiar with the whole "controls" concept. I am using the dialog editor in visual studio and so far I was not able to find functionality to add a simple table/grid. It seems quite basic to me, but I can't even find reliable information on how to do it on the internet.
I am looking for something similar to Qt's QTableWidget, something that I can later program with variable amount of rows and columns tailored to my application's use cases.
Do you have any ideas how to do it?
I use CGridCtrl which is very powerful and does a lot of the legwork for you.
Sounds like you're after a List View Control, which is wrapped by MFC's CListCtrl class. The dialog editor will enable you to add one and set its properties.

WinCE 6.0: Customizing Control Panel (cplmain)

i work on a Windows CE 6.0 Image and added a Audio driver to my Solution (my solution is based on a image without audio). Sound works fine but i dont know how i can add the standard Windows CE 6.0 Sound Settings dialog to the control panel.
MSDN says the following:
"The Windows CE Control Panel allows users to set a variety of system-wide properties, such as mouse sensitivity, network setup, and the desktop color scheme. You can select specific functionality to include in your Control Panel by specifying them in your Cesysgen.bat file."
Can anyone explain how this works exactly via Cesysgen.bat? In my project i cant find any entry for cplmain in my Cesysgen.bat.
Could it be that those standard Applets are integrated into the control panel automatically? (maybe with "getProcAddress()" when a specific driver is loaded?) - This idea comes from "cplmain.def", there is written:
EXPORTS
CPlApplet
; These functions are exported for componentization
; We use GetProcAddress on ourselves to dynamically discover
; what components we have
I found a quite good explanation from Andrew Pearson here:
http://www.itlisting.org/4-windows-ce-embedded/a57eef4103191b7a.aspx
but i tried a few different things an nothing worked! So this confuses me even more. The only statement there i really understand now is:
The control panel, unfortunately, is about the single most confusing thing
to build in the whole tree.
Yes it is! Would be nice if anyone had an idea.
Kind regards,
Martin
I've created custom control panel applets before, and to be honest, trying to modify the existing applet is about the worst thing you can try. Generally what I do is just create a whole new applet, which is really just a DLL renamed to have a .cpl extension and that exports the CPlApplet entry point.
There's an example in MSDN that shows the expected values the OS will pass in to get your icon, tell you to start and those types of things.
Basically just build your own applet as a completely separate project, then include it in the MODULES section of your BIB file. Don't even mess with the existing train wreck of control panel code.

open window to choose images c++

I am using c++ in ubuntu 12.04 using gcc. Am trying to perform few image processing tasks using opencv. For this, I want the user to select an image. Is it possible to open the directory explorer through c++, and let user choose the image, by selecting folders or drives, etc.? I actually did not know how to google this question exactly, my apologies if this is pretty rudimentary. Your help is much appreciated. Thanks in advance
You will want to use a GUI toolkit like Qt. They ususally have some sort of function for what you want. In the case of Qt the QFileDialog would be good.
For learning Qt: There are official tutorials or maybe this question.
If you want to go down this route you can also use a completely separate program just for getting a file name. Something like zenity maybe. Which platform do you want to do this on?

How to add custom menu upon right click on file / folder programmatically in c++ / QT?

We have an app which syncs files and folder like the way dropbox does. This is an c++ / QT based installer.
We would like add custom menu in the right click context menu of a file or folder like the way dropbox does in the below screen shot.
We are targeting both windows & Mac platforms. Can anyone suggest me how to start with it?
On Mac, you're going to have problems as adding to the general Finder Context Menu has been deprecated.
So, you may be thinking, if it's deprecated, then how do Dropbox do this? From what I've researched in the past, I believe they use code injection to inject into the running Finder application's address space and then an Objective-C feature known as method swizzling to change calling a method to one of their own, which is located in the injected code.
This is all fairly hardcore and very low level, but if you're going to go on that journey, you can start by looking into a library called mach_inject and googling about it. The source code can be found here: -
https://github.com/rentzsch/mach_inject
However, be aware that there are those that believe code-injection is wrong and won't install Dropbox or any other software that uses it. In addition, if you're planning on releasing a product in the Mac Store, I wouldn't expect any application that performs code injection to be allowed.
For windows, I could find a complete Shell extension example over here.
http://www.codeproject.com/Articles/441/The-Complete-Idiot-s-Guide-to-Writing-Shell-Extens?fid=519&select=3236397&fr=76&df=90&mpp=25&noise=3&prof=True&sort=Position&view=None&spc=Relaxed

C++ style menu bar in VB.NET?

Ive been looking a long time for this, but can't seem to find it. When I add a menu strip in vb .net, it looks like this:
http://img19.imageshack.us/img19/4341/menu1sbo.jpg http://img19.imageshack.us/img19/4341/menu1sbo.jpg
and I want it to look like the WinRar, Calculator, Notepad etc menus like this:
http://img8.imageshack.us/img8/307/menu1a.jpg http://img8.imageshack.us/img8/307/menu1a.jpg
From what I gathered, in vb 6 you could create a mainmenu and do it this way, but in vb .net it seems like all there is is ugly menustrip.
Thanks
You may have to get dirty and create a CustomRenderer(ToolStripProfessionalRenderer) to apply to the ToolStripManager
Without rehashing to much, this doc looks like a nice overview or you can always opt for the Microsoft tutorial
menustrip is derived from toolstrip
You may need to enable XP theme support in your project settings. To do this, go to My Project in your Solution Explorer, and make sure "Enable XP Visual Styles" is checked under the Windows application framework properties group down near the bottom of the Application tab.
If this doesn't work, you might need to create an application manifest as described in this MSDN article.
This question is quite old but for anyone else interested, you can find this type of menu in the .NET framework components. Just right click the Toolbox -> Choose items -> .NET Framework Components and filter for MainMenu. Works exactly like any other menu strip from what I've seen so far.