1 Application->Initialize(); //initial call
2 Application->CreateForm(__classid(TForm1), &Form1); //initial call
3 GetClassName(Application-Handle, szServerName,80); //get info. for
me
4 GetClassInfo(hInstance, szServerName, &wc); //get info. for
me
5
lng=SetClassLong(Application->Handle,GCL_WNDPROC,(long)((WNDPROC)WndProc));
// try to change it point to the address of the function I made
// (WNDPROC)Proc has the address I want, GCL_WNDPROC is a flag of the
stuff I
// want to change.
6 GetClassInfo(hInstance, szServerName, &wc);
//check to see if it is been changed.
7 Application->Run(); //run the program.. But my WndProc didn't
// get the messages for process.
8 GetClassInfo(hInstance, szServerName, &wc);
// Info. tell me the address still pointer to my function
Before starting my program by Application->Run() method,
I tried to change WndProc to my own by SetClassLong(), but
nothing happend. My own CALLBUCK MyWndProc() did't get
messages. My question is how can I replace address of WndProc
in WNDCLASS to my own address for proceeding messages by
MyWndProc()? If you can help me, please e-mail
to jcr...@game-club.com Thank you.
>We just got the C++ Builder from Borland. It is like Delphi but
>the codes are C++. I have a question about it. Look at the following
>codes.
...
>Before starting my program by Application->Run() method,
> I tried to change WndProc to my own by SetClassLong(), but
> nothing happend. My own CALLBUCK MyWndProc() did't get
> messages. My question is how can I replace address of WndProc
> in WNDCLASS to my own address for proceeding messages by
> MyWndProc()? If you can help me, please e-mail
> to jcr...@game-club.com Thank you.
Override the WndProc method, which the form inherits from TWinControl.
See the help files for details.
--
Ray Lischner, Tempest Software, Inc., Corvallis, Oregon, USA
Author of Secrets of Delphi 2 (http://www.tempest-sw.com/secrets/)