Get Window handle in Windows store app - camera

I am working on a app which needs to have a custom camera capture dialog to enable zoom, flash etc. which default CameraCaptureUI does not have. My app will be deployed on tablets and I have a .NET SDK (provided by tablet vendor) which I can use to enable zoom, flash and every other thing. The SDK is not compatible with windows store app and it uses Win32 api but I can still use some of it functions.
So this SDK have a preview method which requires window handle (InPtr) to start a preview. The problem is I cant find window handle for a store app window or rather I don't know how to find it. If i can find it somehow I am sure I will be able to implement other features easily enough.
Can someone show me how to find window handle in Windows store app?
Thanks a lot for any pointers!

According to this post: http://tinyurl.com/pf5kpyv you can find the window handle of a store app using the Win32 API. But if your target is WinRT, you won't have the Win32 API available (probably you already know this). If your target is full Windows 8.1, it might be easier to just write it as a non-store app. Of course, if your client requires it to be "modern" than you're stuck :)

Related

How to detect a docked device in cocoa

I've been searching all over the web and have found solutions to mounted device detection from within a Cocoa App using the NSWorkspace notification system. However this notification doesn't seem to be triggered when an Apple device is docked.
I specifically want my OSX App to detect docked iPads/iPhones, be able asses whether the iOS version of my App is installed and then synchronise files. I realise that the easiest way to do this is using iCloud, but I do not as yet have a developer membership with Apple and would like the option to be able to synchronise files without the internet.
An iTunes like system would be ideal. Any ideas.
Thanks in advance.
Apple don't provide any official APIs for doing what you ask.
Unofficially, you can try the stuff here: https://bitbucket.org/tristero/ipodaccessframework
You can definitely use it to determine whether a particular app is installed (by looking for a match for its bundle-id) and you can read/write files to/fro a particular apps document directory.
Disclaimer: this one is mine. There are definitely other libraries around that achieve similar results.

iOS App Settings/Preferences in Worklight

I am working on a Hybrid Application, targeting (for the moment) iOS. Does Worklight have a utility to handle application settings/preferences for iOS? I know how to write the native code to do this, but do not yet know how to gain access to the application settings from the JavaScript. Can anyone point me in the right direction or provide a working example?
In application-descriptor.xml, there is a worklightSettings flag you can set, however the settings page it creates is not user facing. That is, it is meant only for development time, or internal usage, and not production. It allows control of the server address that athe client connects to and change the web resources it will fetch.
So the answer is, no.
The mentioned settings page has set items in it that cannot be altered much (settings.bundle which does not allow much room for play. Maybe you could change it a bit, but doing so would void giving support to you if problems arise). I would recommend against doing so.
So this leaves you the option of creating this on your own. Maybe there is an existing Cordova plug-in that does something similar. Review these training modules of how to incorporate Cordova plug-ins to your application. Cordova bridges between JavaScript to native code, so it could be what you're looking for.

Windows Phone 8 - private APIs?

Is it possible to use private APIs in Windows Phone 8 development similar to iOS development?
Of course, this is NOT about apps going to get published (AppStore/Marketplace). But there are a lot of use cases for non-public projects where a developer wants to call internal system functions.
With the Windows Phone 8 SDK installed, one can mount the Windows Phone 8 Emulator image located in C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Emulation\Images. In the main partition of the Windows Phone OS, one can navigate to Windows\System32 and inspect the system DLL files with a tool like Dependency Walker or IDA Pro.
There are a lot of functions that sound very interesting but which are not publicly available and thus not documented. The question is: is it possible to call them somehow from an app or by other means?
Just a few examples of interesting functions (there are much more):
ShellChrome.dll: InvokeStartMenu, InvokeScreenCapture, InvokeVolumeUp, LockDevice, ...
InputInjection.dll: ApiInjectInitialize, ApiInjectTouchEvent, ...
...
I tried to get LoadLibrary (specifically, LoadLibraryExA) working somehow in a native Windows Phone App project, and to load and call these functions (the loading of the library worked). Long story short, I ended up with access violation errors or similar when trying to call the functions (maybe because of the sandboxed execution environment). Another problem is, that I can only guess the signatures (arguments) of the functions. I can't find them out with the tools I use.
Private api? We can use dll files in the windows phone. I have used private sdk's in the windows phone. I don't think windows is going to permit us to customize the OS just like Android do, So Invoke volume up..etc stuff is not going to work through private api.
I think they only provide some private apis to only partners with an NDA.
http://social.msdn.microsoft.com/forums/wpapps/en-US/4af0e87a-ab4b-4652-891a-f198a32758cf/windows-phone-8-access-to-private-apis
You can't, the application sandbox will enforce API usage. That means you will get an UnauthorizedAccessException every time you try to do a call to an api requiring rights you don't have.
This is intimately tied with the developer account you use to unlock your phone for development purposes.
EDIT : That's also true on the c++ native side.

Can we package our existing HTML5 JS App for Windows 8

I have read some posts on S/O and also around the web. We are producing a HTML5 JS based web app that runs on the web. We are packaging it up for Google apps, and also for phonegap.
Can we package this app for windows 8? Of course, I appreciate it won't use the windows 8 features. But, will the app run none the less, as it stands. So that we can place it in the store and build out windows 8 features as we move forward.
I appreciate this is a slightly non-concise question, but I guess the real point is what is our quickest route to take our existing HTML 5, CSS, JS App and deploy it in the store and get it working on this platform.
In general, the answer is yes. The transition is not seamless, but you will be able to use a ton, if not all, of the application artifacts in Win8. A good test is if you can run it in IE10, you can run the app as a Win8 app. Again, this is a very broad brush - things you need to worry about are things like all scripts files need to be local (no CDN), changes to web and security contexts, and the fact that Win8 is a horizontal paradigm whereas most web apps are vertical. But in general, you should be able to make the move. Usual caveat - your mileage will vary.
Yes, although not recommended, you can package your existing app for Win8. You'll need to add a few bits of code though. The minimum would be to embed your app's start/init code within WinJS's first promise callback, like so:
args.setPromise(WinJS.UI.processAll().then(function () {
// your init code
}
You'll also need to create a couple of icons for the start screen and an image for your app's launch screen.
It is possible that you'll run into a few issues, like some security related restrictions, where you'll have to modify your code to use some native WinJS functions. This all depends on you app's implementation.
You can also check Microsoft's guidelines for migrating a web app to win8, here: http://msdn.microsoft.com/en-us/library/windows/apps/hh465143

Desktop Application upon Gecko/Mozilla or WebKit

How can I develop an installable desktop application on top of the Mozilla Engine or the Webkit engine.
We want to have best of both worlds, ease of development with DOM+Javascript+RenderingEngine+ContinuedImprovements in a Browser and user's control as in a desktop app
I looked at using C++ XPCOM for Mozilla but it seems to be quite complicated, Is there any other way to code like a WebApp using Javascript but burn it into the browser and dress it to give a feel of a desktop app. Also I require that javascript is compiled into native so that one cannot sneak into the source code
Are there any examples of desktop applications done this way ?
Web apps are fine but there are concerns of piracy, privacy, security and version control. The moot point is that in a web app the control lies with the software vendor, moreover the data is also with the vendor. Not only these, any changes to the application may also necessitate another around of training. What we want is that once the customer buys a version he is sure of what he owns and that he is in total control of it and we as software developer do not exposed our source code.
The issue is we have expertise in Web App development and we want to utilize that to develop a Desktop App
Your last point is that :
The issue is we have expertise in Web App development and we want to utilize that to develop a Desktop App
Well then BowLine can be an option though it requires Ruby, so you need to consider that. You can also take a look at WebKitDotNet if you are with .net Background.
Use XUL for the user interface and code your functions using JavaScript. You problably only need C++ to expose native functionality not yet available in Gecko. Examples of software that works this way: Komodo IDE, Songbird, Firefox and Thunderbird.