using MessageBox MessageBoxIcon.Exclamation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dennis C. Drumm

    #1

    using MessageBox MessageBoxIcon.Exclamation

    I have ordered the book .NET Framework Solutions, In Search of the Lost
    Win32
    API by John Paul Meuller which I think will help answer some of my questions
    I have regarding making custom MessageBoxes, but that isn't going to be here
    for a few days. So, I thought I would ask you guys how to put one of hte
    standard MessageBox icons, such as MessageBoxIcon. Exclamation, into my
    custom MessageBox.

    Thanks,

    Dennis


  • Rob Windsor

    #2
    Re: using MessageBox MessageBoxIcon. Exclamation

    Hi Dennis,

    The MessageBox class that's built into the Framework supports that already.

    MessageBox.Show ("Hello, World", "My Message Box", MessageBoxButto ns.OK,
    MessageBoxIcon. Exclamation);

    --
    Rob Windsor
    G6 Consulting
    Toronto, Canada


    "Dennis C. Drumm" <developer@prim acode.com> wrote in message
    news:e$vIrO9cDH A.1536@TK2MSFTN GP09.phx.gbl...[color=blue]
    > I have ordered the book .NET Framework Solutions, In Search of the Lost
    > Win32
    > API by John Paul Meuller which I think will help answer some of my[/color]
    questions[color=blue]
    > I have regarding making custom MessageBoxes, but that isn't going to be[/color]
    here[color=blue]
    > for a few days. So, I thought I would ask you guys how to put one of hte
    > standard MessageBox icons, such as MessageBoxIcon. Exclamation, into my
    > custom MessageBox.
    >
    > Thanks,
    >
    > Dennis
    >
    >[/color]


    Comment

    • Dennis C. Drumm

      #3
      Re: using MessageBox MessageBoxIcon. Exclamation

      Rob,

      I'm creating a CUSTOM MessageBox that has some featues that the standard
      one doesn't. Additional Buttons, for instance.

      Dennis


      "Rob Windsor" <rwindsor@NO.MO RE.SPAM.bigfoot .com> wrote in message
      news:ejcc2d9cDH A.2168@TK2MSFTN GP09.phx.gbl...[color=blue]
      > Hi Dennis,
      >
      > The MessageBox class that's built into the Framework supports that[/color]
      already.[color=blue]
      >
      > MessageBox.Show ("Hello, World", "My Message Box", MessageBoxButto ns.OK,
      > MessageBoxIcon. Exclamation);
      >
      > --
      > Rob Windsor
      > G6 Consulting
      > Toronto, Canada
      >
      >
      > "Dennis C. Drumm" <developer@prim acode.com> wrote in message
      > news:e$vIrO9cDH A.1536@TK2MSFTN GP09.phx.gbl...[color=green]
      > > I have ordered the book .NET Framework Solutions, In Search of the Lost
      > > Win32
      > > API by John Paul Meuller which I think will help answer some of my[/color]
      > questions[color=green]
      > > I have regarding making custom MessageBoxes, but that isn't going to be[/color]
      > here[color=green]
      > > for a few days. So, I thought I would ask you guys how to put one of hte
      > > standard MessageBox icons, such as MessageBoxIcon. Exclamation, into my
      > > custom MessageBox.
      > >
      > > Thanks,
      > >
      > > Dennis
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Jeffrey Tan[MSFT]

        #4
        Re: using MessageBox MessageBoxIcon. Exclamation


        Hi Dennis,

        You can find this icon in the "C:\WINDOWS\sys tem32\user32.dl l".
        As a small trick, you can view the icon in a dll or exe file through the
        "change icon"
        window of short cut file.

        To get specified icon in a file, using ExtractAssociat edIconEx API.

        Sample like this:(I set the form's icon to this icon)
        try
        {
        IntPtr iconindex=(IntP tr)1 ;
        IntPtr iconid;
        IntPtr icon=ExtractAss ociatedIconEx(t his.Handle
        ,@"C:\WINDOWS\s ystem32\user32. dll",ref (IntPtr)iconind ex,out
        (IntPtr)iconid) ;
        this.Icon=Icon. FromHandle(icon );
        }
        catch(Exception ex)
        {
        MessageBox.Show (ex.Message );
        }
        Because this icon is the second icon in user32.dll, you should set the
        index to 1.(start from 0)

        Hope this helps you.

        Best regards,
        Jeffrey Tan
        Microsoft Online Partner Support
        Get Secure! - www.microsoft.com/security
        This posting is provided "as is" with no warranties and confers no rights.

        --------------------
        | Reply-To: "Dennis C. Drumm" <developer@prim acode.com>
        | From: "Dennis C. Drumm" <developer@prim acode.com>
        | References: <e$vIrO9cDHA.15 36@TK2MSFTNGP09 .phx.gbl>
        <ejcc2d9cDHA.21 68@TK2MSFTNGP09 .phx.gbl>
        | Subject: Re: using MessageBox MessageBoxIcon. Exclamation
        | Date: Fri, 5 Sep 2003 16:29:23 -0400
        | Lines: 45
        | X-Priority: 3
        | X-MSMail-Priority: Normal
        | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
        | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
        | Message-ID: <u0X8Bx#cDHA.17 28@TK2MSFTNGP09 .phx.gbl>
        | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
        | NNTP-Posting-Host: ipn36372-d67485.net-resource.net 216.204.76.29
        | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
        | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1827 23
        | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
        |
        | Rob,
        |
        | I'm creating a CUSTOM MessageBox that has some featues that the standard
        | one doesn't. Additional Buttons, for instance.
        |
        | Dennis
        |
        |
        | "Rob Windsor" <rwindsor@NO.MO RE.SPAM.bigfoot .com> wrote in message
        | news:ejcc2d9cDH A.2168@TK2MSFTN GP09.phx.gbl...
        | > Hi Dennis,
        | >
        | > The MessageBox class that's built into the Framework supports that
        | already.
        | >
        | > MessageBox.Show ("Hello, World", "My Message Box", MessageBoxButto ns.OK,
        | > MessageBoxIcon. Exclamation);
        | >
        | > --
        | > Rob Windsor
        | > G6 Consulting
        | > Toronto, Canada
        | >
        | >
        | > "Dennis C. Drumm" <developer@prim acode.com> wrote in message
        | > news:e$vIrO9cDH A.1536@TK2MSFTN GP09.phx.gbl...
        | > > I have ordered the book .NET Framework Solutions, In Search of the
        Lost
        | > > Win32
        | > > API by John Paul Meuller which I think will help answer some of my
        | > questions
        | > > I have regarding making custom MessageBoxes, but that isn't going to
        be
        | > here
        | > > for a few days. So, I thought I would ask you guys how to put one of
        hte
        | > > standard MessageBox icons, such as MessageBoxIcon. Exclamation, into my
        | > > custom MessageBox.
        | > >
        | > > Thanks,
        | > >
        | > > Dennis
        | > >
        | > >
        | >
        | >
        |
        |
        |

        Comment

        • Dennis C. Drumm

          #5
          Re: using MessageBox MessageBoxIcon. Exclamation

          Thanks Jeffrey:

          That is what I was looking for. I wonder why system sounds and icons weren't
          made easier to access from .NET? That's pretty basic stuff for building user
          interface stuff, don't you think?

          Thanks,

          Dennis

          "Jeffrey Tan[MSFT]" <v-jetan@online.mi crosoft.com> wrote in message
          news:Ls3bGiddDH A.2108@cpmsftng xa06.phx.gbl...[color=blue]
          >
          > Hi Dennis,
          >
          > You can find this icon in the "C:\WINDOWS\sys tem32\user32.dl l".
          > As a small trick, you can view the icon in a dll or exe file through the
          > "change icon"
          > window of short cut file.
          >
          > To get specified icon in a file, using ExtractAssociat edIconEx API.
          >
          > Sample like this:(I set the form's icon to this icon)
          > try
          > {
          > IntPtr iconindex=(IntP tr)1 ;
          > IntPtr iconid;
          > IntPtr icon=ExtractAss ociatedIconEx(t his.Handle
          > ,@"C:\WINDOWS\s ystem32\user32. dll",ref (IntPtr)iconind ex,out
          > (IntPtr)iconid) ;
          > this.Icon=Icon. FromHandle(icon );
          > }
          > catch(Exception ex)
          > {
          > MessageBox.Show (ex.Message );
          > }
          > Because this icon is the second icon in user32.dll, you should set the
          > index to 1.(start from 0)
          >
          > Hope this helps you.
          >
          > Best regards,
          > Jeffrey Tan
          > Microsoft Online Partner Support
          > Get Secure! - www.microsoft.com/security
          > This posting is provided "as is" with no warranties and confers no rights.
          >
          > --------------------
          > | Reply-To: "Dennis C. Drumm" <developer@prim acode.com>
          > | From: "Dennis C. Drumm" <developer@prim acode.com>
          > | References: <e$vIrO9cDHA.15 36@TK2MSFTNGP09 .phx.gbl>
          > <ejcc2d9cDHA.21 68@TK2MSFTNGP09 .phx.gbl>
          > | Subject: Re: using MessageBox MessageBoxIcon. Exclamation
          > | Date: Fri, 5 Sep 2003 16:29:23 -0400
          > | Lines: 45
          > | X-Priority: 3
          > | X-MSMail-Priority: Normal
          > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
          > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
          > | Message-ID: <u0X8Bx#cDHA.17 28@TK2MSFTNGP09 .phx.gbl>
          > | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
          > | NNTP-Posting-Host: ipn36372-d67485.net-resource.net 216.204.76.29
          > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
          > | Xref: cpmsftngxa06.ph x.gbl[/color]
          microsoft.publi c.dotnet.langua ges.csharp:1827 23[color=blue]
          > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
          > |
          > | Rob,
          > |
          > | I'm creating a CUSTOM MessageBox that has some featues that the[/color]
          standard[color=blue]
          > | one doesn't. Additional Buttons, for instance.
          > |
          > | Dennis
          > |
          > |
          > | "Rob Windsor" <rwindsor@NO.MO RE.SPAM.bigfoot .com> wrote in message
          > | news:ejcc2d9cDH A.2168@TK2MSFTN GP09.phx.gbl...
          > | > Hi Dennis,
          > | >
          > | > The MessageBox class that's built into the Framework supports that
          > | already.
          > | >
          > | > MessageBox.Show ("Hello, World", "My Message Box",[/color]
          MessageBoxButto ns.OK,[color=blue]
          > | > MessageBoxIcon. Exclamation);
          > | >
          > | > --
          > | > Rob Windsor
          > | > G6 Consulting
          > | > Toronto, Canada
          > | >
          > | >
          > | > "Dennis C. Drumm" <developer@prim acode.com> wrote in message
          > | > news:e$vIrO9cDH A.1536@TK2MSFTN GP09.phx.gbl...
          > | > > I have ordered the book .NET Framework Solutions, In Search of the
          > Lost
          > | > > Win32
          > | > > API by John Paul Meuller which I think will help answer some of my
          > | > questions
          > | > > I have regarding making custom MessageBoxes, but that isn't going to
          > be
          > | > here
          > | > > for a few days. So, I thought I would ask you guys how to put one of
          > hte
          > | > > standard MessageBox icons, such as MessageBoxIcon. Exclamation, into[/color]
          my[color=blue]
          > | > > custom MessageBox.
          > | > >
          > | > > Thanks,
          > | > >
          > | > > Dennis
          > | > >
          > | > >
          > | >
          > | >
          > |
          > |
          > |
          >[/color]


          Comment

          • Jeffrey Tan[MSFT]

            #6
            Re: using MessageBox MessageBoxIcon. Exclamation


            Hi Dennis,

            I am glad what I provided helps you.
            I think the system sound and icons are platform related, so you need use
            windows API to retrieve it.
            Also, the .net is focus on the web application and it is platform
            unrelated, so
            .net provided no class for getting these system information.

            Hope this helps.
            Best regards,
            Jeffrey Tan
            Microsoft Online Partner Support
            Get Secure! - www.microsoft.com/security
            This posting is provided "as is" with no warranties and confers no rights.

            --------------------
            | Reply-To: "Dennis C. Drumm" <developer@prim acode.com>
            | From: "Dennis C. Drumm" <developer@prim acode.com>
            | References: <e$vIrO9cDHA.15 36@TK2MSFTNGP09 .phx.gbl>
            <ejcc2d9cDHA.21 68@TK2MSFTNGP09 .phx.gbl>
            <u0X8Bx#cDHA.17 28@TK2MSFTNGP09 .phx.gbl>
            <Ls3bGiddDHA.21 08@cpmsftngxa06 .phx.gbl>
            | Subject: Re: using MessageBox MessageBoxIcon. Exclamation
            | Date: Mon, 8 Sep 2003 06:27:27 -0400
            | Lines: 122
            | X-Priority: 3
            | X-MSMail-Priority: Normal
            | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
            | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
            | Message-ID: <OIvOuOfdDHA.35 96@TK2MSFTNGP11 .phx.gbl>
            | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
            | NNTP-Posting-Host: ppp-com63.net-resource.com 216.204.2.63
            | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP11.phx.g bl
            | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1831 45
            | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
            |
            | Thanks Jeffrey:
            |
            | That is what I was looking for. I wonder why system sounds and icons
            weren't
            | made easier to access from .NET? That's pretty basic stuff for building
            user
            | interface stuff, don't you think?
            |
            | Thanks,
            |
            | Dennis
            |
            | "Jeffrey Tan[MSFT]" <v-jetan@online.mi crosoft.com> wrote in message
            | news:Ls3bGiddDH A.2108@cpmsftng xa06.phx.gbl...
            | >
            | > Hi Dennis,
            | >
            | > You can find this icon in the "C:\WINDOWS\sys tem32\user32.dl l".
            | > As a small trick, you can view the icon in a dll or exe file through the
            | > "change icon"
            | > window of short cut file.
            | >
            | > To get specified icon in a file, using ExtractAssociat edIconEx API.
            | >
            | > Sample like this:(I set the form's icon to this icon)
            | > try
            | > {
            | > IntPtr iconindex=(IntP tr)1 ;
            | > IntPtr iconid;
            | > IntPtr icon=ExtractAss ociatedIconEx(t his.Handle
            | > ,@"C:\WINDOWS\s ystem32\user32. dll",ref (IntPtr)iconind ex,out
            | > (IntPtr)iconid) ;
            | > this.Icon=Icon. FromHandle(icon );
            | > }
            | > catch(Exception ex)
            | > {
            | > MessageBox.Show (ex.Message );
            | > }
            | > Because this icon is the second icon in user32.dll, you should set the
            | > index to 1.(start from 0)
            | >
            | > Hope this helps you.
            | >
            | > Best regards,
            | > Jeffrey Tan
            | > Microsoft Online Partner Support
            | > Get Secure! - www.microsoft.com/security
            | > This posting is provided "as is" with no warranties and confers no
            rights.
            | >
            | > --------------------
            | > | Reply-To: "Dennis C. Drumm" <developer@prim acode.com>
            | > | From: "Dennis C. Drumm" <developer@prim acode.com>
            | > | References: <e$vIrO9cDHA.15 36@TK2MSFTNGP09 .phx.gbl>
            | > <ejcc2d9cDHA.21 68@TK2MSFTNGP09 .phx.gbl>
            | > | Subject: Re: using MessageBox MessageBoxIcon. Exclamation
            | > | Date: Fri, 5 Sep 2003 16:29:23 -0400
            | > | Lines: 45
            | > | X-Priority: 3
            | > | X-MSMail-Priority: Normal
            | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
            | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
            | > | Message-ID: <u0X8Bx#cDHA.17 28@TK2MSFTNGP09 .phx.gbl>
            | > | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
            | > | NNTP-Posting-Host: ipn36372-d67485.net-resource.net 216.204.76.29
            | > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
            | > | Xref: cpmsftngxa06.ph x.gbl
            | microsoft.publi c.dotnet.langua ges.csharp:1827 23
            | > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
            | > |
            | > | Rob,
            | > |
            | > | I'm creating a CUSTOM MessageBox that has some featues that the
            | standard
            | > | one doesn't. Additional Buttons, for instance.
            | > |
            | > | Dennis
            | > |
            | > |
            | > | "Rob Windsor" <rwindsor@NO.MO RE.SPAM.bigfoot .com> wrote in message
            | > | news:ejcc2d9cDH A.2168@TK2MSFTN GP09.phx.gbl...
            | > | > Hi Dennis,
            | > | >
            | > | > The MessageBox class that's built into the Framework supports that
            | > | already.
            | > | >
            | > | > MessageBox.Show ("Hello, World", "My Message Box",
            | MessageBoxButto ns.OK,
            | > | > MessageBoxIcon. Exclamation);
            | > | >
            | > | > --
            | > | > Rob Windsor
            | > | > G6 Consulting
            | > | > Toronto, Canada
            | > | >
            | > | >
            | > | > "Dennis C. Drumm" <developer@prim acode.com> wrote in message
            | > | > news:e$vIrO9cDH A.1536@TK2MSFTN GP09.phx.gbl...
            | > | > > I have ordered the book .NET Framework Solutions, In Search of the
            | > Lost
            | > | > > Win32
            | > | > > API by John Paul Meuller which I think will help answer some of my
            | > | > questions
            | > | > > I have regarding making custom MessageBoxes, but that isn't going
            to
            | > be
            | > | > here
            | > | > > for a few days. So, I thought I would ask you guys how to put one
            of
            | > hte
            | > | > > standard MessageBox icons, such as MessageBoxIcon. Exclamation,
            into
            | my
            | > | > > custom MessageBox.
            | > | > >
            | > | > > Thanks,
            | > | > >
            | > | > > Dennis
            | > | > >
            | > | > >
            | > | >
            | > | >
            | > |
            | > |
            | > |
            | >
            |
            |
            |

            Comment

            • Dennis C. Drumm

              #7
              Re: using MessageBox MessageBoxIcon. Exclamation

              Jeffrey:

              Here is a follow-up question for you. I was able to extract the icons from
              the dll with one of the many icon editors available out there. Each of the
              icon images in this dll has about 9 different formats for different sizes
              and colors. If I don't edit the icon and delete all but the image I need,
              VS.net will always use the first (?) image type for that icon. In this
              instance a 16/16 bit icon. And the properties for that icon in the image
              properties pane of VS.net is grayed out so I can't change it. How does
              VS.net decide which format of the image it will use and how can I
              programmaticall y change it besides deleting all the formats that I don't
              want it to use?

              Thanks,

              Dennis

              "Jeffrey Tan[MSFT]" <v-jetan@online.mi crosoft.com> wrote in message
              news:Ls3bGiddDH A.2108@cpmsftng xa06.phx.gbl...[color=blue]
              >
              > Hi Dennis,
              >
              > You can find this icon in the "C:\WINDOWS\sys tem32\user32.dl l".
              > As a small trick, you can view the icon in a dll or exe file through the
              > "change icon"
              > window of short cut file.
              >
              > To get specified icon in a file, using ExtractAssociat edIconEx API.
              >
              > Sample like this:(I set the form's icon to this icon)
              > try
              > {
              > IntPtr iconindex=(IntP tr)1 ;
              > IntPtr iconid;
              > IntPtr icon=ExtractAss ociatedIconEx(t his.Handle
              > ,@"C:\WINDOWS\s ystem32\user32. dll",ref (IntPtr)iconind ex,out
              > (IntPtr)iconid) ;
              > this.Icon=Icon. FromHandle(icon );
              > }
              > catch(Exception ex)
              > {
              > MessageBox.Show (ex.Message );
              > }
              > Because this icon is the second icon in user32.dll, you should set the
              > index to 1.(start from 0)
              >
              > Hope this helps you.
              >
              > Best regards,
              > Jeffrey Tan
              > Microsoft Online Partner Support
              > Get Secure! - www.microsoft.com/security
              > This posting is provided "as is" with no warranties and confers no rights.
              >
              > --------------------
              > | Reply-To: "Dennis C. Drumm" <developer@prim acode.com>
              > | From: "Dennis C. Drumm" <developer@prim acode.com>
              > | References: <e$vIrO9cDHA.15 36@TK2MSFTNGP09 .phx.gbl>
              > <ejcc2d9cDHA.21 68@TK2MSFTNGP09 .phx.gbl>
              > | Subject: Re: using MessageBox MessageBoxIcon. Exclamation
              > | Date: Fri, 5 Sep 2003 16:29:23 -0400
              > | Lines: 45
              > | X-Priority: 3
              > | X-MSMail-Priority: Normal
              > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
              > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
              > | Message-ID: <u0X8Bx#cDHA.17 28@TK2MSFTNGP09 .phx.gbl>
              > | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
              > | NNTP-Posting-Host: ipn36372-d67485.net-resource.net 216.204.76.29
              > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
              > | Xref: cpmsftngxa06.ph x.gbl[/color]
              microsoft.publi c.dotnet.langua ges.csharp:1827 23[color=blue]
              > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
              > |
              > | Rob,
              > |
              > | I'm creating a CUSTOM MessageBox that has some featues that the[/color]
              standard[color=blue]
              > | one doesn't. Additional Buttons, for instance.
              > |
              > | Dennis
              > |
              > |
              > | "Rob Windsor" <rwindsor@NO.MO RE.SPAM.bigfoot .com> wrote in message
              > | news:ejcc2d9cDH A.2168@TK2MSFTN GP09.phx.gbl...
              > | > Hi Dennis,
              > | >
              > | > The MessageBox class that's built into the Framework supports that
              > | already.
              > | >
              > | > MessageBox.Show ("Hello, World", "My Message Box",[/color]
              MessageBoxButto ns.OK,[color=blue]
              > | > MessageBoxIcon. Exclamation);
              > | >
              > | > --
              > | > Rob Windsor
              > | > G6 Consulting
              > | > Toronto, Canada
              > | >
              > | >
              > | > "Dennis C. Drumm" <developer@prim acode.com> wrote in message
              > | > news:e$vIrO9cDH A.1536@TK2MSFTN GP09.phx.gbl...
              > | > > I have ordered the book .NET Framework Solutions, In Search of the
              > Lost
              > | > > Win32
              > | > > API by John Paul Meuller which I think will help answer some of my
              > | > questions
              > | > > I have regarding making custom MessageBoxes, but that isn't going to
              > be
              > | > here
              > | > > for a few days. So, I thought I would ask you guys how to put one of
              > hte
              > | > > standard MessageBox icons, such as MessageBoxIcon. Exclamation, into[/color]
              my[color=blue]
              > | > > custom MessageBox.
              > | > >
              > | > > Thanks,
              > | > >
              > | > > Dennis
              > | > >
              > | > >
              > | >
              > | >
              > |
              > |
              > |
              >[/color]


              Comment

              • Dennis C. Drumm

                #8
                Re: using MessageBox MessageBoxIcon. Exclamation

                Jeffrey:

                ..NET also support Windows Forms applications, which are not web based. I
                think .NET supports a number of other platforms besides web applications.

                Dennis

                "Jeffrey Tan[MSFT]" <v-jetan@online.mi crosoft.com> wrote in message
                news:4THXO7fdDH A.2108@cpmsftng xa06.phx.gbl...[color=blue]
                >
                > Hi Dennis,
                >
                > I am glad what I provided helps you.
                > I think the system sound and icons are platform related, so you need use
                > windows API to retrieve it.
                > Also, the .net is focus on the web application and it is platform
                > unrelated, so
                > net provided no class for getting these system information.
                >
                > Hope this helps.
                > Best regards,
                > Jeffrey Tan
                > Microsoft Online Partner Support
                > Get Secure! - www.microsoft.com/security
                > This posting is provided "as is" with no warranties and confers no rights.
                >
                > --------------------
                > | Reply-To: "Dennis C. Drumm" <developer@prim acode.com>
                > | From: "Dennis C. Drumm" <developer@prim acode.com>
                > | References: <e$vIrO9cDHA.15 36@TK2MSFTNGP09 .phx.gbl>
                > <ejcc2d9cDHA.21 68@TK2MSFTNGP09 .phx.gbl>
                > <u0X8Bx#cDHA.17 28@TK2MSFTNGP09 .phx.gbl>
                > <Ls3bGiddDHA.21 08@cpmsftngxa06 .phx.gbl>
                > | Subject: Re: using MessageBox MessageBoxIcon. Exclamation
                > | Date: Mon, 8 Sep 2003 06:27:27 -0400
                > | Lines: 122
                > | X-Priority: 3
                > | X-MSMail-Priority: Normal
                > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
                > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
                > | Message-ID: <OIvOuOfdDHA.35 96@TK2MSFTNGP11 .phx.gbl>
                > | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
                > | NNTP-Posting-Host: ppp-com63.net-resource.com 216.204.2.63
                > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP11.phx.g bl
                > | Xref: cpmsftngxa06.ph x.gbl[/color]
                microsoft.publi c.dotnet.langua ges.csharp:1831 45[color=blue]
                > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
                > |
                > | Thanks Jeffrey:
                > |
                > | That is what I was looking for. I wonder why system sounds and icons
                > weren't
                > | made easier to access from .NET? That's pretty basic stuff for building
                > user
                > | interface stuff, don't you think?
                > |
                > | Thanks,
                > |
                > | Dennis
                > |
                > | "Jeffrey Tan[MSFT]" <v-jetan@online.mi crosoft.com> wrote in message
                > | news:Ls3bGiddDH A.2108@cpmsftng xa06.phx.gbl...
                > | >
                > | > Hi Dennis,
                > | >
                > | > You can find this icon in the "C:\WINDOWS\sys tem32\user32.dl l".
                > | > As a small trick, you can view the icon in a dll or exe file through[/color]
                the[color=blue]
                > | > "change icon"
                > | > window of short cut file.
                > | >
                > | > To get specified icon in a file, using ExtractAssociat edIconEx API.
                > | >
                > | > Sample like this:(I set the form's icon to this icon)
                > | > try
                > | > {
                > | > IntPtr iconindex=(IntP tr)1 ;
                > | > IntPtr iconid;
                > | > IntPtr icon=ExtractAss ociatedIconEx(t his.Handle
                > | > ,@"C:\WINDOWS\s ystem32\user32. dll",ref (IntPtr)iconind ex,out
                > | > (IntPtr)iconid) ;
                > | > this.Icon=Icon. FromHandle(icon );
                > | > }
                > | > catch(Exception ex)
                > | > {
                > | > MessageBox.Show (ex.Message );
                > | > }
                > | > Because this icon is the second icon in user32.dll, you should set the
                > | > index to 1.(start from 0)
                > | >
                > | > Hope this helps you.
                > | >
                > | > Best regards,
                > | > Jeffrey Tan
                > | > Microsoft Online Partner Support
                > | > Get Secure! - www.microsoft.com/security
                > | > This posting is provided "as is" with no warranties and confers no
                > rights.
                > | >
                > | > --------------------
                > | > | Reply-To: "Dennis C. Drumm" <developer@prim acode.com>
                > | > | From: "Dennis C. Drumm" <developer@prim acode.com>
                > | > | References: <e$vIrO9cDHA.15 36@TK2MSFTNGP09 .phx.gbl>
                > | > <ejcc2d9cDHA.21 68@TK2MSFTNGP09 .phx.gbl>
                > | > | Subject: Re: using MessageBox MessageBoxIcon. Exclamation
                > | > | Date: Fri, 5 Sep 2003 16:29:23 -0400
                > | > | Lines: 45
                > | > | X-Priority: 3
                > | > | X-MSMail-Priority: Normal
                > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
                > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
                > | > | Message-ID: <u0X8Bx#cDHA.17 28@TK2MSFTNGP09 .phx.gbl>
                > | > | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
                > | > | NNTP-Posting-Host: ipn36372-d67485.net-resource.net 216.204.76.29
                > | > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
                > | > | Xref: cpmsftngxa06.ph x.gbl
                > | microsoft.publi c.dotnet.langua ges.csharp:1827 23
                > | > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
                > | > |
                > | > | Rob,
                > | > |
                > | > | I'm creating a CUSTOM MessageBox that has some featues that the
                > | standard
                > | > | one doesn't. Additional Buttons, for instance.
                > | > |
                > | > | Dennis
                > | > |
                > | > |
                > | > | "Rob Windsor" <rwindsor@NO.MO RE.SPAM.bigfoot .com> wrote in message
                > | > | news:ejcc2d9cDH A.2168@TK2MSFTN GP09.phx.gbl...
                > | > | > Hi Dennis,
                > | > | >
                > | > | > The MessageBox class that's built into the Framework supports that
                > | > | already.
                > | > | >
                > | > | > MessageBox.Show ("Hello, World", "My Message Box",
                > | MessageBoxButto ns.OK,
                > | > | > MessageBoxIcon. Exclamation);
                > | > | >
                > | > | > --
                > | > | > Rob Windsor
                > | > | > G6 Consulting
                > | > | > Toronto, Canada
                > | > | >
                > | > | >
                > | > | > "Dennis C. Drumm" <developer@prim acode.com> wrote in message
                > | > | > news:e$vIrO9cDH A.1536@TK2MSFTN GP09.phx.gbl...
                > | > | > > I have ordered the book .NET Framework Solutions, In Search of[/color]
                the[color=blue]
                > | > Lost
                > | > | > > Win32
                > | > | > > API by John Paul Meuller which I think will help answer some of[/color]
                my[color=blue]
                > | > | > questions
                > | > | > > I have regarding making custom MessageBoxes, but that isn't[/color]
                going[color=blue]
                > to
                > | > be
                > | > | > here
                > | > | > > for a few days. So, I thought I would ask you guys how to put[/color]
                one[color=blue]
                > of
                > | > hte
                > | > | > > standard MessageBox icons, such as MessageBoxIcon. Exclamation,
                > into
                > | my
                > | > | > > custom MessageBox.
                > | > | > >
                > | > | > > Thanks,
                > | > | > >
                > | > | > > Dennis
                > | > | > >
                > | > | > >
                > | > | >
                > | > | >
                > | > |
                > | > |
                > | > |
                > | >
                > |
                > |
                > |
                >[/color]


                Comment

                • Jeffrey Tan[MSFT]

                  #9
                  Re: using MessageBox MessageBoxIcon. Exclamation


                  Hi Dennis,

                  I use VS.net resource editor to open the user32.dll and set the icon's
                  image type to
                  48X48 and export it as an .ico file.
                  But after I import this ico file into button's image property, I found that
                  the ico was displayed
                  in 16X16 type and just as you said its properties was black and readonly.
                  I used ACDSee to open the ico file and found that its still had 9 image
                  types associated with it.

                  I do not know how you deleted the other 8 image types.

                  As a workaround, I found that if you use ExtractAssociat edIconEx to load
                  the icon and convert it
                  into Icon class then you can adjust its size as you like.
                  Sample code like this:

                  FileStream fs=new FileStream(@"C: \ico101.ico",Fi leMode.Open );
                  fs.Position=0;
                  Icon newicon=new Icon(fs,48,48);
                  Button1.Image=( Image)newicon.T oBitmap();

                  I think the reason that at design time the image property only display
                  16X16 icon is that
                  the VS.net IDE default use Icon class's default constructor(16X 16 size) to
                  load the icon.

                  Hope this helps
                  Best regards,
                  Jeffrey Tan
                  Microsoft Online Partner Support
                  Get Secure! - www.microsoft.com/security
                  This posting is provided "as is" with no warranties and confers no rights.

                  --------------------
                  | Reply-To: "Dennis C. Drumm" <developer@prim acode.com>
                  | From: "Dennis C. Drumm" <developer@prim acode.com>
                  | References: <e$vIrO9cDHA.15 36@TK2MSFTNGP09 .phx.gbl>
                  <ejcc2d9cDHA.21 68@TK2MSFTNGP09 .phx.gbl>
                  <u0X8Bx#cDHA.17 28@TK2MSFTNGP09 .phx.gbl>
                  <Ls3bGiddDHA.21 08@cpmsftngxa06 .phx.gbl>
                  <OIvOuOfdDHA.35 96@TK2MSFTNGP11 .phx.gbl>
                  <4THXO7fdDHA.21 08@cpmsftngxa06 .phx.gbl>
                  | Subject: Re: using MessageBox MessageBoxIcon. Exclamation
                  | Date: Mon, 8 Sep 2003 08:35:19 -0400
                  | Lines: 185
                  | X-Priority: 3
                  | X-MSMail-Priority: Normal
                  | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
                  | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
                  | Message-ID: <#00pLWgdDHA.34 64@TK2MSFTNGP11 .phx.gbl>
                  | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
                  | NNTP-Posting-Host: ppp-com63.net-resource.com 216.204.2.63
                  | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP11.phx.g bl
                  | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1831 72
                  | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
                  |
                  | Jeffrey:
                  |
                  | .NET also support Windows Forms applications, which are not web based. I
                  | think .NET supports a number of other platforms besides web applications.
                  |
                  | Dennis
                  |
                  | "Jeffrey Tan[MSFT]" <v-jetan@online.mi crosoft.com> wrote in message
                  | news:4THXO7fdDH A.2108@cpmsftng xa06.phx.gbl...
                  | >
                  | > Hi Dennis,
                  | >
                  | > I am glad what I provided helps you.
                  | > I think the system sound and icons are platform related, so you need use
                  | > windows API to retrieve it.
                  | > Also, the .net is focus on the web application and it is platform
                  | > unrelated, so
                  | > net provided no class for getting these system information.
                  | >
                  | > Hope this helps.
                  | > Best regards,
                  | > Jeffrey Tan
                  | > Microsoft Online Partner Support
                  | > Get Secure! - www.microsoft.com/security
                  | > This posting is provided "as is" with no warranties and confers no
                  rights.
                  | >
                  | > --------------------
                  | > | Reply-To: "Dennis C. Drumm" <developer@prim acode.com>
                  | > | From: "Dennis C. Drumm" <developer@prim acode.com>
                  | > | References: <e$vIrO9cDHA.15 36@TK2MSFTNGP09 .phx.gbl>
                  | > <ejcc2d9cDHA.21 68@TK2MSFTNGP09 .phx.gbl>
                  | > <u0X8Bx#cDHA.17 28@TK2MSFTNGP09 .phx.gbl>
                  | > <Ls3bGiddDHA.21 08@cpmsftngxa06 .phx.gbl>
                  | > | Subject: Re: using MessageBox MessageBoxIcon. Exclamation
                  | > | Date: Mon, 8 Sep 2003 06:27:27 -0400
                  | > | Lines: 122
                  | > | X-Priority: 3
                  | > | X-MSMail-Priority: Normal
                  | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
                  | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
                  | > | Message-ID: <OIvOuOfdDHA.35 96@TK2MSFTNGP11 .phx.gbl>
                  | > | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
                  | > | NNTP-Posting-Host: ppp-com63.net-resource.com 216.204.2.63
                  | > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP11.phx.g bl
                  | > | Xref: cpmsftngxa06.ph x.gbl
                  | microsoft.publi c.dotnet.langua ges.csharp:1831 45
                  | > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
                  | > |
                  | > | Thanks Jeffrey:
                  | > |
                  | > | That is what I was looking for. I wonder why system sounds and icons
                  | > weren't
                  | > | made easier to access from .NET? That's pretty basic stuff for
                  building
                  | > user
                  | > | interface stuff, don't you think?
                  | > |
                  | > | Thanks,
                  | > |
                  | > | Dennis
                  | > |
                  | > | "Jeffrey Tan[MSFT]" <v-jetan@online.mi crosoft.com> wrote in message
                  | > | news:Ls3bGiddDH A.2108@cpmsftng xa06.phx.gbl...
                  | > | >
                  | > | > Hi Dennis,
                  | > | >
                  | > | > You can find this icon in the "C:\WINDOWS\sys tem32\user32.dl l".
                  | > | > As a small trick, you can view the icon in a dll or exe file through
                  | the
                  | > | > "change icon"
                  | > | > window of short cut file.
                  | > | >
                  | > | > To get specified icon in a file, using ExtractAssociat edIconEx API.
                  | > | >
                  | > | > Sample like this:(I set the form's icon to this icon)
                  | > | > try
                  | > | > {
                  | > | > IntPtr iconindex=(IntP tr)1 ;
                  | > | > IntPtr iconid;
                  | > | > IntPtr icon=ExtractAss ociatedIconEx(t his.Handle
                  | > | > ,@"C:\WINDOWS\s ystem32\user32. dll",ref (IntPtr)iconind ex,out
                  | > | > (IntPtr)iconid) ;
                  | > | > this.Icon=Icon. FromHandle(icon );
                  | > | > }
                  | > | > catch(Exception ex)
                  | > | > {
                  | > | > MessageBox.Show (ex.Message );
                  | > | > }
                  | > | > Because this icon is the second icon in user32.dll, you should set
                  the
                  | > | > index to 1.(start from 0)
                  | > | >
                  | > | > Hope this helps you.
                  | > | >
                  | > | > Best regards,
                  | > | > Jeffrey Tan
                  | > | > Microsoft Online Partner Support
                  | > | > Get Secure! - www.microsoft.com/security
                  | > | > This posting is provided "as is" with no warranties and confers no
                  | > rights.
                  | > | >
                  | > | > --------------------
                  | > | > | Reply-To: "Dennis C. Drumm" <developer@prim acode.com>
                  | > | > | From: "Dennis C. Drumm" <developer@prim acode.com>
                  | > | > | References: <e$vIrO9cDHA.15 36@TK2MSFTNGP09 .phx.gbl>
                  | > | > <ejcc2d9cDHA.21 68@TK2MSFTNGP09 .phx.gbl>
                  | > | > | Subject: Re: using MessageBox MessageBoxIcon. Exclamation
                  | > | > | Date: Fri, 5 Sep 2003 16:29:23 -0400
                  | > | > | Lines: 45
                  | > | > | X-Priority: 3
                  | > | > | X-MSMail-Priority: Normal
                  | > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
                  | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
                  | > | > | Message-ID: <u0X8Bx#cDHA.17 28@TK2MSFTNGP09 .phx.gbl>
                  | > | > | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
                  | > | > | NNTP-Posting-Host: ipn36372-d67485.net-resource.net 216.204.76.29
                  | > | > | Path:
                  cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
                  | > | > | Xref: cpmsftngxa06.ph x.gbl
                  | > | microsoft.publi c.dotnet.langua ges.csharp:1827 23
                  | > | > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
                  | > | > |
                  | > | > | Rob,
                  | > | > |
                  | > | > | I'm creating a CUSTOM MessageBox that has some featues that the
                  | > | standard
                  | > | > | one doesn't. Additional Buttons, for instance.
                  | > | > |
                  | > | > | Dennis
                  | > | > |
                  | > | > |
                  | > | > | "Rob Windsor" <rwindsor@NO.MO RE.SPAM.bigfoot .com> wrote in message
                  | > | > | news:ejcc2d9cDH A.2168@TK2MSFTN GP09.phx.gbl...
                  | > | > | > Hi Dennis,
                  | > | > | >
                  | > | > | > The MessageBox class that's built into the Framework supports
                  that
                  | > | > | already.
                  | > | > | >
                  | > | > | > MessageBox.Show ("Hello, World", "My Message Box",
                  | > | MessageBoxButto ns.OK,
                  | > | > | > MessageBoxIcon. Exclamation);
                  | > | > | >
                  | > | > | > --
                  | > | > | > Rob Windsor
                  | > | > | > G6 Consulting
                  | > | > | > Toronto, Canada
                  | > | > | >
                  | > | > | >
                  | > | > | > "Dennis C. Drumm" <developer@prim acode.com> wrote in message
                  | > | > | > news:e$vIrO9cDH A.1536@TK2MSFTN GP09.phx.gbl...
                  | > | > | > > I have ordered the book .NET Framework Solutions, In Search of
                  | the
                  | > | > Lost
                  | > | > | > > Win32
                  | > | > | > > API by John Paul Meuller which I think will help answer some
                  of
                  | my
                  | > | > | > questions
                  | > | > | > > I have regarding making custom MessageBoxes, but that isn't
                  | going
                  | > to
                  | > | > be
                  | > | > | > here
                  | > | > | > > for a few days. So, I thought I would ask you guys how to put
                  | one
                  | > of
                  | > | > hte
                  | > | > | > > standard MessageBox icons, such as MessageBoxIcon. Exclamation,
                  | > into
                  | > | my
                  | > | > | > > custom MessageBox.
                  | > | > | > >
                  | > | > | > > Thanks,
                  | > | > | > >
                  | > | > | > > Dennis
                  | > | > | > >
                  | > | > | > >
                  | > | > | >
                  | > | > | >
                  | > | > |
                  | > | > |
                  | > | > |
                  | > | >
                  | > |
                  | > |
                  | > |
                  | >
                  |
                  |
                  |

                  Comment

                  Working...