Click to See Complete Forum and Search --> : requests Windows message
GuruAPI
November 28th, 2005, 08:43 AM
WSAAsyncSelect
The WSAAsyncSelect function requests Windows message-based notification of network events for a socket.
This is what MSDN says about WSAAsyncSelect, for me this function works fine and now my question is There is also other function who makes a request for Windows Message (let say for example: Create File, or Registry ... )
kirants
November 28th, 2005, 01:18 PM
I don't understand your question. What kind of notifications are you looking for ?
Are you wanting to be notified of changes to registry or file system and what to be notified of these changes via window message ?
GuruAPI
November 29th, 2005, 04:23 AM
I don't understand your question. What kind of notifications are you looking for ?
Are you wanting to be notified of changes to registry or file system and what to be notified of these changes via window message ?
Yes Kirants this is actually what i look for, i need to be informed via Windows Message quee ... like i says earlier WSAAsyncSelect is a function that ships events for network to windows messages There should be function for shipping other kind of events to message queue
Thx
Marc G
November 29th, 2005, 07:41 AM
It's still not 100% clear what you are trying to do, but you can just send/post your own messages using SendMessage/PostMessage. You can create your own message identifiers starting at WM_APP or by using RegisterWindowMessage (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/messagesandmessagequeues/messagesandmessagequeuesreference/messagesandmessagequeuesfunctions/registerwindowmessage.asp)
GuruAPI
November 29th, 2005, 08:31 AM
Marc G i used RegisterWindowMessage create a certain channel in order recive events from the network
To ship events from network using i have used WSAAsyncSelect who retrive Windows message-based notification of network events for a socket.
So to create another channel to retive another kind of information i have to crete it using RegisterWindowMessage and to write/use a function that should send me on this channel information like file writen on hdd, modify on registry. (This system should work in order to Log Every System Events)
With other words i whant to know if there are function already implemented like WSAAsyncSelect that rerive other kind of events from WIndows Kernel
kirants
November 29th, 2005, 12:44 PM
Unfortunately, there is no such one place to receive all these and you will find all these scattered and non-uniform.
For e.g. you can sniff on file system notifications using
FindFirstChangeNotification (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/findfirstchangenotification.asp)
But, you will also notice that it doesn't post a window message , instead it uses kernel object signalling.. It is upto you to implement some sort of mechanism to post your own message when you hit on these conditions.
GuruAPI
November 29th, 2005, 03:21 PM
Yes kirants thx i see what kind of info that function can bring to me, i will try to use it with file creation/changing/deleting but still remain some questions raised and i donnt know what to solve them ... how can I recive information for registry changes ?
golanshahar
November 29th, 2005, 04:22 PM
Yes kirants thx i see what kind of info that function can bring to me, i will try to use it with file creation/changing/deleting but still remain some questions raised and i donnt know what to solve them ... how can I recive information for registry changes ?
one thing you can do is use API hooking to hook the Registry api functions calls and you will be able to know which key is going to be changed with the new value and also you will be able to know which app trying to make the change.
the cons for this method ( API hooking ) is that its not that trivial here is an article that can help you : API Hooking Revealed (http://www.codeguru.com/Cpp/W-P/system/misc/article.php/c5667)
PS: you can hook also other api like ::CreateFile(..) and such ( like you pointed out in your first post )
Cheers
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.