dcsimg
Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Need some VB help.

  1. #11
    Senior Member
    Join Date
    Feb 2002
    Posts
    262
    ahhhhhhh I can't get it working....well I can run it with out errors but its just not doing anything so I'm guessing I'm putting some thing wrong in Wnd = SearchWindow but i dunno, any help?
    aislinn, Aria, BTBAM, chevelle, codeseven, Cky, dredg, evergreen terrace, from autumn to ashes,hopesfall, hxc, luti-kriss, nirvana, norma jean, shai hulud, this hero dies, tool, underoath, zao,

  2. #12
    Senior Member
    Join Date
    Aug 2001
    Posts
    100
    sorry Mucolaca

    after cutting out some unneeded things it should work now

    'begin code listing
    Attribute VB_Name = "Module1"
    Option Explicit

    Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Const WM_CLOSE = &H10

    Sub main()

    Dim number, ending

    number = FindWindow(vbNullString, "Unbenannt - Editor")
    ending = SendMessage(number, WM_CLOSE, 0, 0&)

    End Sub
    'end code listing

    i know it looks shorter than befor but it works...
    in findwindow input the window name

    -----------------------------------------------------------------------------------------------------------------------
    "Knowledge is the Real Power"
    \"Knowledge is the Real Power\"

  3. #13
    Senior Member
    Join Date
    Feb 2002
    Posts
    262
    lol its ok but thanks for the help, but I keep getting a syntax error w/ Attribute VB_Name = "Module1" I still got to play around with it some so I will see if i can get it working later to night.
    aislinn, Aria, BTBAM, chevelle, codeseven, Cky, dredg, evergreen terrace, from autumn to ashes,hopesfall, hxc, luti-kriss, nirvana, norma jean, shai hulud, this hero dies, tool, underoath, zao,

  4. #14
    Hey Muco, I didn't bother to read the whole code, but it would be a good idea to check up all those APIs... Use API Viewer (standard w/ vss 6.0)


    You don't need to add attribute_vbname, thats just to say he's put the code in "module1".
    And take out option explicit, it will conflict with "dim number, ending"
    WE ARE the anti cancer...
    WE ARE the only answer...
    email

  5. #15
    Haha, my friend and I made a computer prank that you input the time and it will shutdown the computer at that specific time. Not what you are looking for though sorry.
    Sitting Duck Security check it out

    (All right, all right, you guys talked me into it, I will just learn PHP instead of using ASP.)

Posting Permissions

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