Click here to Skip to main content
13,089,433 members (58,758 online)
Rate this:
Please Sign up or sign in to vote.
See more:
How do you use this...I can't seem to find any examples...
HRESULT SetZoneActionPolicy(
    [in] DWORD dwZone,
    [in] DWORD dwAction,
    [in] BYTE *pPolicy,
    [in] DWORD cbPolicy,
    [in] URLZONEREG urlZoneReg
Posted 16-Sep-11 12:51pm
Updated 17-Sep-11 3:16am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
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)
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I have this that I found, Does it help? Some. I still don't see where to set the value.

InternetSecurityZoneManager example;
Creating + getting + setting ZoneActionPolicy
HRESULT hRes = ::CoCreateInstance( CLSID_InternetZoneManager, NULL, CLSCTX_SERVER, IID_IInternetZoneManager,
reinterpret_cast< void ** >( &m_pZone ) );
m_pZone->GetZoneActionPolicy( URLZONE_INTERNET, DOWNLOAD_UNSIGNED_ACTIVEX, reinterpret_cast< BYTE * >( &m_dwOldPolicy ),sizeof( DWORD ), URLZONEREG_HKCU );
m_pZone->SetZoneActionPolicy( URLZONE_INTERNET, 
reinterpret_cast< BYTE * >( &dwPolicy ),

Maybe someone can make sense of this !!!
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

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?
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 17 Sep 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100