Click here to Skip to main content
16,007,760 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Can't display a frame in a CDHtmlDialog Pin
Florian Schaper27-Nov-05 19:13
Florian Schaper27-Nov-05 19:13 
Generalcpl file Pin
Anonymous21-Jul-04 8:38
Anonymous21-Jul-04 8:38 
GeneralRe: cpl file Pin
David Crow21-Jul-04 8:52
David Crow21-Jul-04 8:52 
GeneralRe: cpl file Pin
Ryan McDermott21-Jul-04 8:58
Ryan McDermott21-Jul-04 8:58 
GeneralRe: cpl file Pin
David Crow21-Jul-04 9:09
David Crow21-Jul-04 9:09 
GeneralRe: cpl file Pin
Ryan McDermott21-Jul-04 9:24
Ryan McDermott21-Jul-04 9:24 
GeneralRe: cpl file Pin
David Crow21-Jul-04 9:34
David Crow21-Jul-04 9:34 
GeneralDisplaying dialog when logged in user is different from scheduled task user Pin
Spike McFarland21-Jul-04 8:28
Spike McFarland21-Jul-04 8:28 
We have an application ("A") that pushes another application ("B") to target system and schedules it to be run by the Microsoft scheduler using credentials supplied by the user of "A". Whew! The first thing "B" does when it is fired off by the scheduler is to give the logged in user the ability to cancel the task ("B", that is) by virtue of a popup dialog. The problem is when the logged-in user is different from the user account that the task is scheduled to run as (usually 'administrator') the dialog doesn't appear (under Windows 2003) or parts of the dialog are transparent (under XP). Our task "B" does not who the logged user is.

Basically, the algorithm is:
1) LookupAccountName() with an empty user to get back the SID for the BUILT-IN domain.
2) GetProcessWindowStation()to get this thread's window station. Used later on exit to restore things
3) GetCurrentThreadId() to be used in...
4) GetThreadDesktop() to get this thread's desktop. Used later on exit to restore things
5) OpenWindowStation(L"winsta0", true, MAXIMUM_ALLOWED)to get the 'default' window station.
6) OpenInputDesktop(DF_ALLOWOTHERACCOUNTHOOK, true, MAXIMUM_ALLOWED) to get the desktop that is being used.
7) We make sure that SID that we retrieved from the call to LookupAccountName() is in the ACL for the window station we got from the call to OpenWindowStation().
8) We make sure that SID that we retrieved from the call to LookupAccountName() is in the ACL for the desktop we got from the call to OpenInputDesktop().
9) SetThreadDesktop() with the desktop we go back from OpenInputDesktop().
10) Popup our dialog.
11) Restore everything back to the way is was on the way out.


All the API calls return good values.

This works when the logged-in user is the same as the user that task "B" is scheduled to be run as. It doesn't when they're different.

Am I missing a step? What do I have to do to work with Windows 2003? I know that there was some new security features added. They seem to be hosing me up.

I've tried a hundred different permutations of getting/setting security attributes. None made a real difference.

Spike McFarland
GeneralRe: Displaying dialog when logged in user is different from scheduled task user Pin
Spike McFarland21-Jul-04 8:41
Spike McFarland21-Jul-04 8:41 
Generalcreating my own messagebox Pin
magee8121-Jul-04 8:21
sussmagee8121-Jul-04 8:21 
GeneralRe: creating my own messagebox Pin
David Crow21-Jul-04 8:54
David Crow21-Jul-04 8:54 
GeneralRe: creating my own messagebox Pin
Ravi Bhavnani21-Jul-04 17:50
professionalRavi Bhavnani21-Jul-04 17:50 
GeneralAnother way Pin
Ravi Bhavnani21-Jul-04 18:08
professionalRavi Bhavnani21-Jul-04 18:08 
Generalsplit(delim) Pin
Oriocat21-Jul-04 8:04
Oriocat21-Jul-04 8:04 
GeneralRe: split(delim) Pin
David Crow21-Jul-04 8:55
David Crow21-Jul-04 8:55 
GeneralRe: split(delim) Pin
Oriocat21-Jul-04 9:35
Oriocat21-Jul-04 9:35 
GeneralRe: split(delim) Pin
David Crow21-Jul-04 9:41
David Crow21-Jul-04 9:41 
GeneralRe: split(delim) Pin
Oriocat21-Jul-04 9:55
Oriocat21-Jul-04 9:55 
GeneralRe: split(delim) Pin
David Crow21-Jul-04 10:00
David Crow21-Jul-04 10:00 
GeneralRe: split(delim) Pin
Oriocat21-Jul-04 10:10
Oriocat21-Jul-04 10:10 
GeneralRe: split(delim) Pin
David Crow21-Jul-04 10:21
David Crow21-Jul-04 10:21 
GeneralRe: split(delim) Pin
Oriocat21-Jul-04 10:36
Oriocat21-Jul-04 10:36 
GeneralRe: split(delim) Pin
David Crow21-Jul-04 10:55
David Crow21-Jul-04 10:55 
GeneralRe: split(delim) Pin
User 58385221-Jul-04 20:09
User 58385221-Jul-04 20:09 
GeneralMDI child doesn't display title Pin
toothpick21-Jul-04 6:44
toothpick21-Jul-04 6:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.