|
-
Feb 20th, 2006, 08:28 AM
#1
[VERY MUCH UNRESOLVED, THANK YOU iPRANK] test
Last edited by bushmobile; Jan 5th, 2007 at 12:35 PM.
-
May 12th, 2006, 08:12 AM
#2
Last edited by bushmobile; Aug 24th, 2006 at 01:51 PM.
-
May 28th, 2006, 10:31 AM
#3
-
May 31st, 2006, 10:22 AM
#4
Re: test
 Originally Posted by Sahuja Ali
********s
Shouldn't it be, J*****s
Edit: You think you can get away with it ?
-
Jun 13th, 2006, 11:23 AM
#5
Change MsgBox button's text without subclassing
In module:
VB Code:
Option Explicit
Private Declare Function SetTimer Lib "user32" _
(ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, _
ByVal lpTimerFunc As Long) As Long
Private Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, _
ByVal nIDEvent As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
(ByVal hwndParent As Long, ByVal hwndChildAfter As Long, _
ByVal lpszClass As String, ByVal lpszWindow As String) As Long
Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" _
(ByVal hwnd As Long, ByVal lpString As String) As Long
Private Const NV_MSGBOX As Long = &H5000&
Private sBut(2) As String, sTit As String
Public Function CustMsgBox(ByVal F As Form, ByVal sText As String, ByVal sTitle As String, _
ByVal Picture As VbMsgBoxStyle, _
ByVal sButton1 As String, _
Optional ByVal sButton2 As String, _
Optional ByVal sButton3 As String) As Long
Dim N As Long, lBut As Long, lRet As Long
sTit = sTitle
sBut(0) = sButton1: sBut(1) = sButton2: sBut(2) = sButton3
SetTimer F.hwnd, NV_MSGBOX, 10, AddressOf ChangeButtons
For N = 0 To 2
If Len(sBut(N)) Then lBut = lBut + 1
Next N
lRet = MsgBox(sText, Picture Or (lBut - 1), sTitle)
If lRet > 2 Then lRet = lRet - 2
CustMsgBox = lRet
End Function
Private Sub ChangeButtons(ByVal plngHandle As Long, ByVal uMsg As Long, _
ByVal plngEventId As Long, ByVal dwTime As Long)
Dim lhWnd As Long, lhBut As Long, lhTemp As Long, N As Long
lhWnd = FindWindow("#32770", sTit)
For N = 0 To 2
If Len(sBut(N)) Then
Do
lhTemp = FindWindowEx(lhWnd, lhBut, "Button", vbNullString)
Loop While lhTemp = lhBut
lhBut = lhTemp
SetWindowText lhBut, sBut(N)
End If
Next N
KillTimer plngHandle, plngEventId
End Sub
You then call it like this:
VB Code:
Private Sub Command1_Click()
Dim lRet As Long
lRet = CustMsgBox(Me, "Click a button", "MsgBox Title", vbExclamation, "button1", "button2", "button3")
' lRet is the number of the button pressed, either button 1, 2 or 3
End Sub
-
Jan 4th, 2007, 07:09 AM
#6
Last edited by bushmobile; Nov 25th, 2009 at 05:57 PM.
-
Jan 5th, 2007, 12:10 PM
#7
Re: test
You,
Mark Thread Resolved
....
Last edited by iPrank; Jan 5th, 2007 at 12:14 PM.
-
Jan 5th, 2007, 12:35 PM
#8
Re: [VERY MUCH UNRESOLVED, THANK YOU iPRANK] test
i fly in the face of your suggestion!
-
Jan 17th, 2007, 12:33 PM
#9
Re: [VERY MUCH UNRESOLVED, THANK YOU iPRANK] test
Last edited by timeshifter; Mar 23rd, 2007 at 09:33 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|