I have a service / application which receives notifications of Windows session changes.
I have noted a difference in behaviour between Windows XP and Windows 7 and am trying to establish if it is a bug or a documented change of behaviour.
The notifications come in as a: WTSSESSION_NOTIFICATION.
Windows XP reports as expected: WTS_SESSION_LOGON at windows GUI logon and: WTS_SESSION_LOGOFF at Windows GUI logoff.
Under Windows 7 x64 at gui login WTS_SESSION_LOGON is generated but at logoff I get a WTS_CONSOLE_DISCONNECT event instead of the WTS_SESSION_LOGOFF event.
Is this a bug or have the constant values changed between versions? It is not massively critical for the service I have developed but I would still like to know why this behaves differently.
Only services can receive the WTS_SESSION_LOGOFF event under Windows 7. By the time that the service gets the notification the log off procedure is over (so all apps the user was running are already killed).
Related
I am configuring Windows 10 Enterprise (IoT) to run a custom shell, but running into the "Black screen with nothing other than a cursor" phenomena.
My application - a .Net4 Winforms app - is installed and runs fine from the desktop.
I can launch it as a custom shell via a batch file as per the comments here: How to run an application as shell replacement on Windows 10 Enterprise
But setting my app as a custom shell, I just get the black screen.
I note the comments in the above link about applications being signed, but I have tried two mini test applications (also .net winforms), one signed, one not, and both run fine as custom shells. (My application has several dependencies, not all of which are signed, so to sign it would mean going through the ILMerge mill or similar which I would rather avoid if I can.)
I don't expect people to be able to tell me why my app doesn't run (although that would be nice!) but I am looking for ways of diagnosing this. Looking in event logs, etc, is yielding no information whatsoever. My app keeps its own event log, which is not showing any evidence of the app starting.
Thanks in advance
Problem solved:
If a shell application requires elevated permissions, UAC must be turned off. Turning off notifications via the control panel is NOT sufficient, as UAC is still running in the background - it just doesn't notify you! To completely turn off UAC, edit registry entry:
HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System and set the DWORD value EnableLUA to 0
Evidence of UAC behaviour can be found in the windows event log at:
Applications And Services Logs -> Microsoft -> Windows ->UAC
I am using a WebBrowser control as a text editor in a Windows Forms application. For some reasons I need to clear the undo-stack of the browser after certain actions. To achieve this, I use
webBrowser1.Document.ExecCommand("ms-clearUndoStack", false, null);
which works well on every OS but Windows Vista. On Vista I get the following ArgumentException:
System.ArgumentException: Value does not fall within the expected range.
at System.Windows.Forms.UnsafeNativeMethods.IHTMLDocument2.ExecCommand(String cmdID, Boolean showUI, Object value)
Is there a way to avoid the exception or maybe another way to clear the undo-stack?
This command is not available on Windows Vista, as it is posted by msdn "Commands A-C (JavaScript)" article
ms-clearUndoStack
Clears the undo history.
Minimum availability is IE11
IE11 minimum operating system requirements is Windows 7 SP1
I actually have a problem while trying to test my application directly on my Windows Phone 8 device.
I have a SQL Database, and my Windows Phone 8 application connects to it successfully through a WCF Dataservice when using the emulator.
When I try to run the application with the Phone plugged to the computer, it doesn't run anymore, and I get those kind of unhandled exception before the managed limit:
`System.Net.WebException`
`System.Data.Services.Http.WebException`
`System.Data.Services.Client.DataServiceTransportException`
`System.Data.Services.Client.DataServiceClientException`
`System.Data.Services.Client.DataServiceQueryException`
Thanks a lot.
I have a big problem.
I wrote an app for Windows Phone 7.1+, and it's also published on Windows Phone Store:
this app works well for Windows Phone 7.1 and also for Windows Phone 8, and there were no problems during app submission process (who also declares that my app is fully compatible with any OS since Windows Phone 7.5).
The problem is related only to my Scheduled Agent, which runs perfectly on Windows Phone Mango (7.1), but it is not firing at all on Windows Phone 8 (I've also tested my app on real devices, with both the OS').
When I upgraded to Visual Studio 2012 (Express for Windows Phone), I've noticed that it is possibile to add two different types of ScheduledTaskAgent project: one for Windows Phone 7.5 and one for Windows Phone 8 (obviously it wasn't so in Visual Studio 2010...and I used the only one available = the first) !
Dou you think this can be the reason while the scheduled agent is not working in WP8?
What's the difference between the two projects types?
How to manage (in code I mean) two projects of that type? Is it possible?
How can I choose which task I have to register (see code below)?
Will the submission process fail with two ScheduledTaskAgent projects (I think so)?
This is the critical part of the code, when I'm registering my task at startup:
PeriodicTask newTask = new PeriodicTask("MyTaskID");
newTask.Description = "my Description";
ScheduledActionService.Add(newTask);
#if DEBUG
Microsoft.Phone.Scheduler.ScheduledActionService.LaunchForTest("MyTaskID", TimeSpan.FromSeconds(5));
#endif
Thank you in advance.
The only difference between the two project types is (1) the Windows Phone 8 one targets Windows Phone 8 instead of 7.1 and (2) it references the Windows Phone 8 SDK instead of the Windows Phone 7 dlls.
I have an application where I have two projects (7.1 and 8.0). I also have two background agent projects (7.1 and 8.0) and I share code between them using linked files. I reference the 8.0 agent from the 8.0 project and the 7.1 agent from the 7.1 project. I used this example as a best practice for having the two versions of code.
You do not want to reference two agents since that will not work.
If you remove the #if DEBUG does your agent get called when you're debugging?
First make sure you got the proper reference in app manifest file.
<ExtendedTask Name="BackgroundTask">
<BackgroundServiceAgent Specifier="ScheduledTaskAgent" Name="MyApp.Agent" Source="MyApp.Agent" Type="MyApp.Agent.ScheduledAgent" />
</ExtendedTask>
Second the Agent library must be referenced in the main app project.
Third, make sure you are not exceeding the allowed running time or memory allocation. In WP8 the cap for background agent was raised to 11MB. Also there is a limit of app with registered background tasks, so it might be possible that there was no free slot for your task with bg agent.
I ve designed a win32 service in windows XP its working fine. but the problem i'm facing is that it's not working properly in windows 2000 platform. that is stopping the service restarting the service. is there any setting or need to change in code to be done.
Is it possible you have used an API that was new on WinXP?
For an interactive applications you would get a popup about an unresolved import, if I recall correctly for services these are recorded in the system event log.
If it is hanging, take process dumps and feed them into a debugger with symbols (both Microsoft's and yours) configured. That will show you the stacks of the threads, and allow you to check for deadlocks.