Jump to content

Recommended Posts

Posted

I am writing a custom, non-blocking/event-driven MsgBox function that will emulate the functionality of the builtin MsgBox() function...

Anyway the problem I am having is finding those nice graphics/icons the standard MsgBox() function has... Any ideas guys??

I have been trying:

GUICtrlCreateIcon (@SystemDir & "\SHELL32.dll",Number($icon_no), $border_size, $border_size, $icon_size, $icon_size)

within my GUI but I can't find the icons I am looking for (you know X,?,!.i symbols in the standard MsgBox function)...

Are these icons available in a DLL file somewhere?? I can work out the numbers if someone can give me the name of the file...

A bit of silly project I know... but humour me please!!

Thanks

Bob Wya

Posted

The dll contain the .ico files is C:\WINDOWS\system32\user32.dll

#0 = Window

#1 = Warning

#2 = Question

#3 = Stop

#4 = Info

#5 = Window

I think... Hope it helps :rolleyes:

Posted

Mr Z

You are a star... I finally got the GUI looking (and sounding) the same as the normal message box... Thanks!!

Bob Wya

Posted

right from the help file

check this example how to find the icon index No

$sFileName  = @SystemDir & '\shell32.dll'

; Create a strcuture to store the icon index
$stIcon     =  DllStructCreate("int")

If @OSType = "WIN32_NT" Then
    ; Convert and store the filename as a wide char string
    $nBuffersize    = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "int", 0, "int", 0x00000001, "str", $sFileName, "int", -1, "ptr", 0, "int", 0)
    $stString       = DLLStructCreate("byte[" & 2 * $nBuffersize[0] & "]")
    DllCall("kernel32.dll", "int", "MultiByteToWideChar", "int", 0, "int", 0x00000001, "str", $sFileName, "int", -1, "ptr", DllStructGetPtr($stString), "int", $nBuffersize[0])
Else
    ; Win'9x
    $stString       = DLLStructCreate("char[260]")
    DllStructSetData($stString, 1, $sFileName)
EndIf

; Run the PickIconDlg - '62' is the ordinal value for this function
DllCall("shell32.dll", "none", 62, "hwnd", 0, "ptr", DllStructGetPtr($stString), "int", DllStructGetSize($stString), "ptr", DllStructGetPtr($stIcon))

If @OSType = "WIN32_NT" Then
    ; Convert the new selected filename back from a wide char string
    $nBuffersize    = DllCall("kernel32.dll", "int", "WideCharToMultiByte", "int", 0, "int", 0x00000200, "ptr", DllStructGetPtr($stString), "int", -1, "ptr", 0, "int", 0, "ptr", 0, "ptr", 0)
    $stFile         = DLLStructCreate("char[" & $nBuffersize[0] & "]")
    DllCall("kernel32.dll", "int", "WideCharToMultiByte", "int", 0, "int", 0x00000200, "ptr", DllStructGetPtr($stString), "int", -1, "ptr", DllStructGetPtr($stFile), "int", $nBuffersize[0], "ptr", 0, "ptr", 0)
    $sFileName      = DllStructGetData($stFile, 1)
Else
    $sFileName      = DllStructGetData($stString, 1)
EndIf

$nIconIndex         = DllStructGetData($stIcon, 1)

; Show the new filename and icon index
Msgbox(0, "Info", "Last selected file: " & $sFileName & @LF & "Icon-Index: " & $nIconIndex)

$stBuffer   = 0
$stFile     = 0
$stIcon     = 0

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...