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? :)
Printable View
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? :)
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"
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.
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"
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.