Re: I want a msgbox to display BIG and LITTLE instead of YES and NO
- From: "Terry Kreft" <terry.kreft@xxxxxxxxx>
- Date: Fri, 14 Oct 2005 10:21:02 +0100
You've got a space missing after AddressOf
AddressOfMsgBoxHookProc
should be
AddressOf MsgBoxHookProc
--
Terry Kreft
"MLH" <CRCI@xxxxxxxxxxxxxx> wrote in message
news:jn1tk1tv3s1ocsbkenr84qtk7ehqlh02e6@xxxxxxxxxx
> Cool solution. However, I had a problem in the "With" Statement
> of the following function. I'm sure its a typo - just dunno what to
> substitute for AddressOfMsgBoxHookProc.
>
> Public Function MessageBoxH(hwndThreadOwner As Long, hwndOwner As
> Long) As Long
>
> 'Wrapper function for the MessageBox API
>
> Dim hInstance As Long
> Dim hThreadId As Long
>
> 'Set up the CBT (computer-based training) hook
> hInstance = GetWindowLong(hwndThreadOwner, GWL_HINSTANCE)
> hThreadId = GetCurrentThreadId()
>
> 'set up the MSGBOX_HOOK_PARAMS values
> 'By specifying a Windows hook as one
> 'of the params, we can intercept messages
> 'sent by Windows and thereby manipulate
> 'the dialog
> With MSGHOOK
> .hwndOwner = hwndOwner
> .hHook = SetWindowsHookEx(WH_CBT, _
> AddressOfMsgBoxHookProc, _
> hInstance, hThreadId)
> End With
>
> 'call the MessageBox API and return the
> 'value as the result of the function. The
> 'Space$(120) statements assures the messagebox
> 'is wide enough for the message that will
> 'be set in the hook.
> '
> 'NOTE: I am setting the text in the hook only
> 'for demo purposes, to show how its done. You
> 'certainly can pass the title and prompt text
> 'right in the API call instead.
> MessageBoxH = MessageBox(hwndOwner, _
> Space$(120), _
> Space$(120), _
> MB_ABORTRETRYIGNORE Or MB_ICONINFORMATION)
>
> End Function
>
.
- Follow-Ups:
- References:
- Prev by Date: Re: How To Use The Len Function To Count A Space
- Next by Date: Re: I want a msgbox to display BIG and LITTLE instead of YES and NO
- Previous by thread: Re: I want a msgbox to display BIG and LITTLE instead of YES and NO
- Next by thread: Re: I want a msgbox to display BIG and LITTLE instead of YES and NO
- Index(es):
Relevant Pages
|