win32 libraries(dll) behavior in when launched from MetroApps - winapi

We wrote a COM in-proc Server(dll)(say x.dll) which is dynamically linking to a library(say y.dll) which is using win32 API's. We have observed a different behavior of the same win32 API when launched from windows8 Desktop Apps and Metro Apps.
When the COM in-proc Server dll(x.dll) is loaded from desktop Apps, all the win32 API in library(y.dll) are working fine.But when x.dll in launched from metroApps all the win32 API in y.dll are failing.
Is this the default behaviour for Windows8 win32 API ? It would be good if some one can provide me any documentation related to using win32 API in dll's which can be launched from both desktop and MetroApps.
Thank You

Only a subset of the Windows API is available to a Windows Store app. The MSDN documentation for each API function specifies whether the function may be called from a Desktop app or from a Windows Store app. For example, the following appears at the bottom of the documentation for GetProcAddress:
Minimum supported client Windows XP [desktop apps | Windows Store apps]
This function may be called from both Desktop apps and Windows Store apps. If a function does not say that it is supported in a Windows Store app, it may not be called from a Windows Store app. For example, LoadLibrary does not say that it is callable from a Windows Store app, so it cannot be called. (Note that while there are ways to call unsupported functions, doing so necessarily yields undefined behavior.)
Also note that Windows Store apps run with low privileges and have restricted access to the system.

Related

Is there a way to turn on Bluetooth using winapi?

I'm looking for a way to turn on my computer's Bluetooth using the Windows API only. I didn't see any function in BluetoothApis.h for this. If you know any way (maybe using the Device API), I would love to hear it!
This is the setting I want to turn on using the Windows API:
I don't know about Win32 API, but it can be done easily via Windows Runtime API Windows.Devices.Radios. The RadioState enum can be set to On, Off or Disabled.
A UWP example is here.
For Win32 apps it is still possible to access the Windows Runtime API, for example by compiling with VC++ /ZM flag ("Consume Windows Runtime Extension") and invoking Windows::Foundation::Initialize(); on startup, as explained in the Microsoft's blog: How to access the Windows 10 APIs from C++.

Start Qt app right after initial windows startup

I need to start my application before the windows login form displays, and the login process should be done within the application. How is this possible with the Qt framework?
It is not possible to customize the Windows graphical identification and authentication (GINA) using only Qt. GINA is a component of some Microsoft Windows operating systems that provides secure authentication and interactive logon services. You will have to implement a custom GINA, which involves providing implementation for a set of native API calls. More information on this topic is available at Wikipedia.

desktop app (windows app) connect windows phone

is there a assembly or API to get isolated storage in windows phone using WPF or win form while connecting the windows phone device via USB?
please note the devise will be running offline so cannot use web service or WCF
thanks
Check out this article on emulator automation. It includes details of adding and removing files from isolated storage and should also work on an actual device as well as the emulator.
This isn't really a supported activity. I too have been thinking about what to do when you want a desktop version with extended features and you want the two to share data.
I think the key here is to think about how Microsoft achieves this with email and calendaring. There's no shared filesystem, rather Outlook on the desktop and Outlook on the phone both function as clients for the same Exchange server.
At one point I considered running a webservice in a desktop app so that the phone app could push data to the desktop app, but that would be a very manual process. The common-server model will provide a much better UX.
It's not an exact match to your situation, but a good tool is the Windows Phone 7 IsolatedStorage Explorer.
The reason I say it may not be the best match is this note from the documentation:
The WP7 Isolated Storage Explorer
supports connections from the emulator
or actual devices. For applications
running on devices a data connection
must be enabled (WiFi or the mobile
data connection).
It's at least a great start and keeps you from having to do the heavy lifting. Is there any reason you have to be offline and check the contents of IsolatedStorage? If you elaborate on why you have that requirement, we might be able to offer some work arounds.

Is it possible to run a windows XP executable on windows CE?

Is there any solution to run a Windows XP executable on a Windows CE or Windows Mobile Device? Actually I think it is almost impossible or at least it would be very tricky however, I have a client says that the vendor of his Windows based application declared that the app runs on Windows XP as well as Windows CE.
Is this possible? Is there any way to convert Windows XP executable (native machine code) to Windows CE (running on x86 CPU) executable?
Native code won't work out the box because the Win32 and WinCE API's are similar, but quite different at the same time. Even when they overlap, WinCE expects the API to live in coredll.dll instead of system32.dll and friends.
If it's a simple app, and you know exactly what APIs are being called, you could write a wrapper coredll.dll that exposes the WinCE style APIs. There will be lots of unicode conversion involved!
If it's a .net compact framework application it will run if the app only references the parts of the API that are common to compact framework and the full .net framework.
It's possible to develop a cross-platform .net app that shares the bulk of the code, and has separate pinvoke layers for the CE and XP APIs respectively (if you are using them).
Converting the final executable may be well-nigh impossible in some cases, but if the vendor deliberately designed it to work on both systems, then it probably does (the task would be much easier for someone who possessed the source code).

How to hook api in windows phone 7?

Is there something allow me to develop a software in wp7 just like API MONITOR in windows?
Windows Phone has some native API hooks (although undocumeted):
http://blog.walshie.me/2010/11/12/windows-phone-7-native-apps-the-missing-link
However, due to the restrictive nature of the OS you might have problems in tracking down API calls from other applications, since you will need to have your own app running in the background, and that is currently the privilege given to system apps only.

Resources