Timed Message Box Q's

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi Again,

I thought I could upload an attachment with a post here, but apparently not.
Neither the post nor of course, its attachment have shown up, so I'll do it
this way instead:
The relevant, referenced, form and module are located in a text file at
the following link, without wrapping/mangling, in the event you wish to
peruse the actual, runnable code:

http://download.yousendit.com/E9CB0C653394B67B

And here's the original I tried to post but which failed to show up:
===========
Hi all,

Decided to play in the sandbox today for a change of scenery and since I was
wishing for a timed screen message, decided to try that out.
I chose API's. And mostly what I learned was umpty-leven ways to lock up
VB6 by creating an invisible "something": you tell me and I'll know,
too<G>. That's a rhetorical comment, of course.

So unable to do it myself, I ran out looking for some samples and came
across one I liked and which, for the moment, I'm "stuck with" because I
like it, it's reasonably short and WGLLT. That doesn't mean I'm not open to
alternatives; just that I'd like to target completion of this concept unless
it's all wrong for what I need somehow.
All I really need is a msgbox to trigger & display for abt 3 seconds when
a certain entry error is detected, and then go away on its own
(auto-closing).

Problem is, I had to;
1. dig it out of someone else's code example of multiple msgbox
manipulations and;
2. that done, I'm left with a few questions. Like i said it Works Great,
but I don't understand it all.

The file I robbed from is at:
http://www.mvps.org/vbvision/Sample_Projects.htm#MessageBox_Demo
That URL includes a bookmark, so it should take you right to the selection.
Watch out for wrapping of the URL.


Specifically:

-- I know: '&' data type is long.
-- I have some but not great module experience and NASA intentional API
experience; hence part of my reason for taking this demo code route.

--
"
' the max length of a path for the system (usually 260 or there abouts) '
this is used to size the buffer string for retrieving the class name of the
active window below

Public Const MAX_PATH As Long = 260&
"
I don't -think- I need that line. The program operates fine with it
commented out, but I'm also aware that a path on my system isn't necessarily
a path on another system. I don't seem to have a way to tell if it's needed
or not.
Can you tell if it is anything relevant my my timed msgbox?

--
I've seen before, but cannot now relocate what the encompassing "&" sandwich
is accomplishing:
" Public Const SOMETHING As Long = &H5000&"
Could anyone kindly explain the & (and of course the "H") usage there?
--
And likewise for these declarations:
Public Const WM_CLOSE As Long = &H10& <---
Public Const WM_SETREDRAW As Long = &HB& <---

--
In general I can't seem to locate a listing or inclusive list of API calls.
Guess all I really would like here is a pointer to a source if that's
reasonable; I can lookup the API's used individually if I have to.

--
And, an English language description of:
"
Public Declare Function PostMessage Lib "user32" Alias "PostMessageA"
(ByVal hWnd&, ByVal wMsg&, _
ByVal wParam&, lParam As Any) As Long
"
w/r to "PostMessage" and " "user32" Alias " would help, because I can't
seem to get my head around Help's Help for it.

Finally: I just realized a Type statement isn't used and removed it, but
it's still in the files I attached, so you can ignore that; there's only one
of them. It's used in sizing/positioning the window.

I've probably asked silly questions but even if your response is
to the effect of, "hey, go read ...", that's fine. It's not a lot of
code, but it's pretty muddy water for me right now.

Thanks as always and in advance,

Pop`


.



Relevant Pages

  • Re: Timed Message Box Qs
    ... dig it out of someone else's code example of multiple msgbox ... -- I have some but not great module experience and NASA intentional API ... hence part of my reason for taking this demo code route. ...
    (microsoft.public.vb.general.discussion)
  • Re: Timed Message Box Qs
    ... file at the following link, without wrapping/mangling, in the event ... dig it out of someone else's code example of multiple msgbox ... API experience; hence part of my reason for taking this demo code ...
    (microsoft.public.vb.general.discussion)
  • Re: UserForm - Disable the x button
    ... the solution would be to show a msgbox on pressing the X and not close the form then ... I never disable the little x for the very reason you say! ... Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) ...
    (microsoft.public.excel.programming)
  • Re: Copy A: to C: Folder
    ... : MsgBox SHFileOperation ... The reason I'm using SHFileOp is that the source disks are exam disks ... Although the SHFileOp code seems to be working OK and I intend to use ...
    (comp.lang.basic.visual.misc)
  • Re: Error 2501 Problem when DoubleClicking to Delete Record is Can
    ... The reason it runs the msgbox each time is because it needs to evaluate all ... Private Sub DeleteRecord_DblClick ... >> The reason is because you've put both tests in a single If statement, ... >>> when the answer's "Yes" and i click cancel it gives me the same message ...
    (microsoft.public.access.formscoding)