The TSF(Text Service Framework) interfaces wait for windows logon? - windows

I worked on a project about Input Method using TSF(Text Service Framework) of Microsoft. The process of my program was started by an auto-run service when Windows logon.
I wrote the TSF api call like this:
HRESULT hr = _pInputProcessorProfileMgr->EnumProfiles(langID, &pEnum);
in which pEnum is an instance of IEnumTfInputProcessorProfiles and _pInputProcessorProfileMgr is an instance of ITfInputProcessorProfileMgr. Generally, this api enumerates all the registered profiles according to language ID.
However, the API call got nothing but profiles with GUID/CLSID "00000000-0000-0000-0000-000000000000". If I delayed the current thread for several seconds(by Sleep method), the API call returned the right profiles that I expected(and still included the profile with id = 0). It seemed the result of TSF API calling depended on the some component's initialization.
Does anyone have any concerns about this? How can I know the TSF has been ready to work?

Related

Azure Communication Services - Teams Calls

Hi with the new ACS will it be possible to fire an event when a call is answered and fire an event after the call has finished?
I'm wanting to capture the number of the call that has been answered and then open a program to pop up the details of the caller.
Thanks
It is possible to hook to EventGrid events:
Call Started
Call Ended
You can extract the phone number from rawId or use the new createIdentifierFromRawId method to convert it to the correct identifier type for further usage.
See the events reference and the quickstart for Azure Communication Services.
You can also listen to some events with the Call Automation SDK.

SetWindowsHookEx Hook into Explorer To Intercept Win32API call

If I want to intercept a win32 API call, specifically one of the win32 api calls listed at:
https://learn.microsoft.com/en-us/windows/win32/winmsg/window-functions
I presume I need to:
Get the explorer thread id, either from some win32 api call to get threadId by process name (or some special one that exists for explorer).
Call SetWindowsHookExA()
SetWindowsHookExA(WH_CALLWNDPROC, HookProc, GetModuleHandle(NULL), explorerThreadId)
After I call SetWindowsHookExA, I presume I then analyze the messages that are sent to my custom written HookProc to see which win32 api call i'm intercepting, to then react based on that? Are there any good examples out there for identifying which win32 api call the hookProc is being called for? Or examples where somebody has hooked one particular win32api call successfully?

MVVM Xamarin Forms, Best for keeping a function in memory while it awaits a several minute response from a service call

Scenario:
I have a call being made to a WCF service which will take several minutes to get a response.
Initially the call was being made with an action which was on the ViewModel which then saved an updated version of an object to a Repository and then the Repository would pass the object to the service layer to be sent to a web service.
Once done the service layer would return the response to the repository and then to the ViewModel which would then raise a dialogue to the user giving them a series of options.
Issue:
The user can goto other views in the app while they are waiting which would destroy the ViewModel which then the user would not get the message alerting them..
So in a nut shell, I need to keep whatever function receives the response from the repository in memory until its completed.
To get around this I moved the dialogue and function into the repository as this is a singleton so will stay in memory but that defeats Single Responsibility as the repositories should only be responsible for the providing of data not carrying out business logic.
I have looked into raising this through messaging centre instead but I believe that this will keep ViewModel in memory and the user could make this request a few times resulting in the messaging center being called with each request.
Does anyone have a best practise for handling this scenario or any documentation they could refer me to?
Thanks for your help in advance :)
In this case you should take a look at background task. It lives outside the lifecycle of mobile app. If your process is taking several minutes it's almost impossible to relay on app itself as user can terminate it or put it to sleep anytime, and you are not able to prevent it.

Disallow user to make a call when there are no more credits: Sinch Javascript SDK

My application allows unlimited instant messages for free, but takes credits for calls. I want to be able to disallow user to make a call when he does not have any more credits. How in a ideal scenario is this managed using javascript SDK?
I am coming from a standpoint, that although I am able to control this behavior through some validations in code itself, but what happens when the user is a hacker? He can go to console and call javascript methods of its own such as removeListeners and then callClient.callUser(userId). How do you protect sinchClient in such case? Thanks.
Note: I am open to provide more information if the question is not clear.
Sinch exposes a REST based callback mechanism to control your call flow. You can set a callback URL in the Sinch Portal under Applications >> Voice and Video settings. Each call will then trigger a Incoming Call Event (documented here: https://www.sinch.com/docs/voice/rest/#callbackapi) and you can control whether or not to connect this call via the callback response.

Exchange2007 WebServices - AddDelegate

Im working with Microsoft Exchange WS 2007 (JAX-WS) and need to use the delegate functionality.
I have created a Java client which generates a SOAP request which adds delegate access.
<AddDelegate xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<Mailbox>
<t:EmailAddress>delegateEmail#mail.com</t:EmailAddress>
</Mailbox>
<DelegateUsers>
<t:DelegateUser>
<t:UserId>
<t:PrimarySmtpAddress>primaryEmail#mail.com</t:PrimarySmtpAddress>
</t:UserId>
<t:DelegatePermissions>
<t:CalendarFolderPermissionLevel>
Editor
</t:CalendarFolderPermissionLevel>
</t:DelegatePermissions>
<t:ReceiveCopiesOfMeetingMessages>
false
</t:ReceiveCopiesOfMeetingMessages>
<t:ViewPrivateItems>
false
</t:ViewPrivateItems>
</t:DelegateUser>
</DelegateUsers>
<DeliverMeetingRequests>DelegatesAndMe</DeliverMeetingRequests>
The response contains success code. Then to verify the addDelegate method i call the getDelegate operation which displays the new primary address i have added. However when i try and book an outlook resource using the createItem EWS operation using delegate email address i get this message;
The specified object was not found in the store
Also if i open my outlook desktop client and navigate to tools -> options -> delegates tab there are no delegates present.
If i add the delegate through the desktop client and then call my createItem operation it works fine. I want to be able do this for other users however without having to ask them manually add the delegate.
Any idea why this behavior is happening?
I was able to use the EWSEditor http://archive.msdn.microsoft.com/ewseditor which allowed me to discover that i was assigning delegate permissions to the wrong smtp account. Once i corrected this mistake the process worked.

Resources