Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic HWND help needed...

Status
Not open for further replies.

Sherak

Programmer
Sep 1, 2003
83
GB
Hi,

I am having a little trouble finding information on window handles, I have been using borland builder for 4 years now and have worte some pretty complex apps however as unbelivable as it may sound I have never had to mess around with windows handles.. Until now that is..

I am using (or more to the point trying to use)

BOOL RegisterHotKey( HWND hWnd,
int id,
UINT fsModifiers,
UINT vk
);

I want to do this so that if the hot key is pressed my application comes into focus, however I do not know how to get the handle of my app for the first parameter, and secondly so I dont intefere with other apps I need to use

ATOM GlobalAddAtom( LPCTSTR lpString
);

to get a good id..... Any help on this or links to some basic information on any of this would be greatly appriciated.

Thanks,

Paul J....
 
I, too have avoided using handles. One reason I like VCL is that it insulates you from things like this. In the limited use I've run into, I've had to supply my form's handle. For example, if I create a form named "MyForm," I can get its handle via MyForm->Handle. Sometimes I have to go a step further and make it an integer depending on what the function I'm calling is expecting, e.g. (int)MyForm->Handle.

I do know that there is a series of article on BCB Commonly Asked Questions (BCBCAQ that introduces the standard window creation processes and how handles are used. It might be a good start. I must admit, I haven't had a chance to read them yet. The articles are: "Windows Creation Fundamentals," "From Messages to Events Part I," and "From Messages to Events Part II."

James P. Cottingham
-----------------------------------------
To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.
 
hi, you are an experienced Borland C++ builder ...
I would like to ask you a question, ok?

I have to write an MFC applicaton that can capture all the data in the Delphi application(EXE file at runtime only) , every control I can get it except the TRstringGrid,
now I can get the Handle if this control (TStringGrid), but I do not know whether I can get the TStringGrid pointer when I have the Handle or not???

Thanks in advance
 
danpi2003,
[tab]See thread101-1057669.

James P. Cottingham
-----------------------------------------
To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.
 
Thanks for the first reply James, that helps a lot....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top