Solved

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

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
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 Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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…

773 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