Log API FindWindow

Signaler
Messages postés
18
Date d'inscription
dimanche 8 mai 2005
Statut
Membre
Dernière intervention
13 janvier 2006
-
Messages postés
18
Date d'inscription
dimanche 8 mai 2005
Statut
Membre
Dernière intervention
13 janvier 2006
-
Bonjour des types, j'ai besoin de poteau ici pour l'essai obtiens l'aide, dans le forum des Etats-Unis que nous pas pouvons obtenir l'aide, vous suis les experts. J'ai besoin d'un certain petit échantillon dans VB.Net notant n'importe quel programme à employer FindWindow api. Le problème est plus grand, mais si vous voulez le contrôle d'essai ceci.

***
Hi guys, i need post here for try get help, in USA forum we not can get help, you are the experts.

I need some little sample in VB.Net logging any program to using FindWindow API.

Problem is more big, but if you want try check this.
***
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VisualC_PLUS_PLUS_DOT_NET/Q_21678396.html

11 réponses

Messages postés
1356
Date d'inscription
samedi 8 décembre 2001
Statut
Membre
Dernière intervention
23 octobre 2006
8
Voici un exemple

Private
Declare
Function FindWindow
Lib "
user32"
Alias "
FindWindowA" (
ByVAl lpClassName
As
String,
ByVAl lpWindowName
As
String)
As
Long


Private
Declare
Function PostMessage
Lib "
user32"
Alias "
PostMessageA" (
ByVAl hwnd
As
Long,
ByVAl wMsg
As
Long,
ByVAl wParam
As
Long, lParam
As
Any)
As
Long


Private
Declare
Function GetClassName
Lib "
user32"
Alias "
GetClassNameA" (
ByVAl hwnd
As
Long,
ByVAl lpClassName
As
String,
ByVAl nMaxCount
As
Long)
As
Long


Private
Declare
Function ShowWindow
Lib "
user32" (
ByVAl hwnd
As
Long,
ByVAl nCmdShow
As
Long)
As
Long


Const SW_SHOWNORMAL = 1


Const WM_CLOSE = &H10


Const gcClassnameMSWord = "
OpusApp"


Const gcClassnameMSExcel = "
XLMAIN"


Const gcClassnameMSIExplorer = "
IEFrame"


Const gcClassnameMSVBasic = "
wndclass_desked_gsk"


Const gcClassnameNotePad = "
Notepad"


Const gcClassnameMyVBApp = "
ThunderForm"


Private
Sub Form_Load(
)



Dim WinWnd
As
Long, Ret
As
String, RetVal
As
Long, lpClassName
As
String



'Ask For a Window title


Ret = InputBox("
Enter the exact window title:" + Chr$(13) + Chr$(10) + "
Note: must be an exact match"
)



'Search the window


WinWnd = FindWindow(vbNullString, Ret)



If WinWnd = 0
Then
MsgBox "
Couldn't find the window ...":
Exit
Sub



'Show the window


ShowWindow WinWnd, SW_SHOWNORMAL



'Create a buffer


lpClassName = Space(256)



'retrieve the Class name


RetVal = GetClassName(WinWnd, lpClassName, 256)



'Show the classname



MsgBox "
Classname: " + Left$(lpClassName, RetVal)



'Post a message To the window To close itself


PostMessage WinWnd, WM_CLOSE, 0&, 0&


End
Sub

labout
Messages postés
18
Date d'inscription
dimanche 8 mai 2005
Statut
Membre
Dernière intervention
13 janvier 2006

Thank you man, this code working in VB.Net ??


I need log external program using FindWindow.




WinWnd = FindWindow(vbNullString, Ret)


If WinWnd = 0
Then
MsgBox "
Couldn't find the window ...":
Exit
Sub



'Show the window


ShowWindow WinWnd, SW_SHOWNORMAL



You Find and return value to : WinWnd
After use in ShowWindow

How i can similar but when external programs use Findwindow ?
Messages postés
17288
Date d'inscription
mercredi 2 janvier 2002
Statut
Modérateur
Dernière intervention
27 septembre 2021
71
So, If i understood your problem, you want to "spy" (and log) sytem-wide programs which makes calls to the FindWindow API ?
-----
Si j'ai bien compris, vous cherchez à espionner et enregistrer, les applications, qui font appel a l'API FindWindow ?

http://vbfrance.com/code.aspx?ID=22289
http://www.cppfrance.com/code.aspx?ID=23072
http://www.vbfrance.com/code.aspx?ID=22687

Renfield
Admin CodeS-SourceS - MVP Visual Basic
Messages postés
18
Date d'inscription
dimanche 8 mai 2005
Statut
Membre
Dernière intervention
13 janvier 2006

Yes, sorry my English.

FindWindow or WriteProcessMemory

Very Thank you.
Messages postés
18
Date d'inscription
dimanche 8 mai 2005
Statut
Membre
Dernière intervention
13 janvier 2006

Or Some Hook to API FindWindow or WriteProcessMemory for Return incorrect values.

I Need Some code for Stop Cheats programs, most cheats use FindWindow and WriteProcessMemory API.

Thank you.
Messages postés
17288
Date d'inscription
mercredi 2 janvier 2002
Statut
Modérateur
Dernière intervention
27 septembre 2021
71
an easy way to fool such tools, is to store important values (money, energy, etc) in a different way...

ex:
$400 could be stored, as 123456645, using a simple Xor operation....
Messages postés
18
Date d'inscription
dimanche 8 mai 2005
Statut
Membre
Dernière intervention
13 janvier 2006

Is posible after my VB.Net program running, any new program using API WriteProcessMemory or FindWindow will be Closed ?

I detect new process opend using WMI : Win32_ProcessStartTrace

Thank you.
Messages postés
17288
Date d'inscription
mercredi 2 janvier 2002
Statut
Modérateur
Dernière intervention
27 septembre 2021
71
and if the cheat tools is start before ?

no, be serious, you can't close every such programs, these API are not only designed to cheat in your game, you know... You can't close every tierce application you want....

think about crypt your datas, so the cheating tools won't be able to find any useable information
Messages postés
18
Date d'inscription
dimanche 8 mai 2005
Statut
Membre
Dernière intervention
13 janvier 2006

Really, i need Spy or Hook the API WriteProcessMemory or FindWindow filter when this API use data the GAME Process in memory.

When use Findwindow use window name the Game or WriteProcessMemory write data in PID the Game.

Idea is Spy or Log can detect that filter.

My VB.Net proyect is Encrypted, Obfuscated, etc.
but cheat working in Game program, i not have that Source.
I launch from my VB.Net code and return the PID. I can use in filter for Spy or Hook ?

Thank you.
Messages postés
17288
Date d'inscription
mercredi 2 janvier 2002
Statut
Modérateur
Dernière intervention
27 septembre 2021
71
I gave you few links which will allow you to build up such SPY.....
Messages postés
18
Date d'inscription
dimanche 8 mai 2005
Statut
Membre
Dernière intervention
13 janvier 2006

So using Dll the links you can help in some sample in VB.Net, Spy WriteProcessMemory or FindWind API ?

Very Very Thank you.