Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2008-10-30
6
285 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 70

Expert Comment

by:Éric Moreau
ID: 22839748
0
 

Author Comment

by:nikolaosk
ID: 22840998
thanks. would you please provide me with the exact code?
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 250 total points
ID: 22841440
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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:nikolaosk
ID: 22841958
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
ID: 22848974
hey again....

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

Expert Comment

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

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…

829 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