Solved

create a windows form application(visual basic) to open the file association page in windows vista

Posted on 2008-10-30
6
277 Views
Last Modified: 2013-11-26
hey there

i need to have a windows form application in vb 2005 with just a button on it. by clicking the button i want to open the file association form.

this is a "form" where one can change what filetypes e.g .txt should open with application "notepad"

i have a windows vista machine. please see the attached file
0
Comment
Question by:nikolaosk
  • 3
  • 3
6 Comments
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
0
 

Author Comment

by:nikolaosk
Comment Utility
thanks. would you please provide me with the exact code?
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 250 total points
Comment Utility
didn't the first link gave it to you?

Option Strict On

Imports System.Runtime.InteropServices

Public Module OpenWith

    Public Declare Auto Function OpenWithDialog _
        Lib "shell32.dll" _
        Alias "OpenAs_RunDLL" _
    ( _
        ByVal hwnd As IntPtr, _
        ByVal hinst As IntPtr, _
        ByVal lpFile As String, _
        ByVal nShowCmd As Int32 _
    ) As Int32

End Module

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        OpenWithDialog(Me.Handle, Marshal.GetHINSTANCE(Me.GetType().Module), "", CInt(AppWinStyle.NormalFocus))
    End Sub

End Class
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:nikolaosk
Comment Utility
thanks, but the form that opens is not the one i want. i want the one that you can find in the path

control panel->programs->default programs->set associations
0
 

Author Comment

by:nikolaosk
Comment Utility
hey again....

have you found any way to help me to open the correct association form?
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
I search for the name of the applet and found nothing. sorry
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now