473,806 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows CBT Hooks (Help!)

I hope you can answer a question. I am writing a poker utility that
tracks what windows are open and displays information about opponents
that are still playing and their previous history that is stored in a
game DB. It is a very cool project with Pattern Recognition (Pixel
Screen SCraping to OCR) and pretty advanced calculations. I
just started writing my first prototype in C# and discovered that I
could not set a System Wide CBT hook.

..Net will not allow hooks CBT hooks to be set globally, period! Works
for mouse and keyboard, but not CBT.

I need to trap when a window is created, destroyed, gotfocus, or
resized. I do not want to cancel or redirect those messages. I just
need to get new rect information about the window.

I have discovered ways of doing it in either VB6 or C++. I am not sure
which is the best strategy to pursue. I do not code in either
language. Can I have this hook in VB or C++ and then call my C#
function? Anone have any suggestions for interacting in between
managed and unmanaged code when the unmanaged code needs to trigger a
C# method?
Thanks,

Andy

Jan 15 '07 #1
2 2407
Hi Andy,
take a look at the following link, it might be able to help you:
http://www.codeproject.com/csharp/GlobalSystemHook.asp

Mark.
--
http://www.markdawson.org
http://themightycoder.spaces.live.com

"an******@gmail .com" wrote:
I hope you can answer a question. I am writing a poker utility that
tracks what windows are open and displays information about opponents
that are still playing and their previous history that is stored in a
game DB. It is a very cool project with Pattern Recognition (Pixel
Screen SCraping to OCR) and pretty advanced calculations. I
just started writing my first prototype in C# and discovered that I
could not set a System Wide CBT hook.

..Net will not allow hooks CBT hooks to be set globally, period! Works
for mouse and keyboard, but not CBT.

I need to trap when a window is created, destroyed, gotfocus, or
resized. I do not want to cancel or redirect those messages. I just
need to get new rect information about the window.

I have discovered ways of doing it in either VB6 or C++. I am not sure
which is the best strategy to pursue. I do not code in either
language. Can I have this hook in VB or C++ and then call my C#
function? Anone have any suggestions for interacting in between
managed and unmanaged code when the unmanaged code needs to trigger a
C# method?
Thanks,

Andy

Jan 16 '07 #2
On Mon, 15 Jan 2007 18:47:23 +0100, <an******@gmail .comwrote:
I hope you can answer a question. I am writing a poker utility that
tracks what windows are open and displays information about opponents
that are still playing and their previous history that is stored in a
game DB. It is a very cool project with Pattern Recognition (Pixel
Screen SCraping to OCR) and pretty advanced calculations. I
just started writing my first prototype in C# and discovered that I
could not set a System Wide CBT hook.
Wow. I'm playing some poker and was thinking about writing same software.
What pokerroom You are trying to write this software for? Why don't You
read history files? What poker network is this that it doesn't use
standard windows controls in its poker software so that You have to OCR? I
know of one. Boss Media.

--
Peri
Jan 26 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1213
by: Raymond L. Buvel | last post by:
I am preparing to release an extension module that interfaces Python to the Class Library for Numbers (http://www.ginac.de/CLN/). This module will provide Python types for arbitrary precision floating point numbers, rational numbers, and their complex counterparts. The module also includes most of the functions found in the Python math and cmath libraries. This module will be useful in applications where gmpy...
0
1158
by: Mansi | last post by:
I'm trying to use the System.Windows.Forms.Help class (from a stand alone C# application) to open up a URL. So for example, Help.ShowHelp(this, "http://www.SomeUrl.com"). Once this page is opened up, is there a way for the C# application to interact with the URL? Can the C# application get info back from the web page? If not, is there any other classes that will allow me to do this? Thanks.
0
845
by: Le9569 | last post by:
Good morning, all. I have a web application that hosts in windows 2000. Now I want to move to new web server using windows 2003. The problem is the application is referencing some .dll files under WinNT\Microsoft.NET\framework\... In the new windows 2003, it uses the different name as WINDOWS\Microsoft.NET\framework\... Is the a tool to change it automatically or how do I change it manually?
5
2873
by: Andrew | last post by:
Hey all, Requesting help from the VB.Net gurus in here. I was given a task to write a Windows Service (VB.Net) that would run an external program, and if that program closed for any reason (other than the service being stopped) it would restart it. I have written the service to do just this, and for testing purposes I am running the program Notepad. And I even have it making entries in the System Event Log. However, and this is my...
0
987
by: sainin | last post by:
I want to capture (and replay) the keyboard & mouse events for a windows application. This application is written in C# and uses a number of forms and threads. Thankx to the community; I have seen a number of examples which talk about using WinAPIs to capture system level events. Can anyone help me with a link/sample code to achive application specific event capturing. Please mind that I want to replay these events as well.. Thanks.
0
1281
by: sainin | last post by:
I want to capture (and replay) the keyboard & mouse events for a windows application. This application is written in C# and uses a number of forms and threads. Thankx to the community; I have seen a number of examples which talk about using WinAPIs to capture system level events. Can anyone help me with a link/sample code to achive application specific event capturing. Please mind that I want to replay these events as well.. Thanks.
0
2194
by: effone | last post by:
I have two addins installed in my Outlook 2003, both have their specific functionality, I would like to integrate the functionality of both thru global mouse hooks, here is my senerio 1) Lets say there is a button "abc" on toolbar "A" in outlook mail composing window 2) and there is a button "xyz" on toolbar "X" in the same mail composing window 3) on click of button "abc", I would like to generate click of button "xyz" first 4) and then...
1
2817
Hackles
by: Hackles | last post by:
Hello, Is there a hook type that can intercept messages (such as WM_INPUT) while they're in the message queue without relying on the application? I have looked into the following types of hooks, but each have their own drawbacks: WH_GETMESSAGE - relies on GetMessage or PeekMessage being called, which may not be feasible as I am checking for messages once per frame (so as not to compromise framerates), which is unacceptable for WM_INPUT...
5
3313
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name? Why do I need to set a property within my code to the service name? Are all these required or am I just doing this for consistency purposes?
0
10620
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10369
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10372
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3851
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.