473,382 Members | 1,651 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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 2384
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
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...
0
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...
0
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...
5
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...
0
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...
0
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...
0
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...
1
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,...
5
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?...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.