Hi guys

How to block access to apps ?

For example, grantind acces to someone to use only word, or excel. If he/she clicks on any other icon on the desktop, a messagebox opens saying that he is not allowed to use that program (the same for using the start menu.)

Best Regards,

guga
Posted on 2007-03-15 20:27:08 by Beyond2000!
Well you have got to give us more information about what you are intending to do! Whether you are trying to do thig programmatically or using Windows' utilities?

In the latter case, if you are using Win2k/XP, you can open the Start Menu and then Run. Then type GPEDIT.MSC and hit enter.

When the MMC window for GPEDIT opens, navigate to the below folder:

User Configuration > Administrative Templates > System

You should now see some snap-ins to the right of the screen. One of them is called Don't run specified Windows applications. Double click on that and select Enabled or use the ALT+E shortcut. Now the Show button should have been enabled on the middle of the screen. Now click on that button and enter the path to applications that should not be allowed to be run.
Posted on 2007-03-16 04:21:53 by XCHG
I believe he want some code which can make possible to set application permissions. Or something like that...

Well I never really studied it before, so I cant really give you much, sorry. But the most useful results from my searches on the topic goes to COM+ You should read how to set software restriction on that.

An overview is here: http://techlib.info/cossdk/html/233483a0-ff16-4e21-a312-cc57a92124c3.htm

And there is another just explaining how it works here: http://www.microsoft.com/technet/prodtechnol/winxppro/maintain/rstrplcy.mspx

But the above is not really code unfortunately. Basically its the sort of thing you do when you go to "administration tools->security policy->software restriction" and you deal with all those unrestricted/restricted stuff. I am not so interested in it but well, if you find anything else which can be useful please, throw here.  8)
Posted on 2007-03-16 09:06:04 by codename
hi guys.

Tks both for the answer

Codename

yes.. this is what i want.

I need some code that allows restriction of some apps. I?ll take a look for com to see if it helps.

Btw: this link seems to  not working  http://techlib.info/cossdk/html/233483a0-ff16-4e21-a312-cc57a92124c3.htm

Or... maybe, instead using COM, getting the handle of the desktop control class (it is seems to be a SysListView32 control that displays the itens with big icons -LVS_ICON).

Someone knows how to intercept the handle of the desktop class ? This seems to me easier to use, insetad COM.

Best Regards,

Guga

Posted on 2007-03-16 11:40:01 by Beyond2000!
Strange. Its a direct link and I clicked on it right now and it worked for me.

I am not sure if it might work but well maybe for what you have in mind you may have some use of the FindWindow. Something like:

FindWindow(desktopClass, theWindow);


I think thats it. I am not really sure by heart.
Posted on 2007-03-16 16:12:28 by codename
tks

The code below get the desktop and listview handle... but now.. how to use a procedure with the handle of the listview so i can send them a message ?

I remember using a equate to sendmessage that uses a procedure related to listview controls but i don?t remember which one is:


; Hook windows


(...)

        call 'USER32.GetDesktopWindow'
        call 'USER32.FindWindowExA' eax, 0, {"Progman", 0}, {"Program Manager", 0}
        call 'USER32.FindWindowExA' eax, 0, {"SHELLDLL_DefView", 0}, 0
        mov D$DefViewWnd eax

        call 'USER32.FindWindowExA' D$DefViewWnd, 0, {"SysListView32", 0}, 0
        mov D$ListViewWnd eax
        mov eax D$DefViewWnd


Best Regards,

Guga
Posted on 2007-03-16 16:36:26 by Beyond2000!
Whats the problem?
The window handle you obtained is valid within the context of the code which obtained it, even if the window is owned by another process.
Just SendMessage or PostMessage as usual.
Posted on 2007-03-18 00:26:13 by Homer