?
Solved

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

Posted on 2008-10-30
6
Medium Priority
?
290 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 1000 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

752 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