Solved

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

Posted on 2008-10-30
6
289 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
[X]
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
  • 3
  • 3
6 Comments
 

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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

726 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