Results 1 to 27 of 27

Thread: Anyone have any questions out there?

  1. #1

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    I find that nobody really answers posts nowadays. So here's my idea: Post to this, and one of the people who have responded will answer, but most likely it will be me . So, what troubles your VB-Life?
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  2. #2
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    Exclamation See Thread Impossible to Answer Question

    http://forums.vb-world.net/showthrea...threadid=25753
    If you want, try your luck at any of the four question I asked. Thanks for your time. Joe

    [Edited by Joey_k29 on 08-09-2000 at 10:55 AM]

  3. #3

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    You could use mciGetCreatorTask, but I don't know how, or you could do this:

    Code:
    Do
       chDir E:\ (or whatever you're CD-ROM drive is)
    Loop until err.number <> 0
    
    'code to excecute when it's open
    I know it's a little far-fetched, but it may work. (Q #4)
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    To your first question, You may be able to do this with obtaining a window handle from the shell. Although, I have no clue how to do the rest. Why do you want to do those things, anyway?
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5
    Lively Member
    Join Date
    Mar 2000
    Location
    Lowestoft
    Posts
    91
    What is the UBound() Function?
    Mag-Net's Home
    Visual Studio 6-Enterprise - SP4
    ICQ: 35519773
    Have Fun

  6. #6

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    The Ubound() function returns the highest number of your array. For example, If I had this code:

    Code:
    Option Base 1
    
    Dim MyArray() as Integer
    
    Private Sub Form_Load()
       Redim MyArray(15)
    
       MsgBox "Ubound returns " & ubound(myarray) & ". Lbound returns " & lbound(myarray) & "."
    
       Msgbox "Ubound should return 15 while lbound will return 1 (option base 1)."
    End Sub
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  7. #7
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352
    I am trying to log what programs are being accessed on the cdrom. Do you have any specific code for the answer to my first question that I may use?

    Thank you Joe

    By the way, unfortunately the cdrom thing did not work. It works if the cdrom is just put in, but if you explore it the code does not execute. Thanks anyway. Any other ideas?

    [Edited by Joey_k29 on 08-09-2000 at 11:31 AM]

  8. #8
    Lively Member
    Join Date
    Mar 2000
    Location
    Lowestoft
    Posts
    91
    Thanks, just wondered what it was, I didnt really need an example, but thanks neway, well that was my question
    Mag-Net's Home
    Visual Studio 6-Enterprise - SP4
    ICQ: 35519773
    Have Fun

  9. #9
    Guest

    Talking Hooks

    How do I log messages sent to other processes?
    I tried to SetWindowLong to my proc, but then i found out it only works if you're trying it on your own window.
    I need some good hooks explanation.

    Anyone?

  10. #10

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    If you mean SubClassing, this will work:

    Code:
    Public Const GWL_WNDPROC = -4
    Public lpPrevWndProc As Long
    
    Public Sub Hook(Frm as Form)
    Dim FrmhWnd as Long
    
       FrmhWnd = frm.hWnd
    
       lpPrevWndProc = SetWindowLong(FrmhWnd,GWL_WNDPROC,AddressOf MyWndProc)
    End Sub
    
    Public Sub UnHook(Frm as Form)
    Dim Temp
    Dim FrmhWnd as Long
    
       FrmhWnd = frm.hWnd
    
       temp = SetWindowLong(FrmhWnd,GWL_WNDPROC,lpPrevWndProc)
    End Sub
    
    Function MyWndProc(ByVal hw As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    
       MsgBox "Message: " & format(now,"HH:MM:SS") & " " & Cstr(hw) & " " & Cstr(uMsg) & " " & CStr(wParam) & " " & CStr(lParam)
    
       MyWndProc = CallWindowProc(lpPrevWndProc, hw, uMsg, wParam, lParam)
    End Function
    That's a short subclassing technique. Call it like this:

    Code:
    Private Sub Form_Load()
       Hook Me
    End Sub
    Private Sub Form_Unload(Cancel As Integer)
       UnHook Me
       Cancel = False
       End
    End Sub
    I didn't just make you call the hWnd in the Hook and Unhook because this way it looks funny.

    Uh...yeah....hook me....hic!


    As you can see, some like it while others do not.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  11. #11
    Guest

    Talking Not really...

    This is easy.

    I know how to do this stuff.
    But in this method i can't hook into windows which are not in my app.

    Any other suggestions?

  12. #12

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134

    Re: Not really...

    Originally posted by Sc0rp

    But in this method i can't hook into windows which are not in my app.

    So, that's you're style. I don't know how to get other program's hWnds, but you may be able to get the window by it's classname, and use that hwnd. Are you trying to do this for winamp? If you are, I can send you my ddraw shell example for Winamp (you can use it to make Visualizers, no royalties or anything). BTW, I'm out for lunch now
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  13. #13
    Lively Member
    Join Date
    Mar 2000
    Posts
    84

    Mp3-Player

    How do ido a good mp3-player.
    Is ther esomething i can use for free

  14. #14
    Guest
    Sastraxi: When dealing with Hooking and SubClassing, it's easier to pass the hWnd of the Form rather than passing the Form itself. This way, you can SubClass other programs.
    Sc0rp: To find the hWnd of a window, use Findwindow
    Code:
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Any, ByVal lpWindowName As Any) As Long
    
    Private Sub Command1_Click()
        'Get the hWnd of Calculator and SubClass it
        hParent = FindWindow(0&, "Calculator")
        SubClass hParent
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
        'Unsubclass Calculator
        UnSubClass hParent
    End Sub

  15. #15
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    There is an exewrap example that logs ussage, i will paste it in here(modified to log only the CD-Rom)

    Code:
    Sub Main()
    On Error GoTo errHandler
    Debug.Print Command$
    
    If Command$ <> "" Then
    Dim i As Integer
    i = InStr(Command$, "\") 'get Position of first slash
    Dim MyStr As String
    MyStr = Left(Command$, i - 1) 'get drive letter
    If MyStr = "D:" Then ' Is it The CD-Rom
    '(code to log usage)
    End If
    Call Shell(Command$, vbNormalFocus) 'Shell that program
    End If
    
    End
    Exit Sub
    errHandler:
    MsgBox Err.Description, vbCritical Or vbOKOnly, Err.Number 'what went wrong
    If Err.Number <> 53 Then
    Call Shell(Command$, vbNormalFocus) 'Make sure the program runs!
    End If
    End Sub
    Change the registry like this
    Code:
    HKEY_CLASSES_ROOT\exefile\shell\open\command to: "C:\exewrap.exe" "%1" %*
    HKEY_CLASSES_ROOT\lnkfile\shell\open\command to: "C:\exewrap.exe" "%1" %*
    HKEY_CLASSES_ROOT\piffileshell\open\command to: "C:\exewrap.exe" "%1" %*
    HKEY_CLASSES_ROOT\batfile\shell\open\command to: "C:\exewrap.exe" "%1" %*
    HKEY_CLASSES_ROOT\com\file\shell\open\command to: "C:\exewrap.exe" "%1" %*
    NOTE: Make sure you put in the correct file path, this program mite lock you out of your computer, so make a back up of this part of your registry, so you can restore it!

    See tip http://www.vb-world.net/tips/tip121.html

  16. #16

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    I know you should pass the hWnd, not the form. I was just pointing out that that is not the correct method, but it was REALLY funny! Hook Me.. Yeah, Hook Me, too!
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  17. #17
    New Member
    Join Date
    Aug 2000
    Posts
    9

    Question Look @ Thread "Making a clock tick" just posted

    Do you have any suggestions?

  18. #18
    Guest
    As I stated there, you would probably need to use a WAV file for that.

  19. #19

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134

    Thumbs up Same Thing!

    I once did the same thing! Here's the code:

    Code:
    --modtick.bas--
    Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
    Public Const SND_ASYNC = &H1         '  play asynchronously
    Const Tick = "tick.wav"
    
    Sub Main()
    Dim A
    Dim OldSecond As Long
    
    OldSecond = Second(Now)
    
    Do
       If Second(Now) <> OldSecond Then
          OldSecond = Second(Now)
          PlayWav Tick, SND_ASYNC
       End If
       DoEvents
    Loop
    
    End Sub
    
    Sub PlayWav(ByVal File As String, Args As Long)
    Dim RET As Long
    
       RET = sndPlaySound(App.Path & "\" & File, Args)
    
    End Sub
    This reply probably has some bugs, but you get the idea.

    [Edited by Sastraxi on 08-09-2000 at 02:17 PM]
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  20. #20

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134

    Abel: MP3's

    I'm pretty sure you could use a DirectX component to do that. I'm not sure, but is the Multimedia aspect of directX DirectPlay or DirectAnimation?
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  21. #21

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    There is a grammatical mistake in the subject of my last post. It should be MP3s, not MP3's.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  22. #22
    Guest

    Talking SubClassing

    Megatron,

    About your reply to my post with FindWindow.
    I know how to find window handles, the problem is that when i try to SetWindowLong to an handle which is not mine, it returns an error.

  23. #23
    Addicted Member
    Join Date
    May 2000
    Posts
    142
    Does anyone know how I can alter the properties of the standard HTML selection list?

    tx

    dvst8
    Secret to long life:
    Keep breathing as long as possible.

  24. #24
    Addicted Member
    Join Date
    May 2000
    Posts
    188

    dependancy information

    OK Here's one for you!

    I need a way to figure out dependancy information for a project (like the way the package and deployment wizard does it) without using the package and deployment wizard. Any ideas anyone?

  25. #25
    Hyperactive Member Paul Warren's Avatar
    Join Date
    Jun 2000
    Location
    UK
    Posts
    282

    Mage33

    Try this site for WinSock stuff -

    http://www.stardust.com/winsock/
    That's Mr Mullet to you, you mulletless wonder.

  26. #26

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Well, too bad that there isn't App.UsedDLLFiles.
    But there is a way, I'm sure of that. You could find out manually, of course.

    Cmdlg32.ocx
    Msvbm60.dll
    mycontr.ocx
    kernel32.dll
    user32.dll

    Stuff like that. API calls from the dll, Controls you are using, MSVBM60.DLL!
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  27. #27

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134

    DVST8:

    I'm not really sure what you're talking about. Can you perhaps give a more detailed explanation?
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width