Jump to content

Use LaunchAdvancedAssociationUI method in AutoIt3


JD2066
 Share

Go to solution Solved by Danyfirex,

Recommended Posts

Hi,

I have a script setup to create a File Association in Windows 8.

I need to use the LaunchAdvancedAssociationUI to open "Default Programs" with my registered application entry selected.

I have looked at http://msdn.microsoft.com/en-us/library/windows/desktop/bb776330(v=vs.85).aspx but I can't figure out how to use that API, in part because I know more about scripting languages like JavaScript, Auto3 Scripts and Bash Shell Scripts. I don't know much about programming languages like C, C+, C#, etc.

Can anyone help me use this API in an AutoIt3 script?

Justin

Link to comment
Share on other sites

Simply go to registry look the aplication registered name. pass it to the function.

Saludos

Link to comment
Share on other sites

Link to comment
Share on other sites

  • Solution

It should be something like this:

Local Const $CLSID_ApplicationAssociationRegistrationUI= '{1968106d-f3b5-44cf-890e-116fcb9ecef1}';
   Local Const $IID_IApplicationAssociationRegistrationUI = '{1f76a169-f994-40ac-8fc8-0959e8874710}';
   Local Const $sTagIApplicationAssociationRegistrationUI = "LaunchAdvancedAssociationUI hresult(wstr)"

  
    Local $oApplicationAssociationRegistrationUI = ObjCreateInterface($CLSID_ApplicationAssociationRegistrationUI, $IID_IApplicationAssociationRegistrationUI,$sTagIApplicationAssociationRegistrationUI)

    
    $oApplicationAssociationRegistrationUI.LaunchAdvancedAssociationUI("here the Registered Application name")

Saludos :P

Edited by Danyfirex
Link to comment
Share on other sites

Thanks Danyfirex. I see your Code and it works. It does not work. I got this error... thanks for yout time....

 

Saludos

Link to comment
Share on other sites

It should be something like this:

Local Const $CLSID_ApplicationAssociationRegistrationUI= '{1968106d-f3b5-44cf-890e-116fcb9ecef1}';
   Local Const $IID_IApplicationAssociationRegistrationUI = '{1f76a169-f994-40ac-8fc8-0959e8874710}';
   Local Const $sTagIApplicationAssociationRegistrationUI = "LaunchAdvancedAssociationUI hresult(wstr)"

  
    Local $oApplicationAssociationRegistrationUI = ObjCreateInterface($CLSID_ApplicationAssociationRegistrationUI, $IID_IApplicationAssociationRegistrationUI,$sTagIApplicationAssociationRegistrationUI)

    
    $oApplicationAssociationRegistrationUI.LaunchAdvancedAssociationUI("here the Registered Application name")

Saludos :P

Thanks for the code, it works.

Link to comment
Share on other sites

  • 6 months later...

Just an update on this, if anyone sees this topic in the future.
In Windows 10 this function will be removed and calls to it will cause a popup to appear notifying the user to go to the settings app to change their Association settings.
The blog post listing this change says:

Changes to how Windows 10 handles default apps: ‘Default apps’ refers to the way that Windows maps file types and protocols (like HTTP) to the Windows applications they open by default. For example, your favorite photo editor may be set as the default app for .JPG files, which means that when you double-click on a .JPG file in File Explorer, it opens in that photo editor. In Windows 8.1, Classic Windows applications (Win32) could invoke the prompt asking you to change your defaults, so you may have seen multiple prompts during install and after they launched. However, Windows Store apps could not invoke this prompt. Instead, a notification banner will appear after your apps are installed telling you that new apps are available and you would click on this banner to change your defaults.

We know your defaults matter to you. With Windows 10, all apps – both Classic Windows apps and Universal Windows apps – will be unable to invoke a prompt to change your defaults, only Windows. You remain in full control of your default experiences, while reducing some of the unwanted noise that multiple prompts can bring.

I don't really understand their logic. Instead of just letting Windows Store Apps call this function so both Win32 apps and Windows Store apps could use it. They decided that neither should be able to call this function.

Edited by JD2066
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...