473,807 Members | 2,763 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I want a msgbox to display BIG and LITTLE instead of YES and NO

MLH
Can I control what text appears on msgbox function buttons?
Sure do like NOT having to build a form to show a msg
and solicit a YES/NO response. MsgBox function is a great solution
for that.

Sure would like NOT to have to build a form to show a msg
and solicit a BIG/LITTLE or ON/OFF or RED/BLUE response.
Wish I could pop up a msgbox and assign the text i wanted onto
the button(s). Possible?
Nov 13 '05
17 2641
Yim,
I seem t remember the discussion but can't remember the details. I'm sure a
Google search would bring it up. IIRC it's to do with running hook
procedures with the VBA IDE open.

--
Terry Kreft

"Tim Marshall" <TI****@PurpleP andaChasers.Moe rtherium> wrote in message
news:di******** **@coranto.ucs. mun.ca...
Terry Kreft wrote:
Look at
http://vbnet.mvps.org/code/hooks/messageboxhook.htm


Hi Terry,

I seem to recall a few years ago on cdma a discussion on some issues using
windows hooks (if that's the correct term). Is Randy Birch's method free
of this issue, if there indeed was an issue I mentioned (I could be
imagining it, I'm not sure...)?
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me

Nov 13 '05 #11
It's a bug with three possible workarounds.

1) Place your subclassing code in an external DLL.

2) Distribute your code a MDE solution. This will guarantee the VB IDE is
never open during a session.

3) Distribute a MDB but guarantee 100% that the VB IDE window will never be
open during a session and no errors are unhandled.

Basically, if you can guarantee that the VB IDE will never be opened during
a session then bug will not appear.

I always prefer to distribute subclassing solutions within a standard
Windows DLL produced in C++. This method has worked 100% of the time.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Terry Kreft" <te*********@mp s.co.uk> wrote in message
news:CF******** ************@ka roo.co.uk...
Yim,
I seem t remember the discussion but can't remember the details. I'm sure
a Google search would bring it up. IIRC it's to do with running hook
procedures with the VBA IDE open.

--
Terry Kreft

"Tim Marshall" <TI****@PurpleP andaChasers.Moe rtherium> wrote in message
news:di******** **@coranto.ucs. mun.ca...
Terry Kreft wrote:
Look at
http://vbnet.mvps.org/code/hooks/messageboxhook.htm


Hi Terry,

I seem to recall a few years ago on cdma a discussion on some issues
using windows hooks (if that's the correct term). Is Randy Birch's
method free of this issue, if there indeed was an issue I mentioned (I
could be imagining it, I'm not sure...)?
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me


Nov 13 '05 #12
MLH
Darn it! Something else must be wrong then. My code text
turns RED when I put in the space. When I press F1 on
the AddressOf keyword, I get a msg telling me the HELP
file doesn't exist and I should contact my vendor for an
updated HELP file. Maybe I'm improperly configured to
utilize AddressOf - never have tried before.
xxxxxxxxxxxxxxx xxxxxxxxxxxxx

You've got a space missing after AddressOf
AddressOfMsgBox HookProc

should be
AddressOf MsgBoxHookProc


Nov 13 '05 #13

You didn't miss anything. Access 97 doesn't have the AddressOf
function built in as the later versions do.

You can, however, simulate it with the AddrOf function:
<http://groups.google.c om/group/es.comp.bd.ms-access/msg/795ffb7a56934ab 4?hl=en&>

(Which won't work in Access 2000 or higher. Of course, there's little
need, since in those versions, AddressOf works!)
On Mon, 17 Oct 2005 14:14:22 -0400, MLH <CR**@NorthStat e.net> wrote:
Darn it! Something else must be wrong then. My code text
turns RED when I put in the space. When I press F1 on
the AddressOf keyword, I get a msg telling me the HELP
file doesn't exist and I should contact my vendor for an
updated HELP file. Maybe I'm improperly configured to
utilize AddressOf - never have tried before.
xxxxxxxxxxxxxx xxxxxxxxxxxxxx

You've got a space missing after AddressOf
AddressOfMsgBox HookProc

should be
AddressOf MsgBoxHookProc

--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

Nov 13 '05 #14
MLH
Thanks, Chuck. Will grab that today and have a look at it.
xxxxxxxxxxxxxxx xxxxxxxxxxxxx
On Mon, 17 Oct 2005 16:59:49 -0500, Chuck Grimsby
<c.*******@worl dnet.att.net.in valid> wrote:

You didn't miss anything. Access 97 doesn't have the AddressOf
function built in as the later versions do.

You can, however, simulate it with the AddrOf function:
<http://groups.google.c om/group/es.comp.bd.ms-access/msg/795ffb7a56934ab 4?hl=en&>

(Which won't work in Access 2000 or higher. Of course, there's little
need, since in those versions, AddressOf works!)
On Mon, 17 Oct 2005 14:14:22 -0400, MLH <CR**@NorthStat e.net> wrote:
Darn it! Something else must be wrong then. My code text
turns RED when I put in the space. When I press F1 on
the AddressOf keyword, I get a msg telling me the HELP
file doesn't exist and I should contact my vendor for an
updated HELP file. Maybe I'm improperly configured to
utilize AddressOf - never have tried before.
xxxxxxxxxxxxx xxxxxxxxxxxxxxx

You've got a space missing after AddressOf
AddressOfMsgBox HookProc

should be
AddressOf MsgBoxHookProc


Nov 13 '05 #15
MLH
Got it. Accepts a string, returns a long...
Public Function AddrOf(strFuncN ame As String) As Long

I still have a bit of a problem, though. Look at this snippet. I have
changed AddressOf to AddrOf, added AddrOf to my project and
tested this. Still failing at compile time. Could it be that AddrOf
expects a string and MsgBoxHookProc returns a Long? There problem
is there in the confines of the With statement at the end of the
snippet.

Public Function MessageBoxH(hwn dThreadOwner 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(h wndThreadOwner, GWL_HINSTANCE)
hThreadId = GetCurrentThrea dId()

'set up the MSGBOX_HOOK_PAR AMS 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 = SetWindowsHookE x(WH_CBT, _
AddrOf MsgBoxHookProc, _
hInstance, hThreadId)
End With

You can, however, simulate it with the AddrOf function:
<http://groups.google.c om/group/es.comp.bd.ms-access/msg/795ffb7a56934ab 4?hl=en&>


Nov 13 '05 #16

Here's your problem:

.hHook = SetWindowsHookE x(WH_CBT, _
AddrOf MsgBoxHookProc, _
hInstance, hThreadId)
Should be:

.hHook = SetWindowsHookE x(WH_CBT, _
AddrOf("MsgBoxH ookProc"), _
hInstance, hThreadId)

As you mentioned, it "Accepts a string". AddrOf needs to know the
_name_ of the function, so you need to pass it the name, and thus it
needs to be in quotes.

Oh, I suppose you could always do something like:

Const strWhatFunction ToAddressOf As String = "MsgBoxHookProc "
.hHook = SetWindowsHookE x(WH_CBT, _
AddrOf(strWhatF unctionToAddres sOf), _
hInstance, hThreadId)

but that seems a bit silly! <Grin>
By the way, you might want to go to
<http://www.mentalis.or g/index2.shtml> and download their API viewer.
It's a bit dated (Last update in 2002), but it's still a valuable
resource for doing API work.
On Tue, 18 Oct 2005 11:11:34 -0400, MLH <CR**@NorthStat e.net> wrote:
Got it. Accepts a string, returns a long...
Public Function AddrOf(strFuncN ame As String) As Long I still have a bit of a problem, though. Look at this snippet. I have
changed AddressOf to AddrOf, added AddrOf to my project and
tested this. Still failing at compile time. Could it be that AddrOf
expects a string and MsgBoxHookProc returns a Long?

--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

Nov 13 '05 #17
MLH
A gentleman and a scholar. Thx very much, Chuck.
Nov 13 '05 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
4583
by: Frances Del Rio | last post by:
I have a bunch of Photoshop images on my server, I want when user clicks on a link to a Photoshop img for it to start downloading (like when you click on a Word file..) how can I do that? thank you.. Frances
3
5716
by: Simone | last post by:
Hello!!! Here is the thing. I have had this problem and I want to address it now where in the next and previous button DoCmd.GoToRecord , , acNext - DoCmd.GoToRecord , , acPrevious I wish the message that displays to the user when there is no more record to got to was something different then **You can't go to the specific record** Has anyone ever changed to say something different?
14
114101
by: Ant | last post by:
Hello, I'm a newbie to C#. Does it have a Msgbox function like VB6 i.e. MsgBox "Hello World". What is the equivelant function? Does it have one? Thanks for your time on this simple question
3
1281
by: Phoebe. | last post by:
Hi, Good Day! I need to display a msgbox asking user whether to delete a record or not using javascript. It works fine. Later on user request to add in more info in that msgbox, displaying records info like employee no, employee name, i.e. i need this msgbox to be display during runtime & not during pageload.
6
11128
by: rroman | last post by:
I've tried the good old fashioned msgBox but I get: It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
10
4572
by: z | last post by:
I just installed Visual Studio .Net with Framework 1.1. I already had VB6 SP6 installed. I wanted to do a quick "hello world" example in VB.Net. The code is here: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim s As String Dim r As Long
4
6892
by: | last post by:
I have about 20 MsgBox occurance in by program, which I use to inform the user of the progress of the program, or ask confirmation of an action, or simply to act separators to various parts of the program. They all vary in size and shape depending on the text length. To make the looks of the program more consistant, I made the FIRST and LAST line a series of "======" 65 characters long. Windows displays Message Box text using a...
9
3435
by: Ivan Jericevich | last post by:
In my code below at the line 'response' a blip sound is heard and the program exits the sub -- No MsgBox is displayed. What am I doing wrong? If nonNumberEntered = True Then msg = "Enter numbers only" style = MsgBoxStyle.OkOnly title = "ERROR in cast"
2
7663
by: JB | last post by:
Hi All, I've been using MsgBox function in VB for years and now that I've moved to .NET, I'd like to do something a little bit more fancy. I would like to create a message box that can be expanded to display more details about an error. I have 2 questions about that: 1 - Is there something like an expandable Message Box built in VB.NET or will I have to create the form and do all the resizing myself? 2 - How can I display the icon like...
0
9599
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10111
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5684
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.