Why does the SearchTask show a prompt? - windows-phone-7

In my Windows Phone 7 app I'm using a SearchTask to show the results of a web page. But every time I start the task I get the dread "Allow" screen. I can imagine many users being scared to death by this... Why do I need to be allowed to show the results of a web search result? Is there anyway to avoid showing the scary popup screen?
Fwiw, here's my code:
SearchTask task = new SearchTask();
task.SearchQuery = "<my query>";
task.Show();

The prompt for the search app to use location will only be dislayed the first time the search app is used on the phone.
If you are seeing this displayed more than once is it because you are closing and restarting the emulator between uses of the task?
If not can you provide details of how to recreate the behaviour you're seeing.
The prompt is controlled by the search app and it is not possible to change the behaviour of that app. It is also an intent of the phone that apps should not be able to don something without the user knowing. By default the search app tries to use location to provide context when retrieving results. If the user has privcay concerns about their location data being used in this way they can prevent it. Hence this prompt.

Related

Integrate Windows 8 program with windows search

I want to know if it is possible to have data from my Windows 8 program be able to show up in windows search. For instance, the user could search for "myprogramdata1" in windows and then an item would show up that when clicked would open up my program and I'd be able know that "myprogramdata1" was selected.
EDIT:
I know that it is possible for windows 10. For the program DisplayFusion, if I search settings, there is a result for DisplayFusion settings that can be clicked on and will bring me to the settings page for the program. Does anyone know how this is done?
First of see if you say the command that you typed in using cortana and if it opens settings. If yes, You can absolutely do it.
I did it for one of my app too( Well this was not my intention but it works )
UWP Samples-CortanaVoiceCommand
The key here is once Voice Commands are installed, you can type the text in cortana search (instead of actual voice command) and it works the same. You can still use patterns of voice commands and still type in Cortana search and open your app.

Word COM in scheduled task on Windows Server

I have an application that uses COM to automate Word. It needs to run even when a user is not logged in. I achieved this on Windows 7 by making it run as a scheduled task which runs at startup and doesn't require a user to be logged on. I also had to use the 'hack' where you add a 'Desktop' folder in 'C:/Windows/SysWow64/config/systemprofile'.
I tried this same method in Windows Server 2012, but it doesn't work. I can see in the task scheduler that the application is starting an instance of Word. However, it then appears to 'hang' and nothing happens. I think perhaps the invisible instance of Word is showing an error message which causes the whole thing to hang, as I cannot dismiss the message.
Has anyone else had trouble getting COM to work on windows server? Is there any way of showing hidden instances of Word to see if an error dialog is showing? Or any other way of diagnosing what the problem is?
I know ideally we would have an app that created the word documents without using COM, but this is not an option at the moment.
Does your app work when run as a logged-in user?
In the past I've run into what sound like similar problems, when running programs that try to use COM interfaces; some tasks work, but others simply don't function unless run as a logged-in user with an interactive desktop.
For me the simplest solution was to set up the machine to log in as a user at boot (which you can set up in the control panel - or I think there might also be a sysinternals tool that supports configuring that nowadays), then make sure that task scheduler/Jenkins/whatever you use launches the app as the logged-in user.

Logon-type wxpython app

I manage a number of Windows PCs which are used to control equipment. Each computer has a specific program installed which is what people launch to use that equipment. We want to require people to log in before they can access this program.
Currently, I have a wxpython app which just launches that executable when people log in with the correct credentials. However, you can just run the program directly and bypass logging on. I'd like to make a mock logon screen, ie, fullscreen and modal, which only goes away when you log in. Also it should not be able to be bypassed by alt-tab, windows key, etc. How might I accomplish this with wxpython?
There is no full proof way to do this on Windows. You can show a wx.Frame modally using its MakeModal() method. And you can catch EVT_CLOSE and basically veto it it they try to close the frame. However, if they have access to the Task Manager or even Run, they can probably get around the screen. Most users won't be that smart though. You can delete the shortcuts to the apps you want to launch with wx and that will force most normal users to use your login screen. It's only the smart ones who like to troll through the file system who will go around it.

Windows Phone - Call default web browser

I am trying to develop Windows Phone App, I would like to know that how can I call the default web browser with a specific URL(e.g. http://www.google.com) when I launch the program?
Thanks
When you're launching "the program" as you say (Internet Explorer) you use the following code:
WebBrowserTask browser = new WebBrowserTask();
browser.URL = new Uri("http://www.google.com", UriKind.Absolute);
browser.Show();
The WebBrowser task is inside the Microsoft.Phone.Tasks namespace, the documentaion of which is here: Microsoft.Phone.Tasks.WebBrowserTask
You should also know that the "default" browser is always Internet Explorer, because right now there is no way for users to define an alternative browser as their "default".
Edit:
After reading your question more closely, I can tell there is a little bit of ambiguity. If you want to launch the browser immediately when your app launches, you should know the following:
This kind of application will fail Microsoft's marketplace validation (check the Application Certification Requirements for Windows Phone
Even if it didn't fail the certification, it would be a kind of strange application... not one that is of very much use to your users.
If, however you intend to launch the phone's browser when the user clicks a button, then the above code I posted will work just like you want it to, just make sure to include this line at the top of the code file that it's in:
using Microsoft.Phone.Tasks;
Hope that helps!

Drag and drop on Win7 machine to my app

I have a user that is currently running my Winforms app on Win7. My app allows users to select rows from an open Excel spreadsheet and drag-n-drop them onto the app. However, this user cannot do the drag-n-drop. The cursor changes to the "no" cursor (little circle with line through it) and the operation won't complete.
I was researching drag-n-drop and Win7 and everything I found points to UAC and/or UIPI. I was looking for some solutions and am not sure if any of the below would work:
If the user logs in as admin (and as a result runs my app as admin) would that allow drag-n-drop to work?
Does the user need to turn off or change the settings of UAC/UIPI in order to be able to drag-n-drop?
I am not sure what the issue is. My app usually runs from C:/Documents and Settings/... (C:/Users/... on Win7). Does where it is running from matter? Does drag-n-drop not work because the user is not running my app with enough permissions? Are his Excel and my app on different permission levels? If so, what can be done about that? Note that even though my app allows users to just drag the file directly, that doesn't work either.
Also, is there any way I can have the user reproduce this issue with other apps? Are there apps that come with Win7 that he can see the same problem with. For example, can this be reproduced using Notepad?
Thanks.
Explaining this problem away by UIPI is a very long stretch. It doesn't have anything to do with whether or not the user is logged-in as an admin, that doesn't affect UAC and your program will be running with that same account anyway. The only way UIPI could kick in to stop a D+D is when your program is elevated and Excel is not.
To get yourself elevated requires work and doesn't happen by accident. You'd have to include a manifest so that the user gets the UAC prompt, you'd know about that. Or the user would have to change the desktop shortcut and tick the "Run this program as an administrator" option, she's know about that. While UIPI can be bypassed for Windows messages (ChangeWindowMessageFilter), it cannot for Drag and Drop so if any elevation is going on then your stuck. The ultimate test is to simply ask the user to put the UAC slider all the way down.
The much more likely scenario is that your DragEnter event handler simply isn't happy with the data it sees and therefore doesn't assign the e.Effect property. If you can't get a debugger on-site then write a little test program that logs the values of e.Data.GetFormats() plus whatever else you use to check if the drop is acceptable. And don't forget the obvious: the user simply fumbling the drag somehow.

Resources