c# - Top most even for Modern Apps -


i have recording program stays topmost time except when open modern app (windows 8) or start screen.

it possible make desktop application stay on top of modern apps, magnifying glass tool:

topmost

now, problem using topmost option and/or api call in wpf window won't work modern apps.

what i'm trying:

static readonly intptr hwnd_topmost = new intptr(-1); static readonly intptr hwnd_notopmost = new intptr(-2); static readonly intptr hwnd_top = new intptr(0); static readonly intptr hwnd_bottom = new intptr(1); const uint32 swp_nosize = 0x0001; const uint32 swp_nomove = 0x0002; const uint32 topmost_flags = swp_nomove | swp_nosize;  [dllimport("user32.dll")] [return: marshalas(unmanagedtype.bool)] public static extern bool setwindowpos(intptr hwnd, intptr hwndinsertafter, int x, int y, int cx, int cy, uint uflags);  //onloaded event handler:  var source = presentationsource.fromvisual(this) hwndsource; setwindowpos(source.handle, hwnd_topmost, 0, 0, 0, 0, topmost_flags); 

only applications marked accessibility related can this. achieve it, follow these guidelines (taken comments section of this article):

  1. the application must demand uiaccess (app.manifest)
  2. the application must assert “topmost” window positioning (either in win32/setwindowpos or winforms/wpf’s “topmost” property, programmatically or otherwise)
  3. without making changes group policy setting, must installed trusted location [c:\windows, c:\program files, c:\program files (x86)]. a. note: if want able run out of arbitrary location, must disable security setting: “user account control: elevate uiaccess applications installed in secure locations”. b. note2: same setting hklm\software\microsoft\windows\currentversion\policies\system\validateadmincodesignatures 0
  4. said application cannot ran in debugger
  5. if it’s .net application a. manifest must embedded in post-build step b. application must have “delayed signing” (meaning cannot ran built-in debugger, although can build , attach – microsoft does)
  6. the application must signed trusted certificate.
  7. said trusted certificate must installed trusted root certificate authority (this important! must not installed) more info see: http://msdn.microsoft.com/en-us/library/ms726294

... not trivial task!


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -