dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Show Icon from a standard windows DLL in messge box

  1. #1
    Join Date
    Jan 2019
    Posts
    5

    Show Icon from a standard windows DLL in messge box

    Is it possible to use an Icon from one of standard windows DLL in a standard message box?
    I've found several referencing to MessgeBoxIndirect in discussions of this question devoted to other languages, but not for VB.Net.
    I'm interested in using icon #102 from C:\Windows\System32\imageres.dll.
    Thanks in advance.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,349

    Re: Show Icon from a standard windows DLL in messge box

    You could have a look at this thread (as an example): https://programmersheaven.com/discus...g-msgbox-icons
    Then you have to read the MSDN documentation about https://docs.microsoft.com/en-us/win...geboxindirecta and https://docs.microsoft.com/en-us/win...gmsgboxparamsa
    Note that to let MessageBox use some user defined icon you must set the MB_USERICON flag to the dwStyle member of the MSGBOXPARAMS structure.
    And you want to load icon form the external DLL you will have to call LoadLibrary passing the full pass of the DLL and pass the HINSTANCE returned by LoadLibrary to the hInstance member of the MSGBOXPARAMS structure.

    And don't forget the set the icon ID to the lpszIcon using MAKEINTRESOURCE macro!
    Victor Nijegorodov

  3. #3
    Join Date
    Jan 2019
    Posts
    5

    Re: Show Icon from a standard windows DLL in messge box

    Quote Originally Posted by VictorN View Post
    You could have a look at this thread (as an example):
    I've already read that thread but was unsure if it is applicable to VB.NET.
    Moreovere there is no code to just copy, run and see some result.
    Adding such elementary thing like icon seems much harder than make the application core for me
    Anyway thank you. I'll try my best.

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,349

    Re: Show Icon from a standard windows DLL in messge box

    Quote Originally Posted by CadMan View Post
    ... I'll try my best.
    good luck!
    Ask more if you will have some particular problems!
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)