Click here to Skip to main content
15,891,938 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
How do you use this...I can't seem to find any examples...
C++
HRESULT SetZoneActionPolicy(
    [in] DWORD dwZone,
    [in] DWORD dwAction,
    [in] BYTE *pPolicy,
    [in] DWORD cbPolicy,
    [in] URLZONEREG urlZoneReg
);
Posted
Updated 17-Sep-11 3:16am
v2

Looking at the documentation[^] it's close to useless I must admit, however sometimes that what we lowly Windows developers have to work with. And it's also here we get to show our worth.

I suggest you playing around with IInternetZoneManager[^] especially look at the GetZoneActionPolicy [^] method as it may help you understand what you have to provide to the SetZoneActionPolicy.

I wish I could provide you with some better advice. I wish you the best of luck figuring this one out, if you do it would be worth an article I believe.
 
Share this answer
 
Comments
Member 7766180 16-Sep-11 19:20pm    
Yeah, It's a tough one! I'm searching for some examples, it's kind of difficult with what the documentation gives you. Thank you.
Member 7766180 16-Sep-11 21:42pm    
Have more info.....This is what I need to set.
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Internet Settings\Zones\3]
System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\
Internet Settings\Zones\3]
Value Name: 1803
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = downloads enabled, 3 = downloads disabled)
I have this that I found, Does it help? Some. I still don't see where to set the value.

C++
InternetSecurityZoneManager example;
Creating + getting + setting ZoneActionPolicy
HRESULT hRes = ::CoCreateInstance( CLSID_InternetZoneManager, NULL, CLSCTX_SERVER, IID_IInternetZoneManager,
reinterpret_cast< void ** >( &m_pZone ) );
_ASSERTE( SUCCEEDED( hRes ) );

m_pZone->GetZoneActionPolicy( URLZONE_INTERNET, DOWNLOAD_UNSIGNED_ACTIVEX, reinterpret_cast< BYTE * >( &m_dwOldPolicy ),sizeof( DWORD ), URLZONEREG_HKCU );

DWORD dwPolicy = URLPOLICY_QUERY;
           
m_pZone->SetZoneActionPolicy( URLZONE_INTERNET, 
DOWNLOAD_UNSIGNED_ACTIVEX, 
reinterpret_cast< BYTE * >( &dwPolicy ),
sizeof( DWORD ), URLZONEREG_HKCU );


Maybe someone can make sense of this !!!
 
Share this answer
 
One of these days, you're going to have to tell us what you're up to. The history of your questions raises suspicions.

1) How to get somebody's IP packet sniffer to work.
2) How to pull out the HTML packets from the data sniffed
3) How to check for IP addresses
4) How to get URLs from IP addresses
5) How to supress or modify popup boxes from the browser
6) How to put up your own popup boxes in the browser
7) How to change browser zone policy

Are you being naughty? Do you intend to be naughty?
 
Share this answer
 
Comments
Member 7766180 17-Sep-11 9:38am    
Absolutely not! You have got to be kidding! How about some answers to the question! Thank you!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900