TPW 1.5 WinCRT question 
Author Message
 TPW 1.5 WinCRT question

Hi Hacks,
I'm new to TPW 1.5, and am trying to convert some simple DOS-based programs
to
Windows, starting out using the WinCRT unit.  I would, however, like to be
able to use a few of the simpler procedures from the true Windows units,
such as MessageBox.
To do so, I need to specify the window handle for the main window, but I
can't seem to find a way to figure out where to find that information.  Is
what I'm trying to do
possible at all?
thanks
Rob



Wed, 18 Jun 1902 08:00:00 GMT  
 TPW 1.5 WinCRT question


Quote:

> able to use a few of the simpler procedures from the true Windows units,
> such as MessageBox.
> To do so, I need to specify the window handle for the main window, but I
> can't seem to find a way to figure out where to find that information.  Is
> what I'm trying to do
> possible at all?
> thanks
> Rob

I don't use WinCRT very much, but I suspect you should be able to
use:

   MessageBox(GetActiveWindow,'Please Click','Message Title',MB_OK);

"GetActiveWindow" is a standard function.

- Jim

--

Come the revolution we'll be 'round your 'ouse.



Wed, 18 Jun 1902 08:00:00 GMT  
 TPW 1.5 WinCRT question

Quote:

> able to use a few of the simpler procedures from the true Windows units,
> such as MessageBox.
> To do so, I need to specify the window handle for the main window, but I
> can't seem to find a way to figure out where to find that information.  

just use a zero, which means the handle of the main display driver.

--
p. rowntree
Departement de chimie, Universite de Sherbrooke, Sherbrooke, Quebec,
Canada



Wed, 18 Jun 1902 08:00:00 GMT  
 TPW 1.5 WinCRT question

Quote:



> > able to use a few of the simpler procedures from the true Windows units,
> > such as MessageBox.
> > To do so, I need to specify the window handle for the main window, but I
> > can't seem to find a way to figure out where to find that information.  Is
> > what I'm trying to do
> > possible at all?
> > thanks
> > Rob
> I don't use WinCRT very much, but I suspect you should be able to
> use:

>    MessageBox(GetActiveWindow,'Please Click','Message Title',MB_OK);

> "GetActiveWindow" is a standard function.

Probably not a good idea, since GetActiveWindow always returns the window
that's currently selected by the user, which might not always be the WinCrt
program.

The variable you need is called CrtWindow. Problem is, that - at least in
BP 7.0 that I'm using, but probably also in TPW 1.5 - this variable is in the
implementation of WinCrt, so you can't access it. :-(

Solutions:
- If you have the source of WinCrt (it comes with BP 7.0, but I don't think
  with TPW 1.5), you could just move CrtWindow into the interface.

- FindWindow('TPWinCrt',NIL) should return the handle, but if more than one
  WinCrt-App is running, it might mix them up.

- In the case of MessageBox and such, you can just give 0 instead of the
  window handle. Not sure if this works with all Windoze versions...

- And your could, of course, try my unit WWin, an extension of WinCrt, which
  incidentally has CrtWindow in the interface. Problem is, that only the
  registered version will work with TPW 1.5...
  http://www.mi.uni-erlangen.de/~heckenb/programs.htm#WWin

Hope this helps,
Frank



Wed, 18 Jun 1902 08:00:00 GMT  
 TPW 1.5 WinCRT question

Quote:

>Hi Hacks,
>I'm new to TPW 1.5, and am trying to convert some simple DOS-based programs
>to
>Windows, starting out using the WinCRT unit.  I would, however, like to be
>able to use a few of the simpler procedures from the true Windows units,
>such as MessageBox.
>To do so, I need to specify the window handle for the main window, but I
>can't seem to find a way to figure out where to find that information.  Is
>what I'm trying to do
>possible at all?
>thanks
>Rob

Every procedure or function belongs to a Unit.
Searching in Borland Pascal Help for the specific
procedure you can read the relate Unit.
You want to search also for the 'Uses' topic!
Again, search for a field named HWindow in
TWindowsObject.

regards

Leonardo



Wed, 18 Jun 1902 08:00:00 GMT  
 TPW 1.5 WinCRT question

Try using InitWinCRT and then GetActiveWindow to get its handle.

Frank





Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Question on WinCrt of TPW 1.5

2. TPW 1.5 WINCRT unit - screen sizing

3. Popdown menus in TPW 1.5 using wincrt

4. How control Cursor-Keys with TPW 1.5 in a WinCRT-Window

5. How control Cursor-Keys with TPW 1.5 in a WinCRT-Window

6. Modified WinCrt of TPW 1.5

7. TPW 1.5 - WINDOW SIZE -1024 x 768 Question

8. tpw 1.5 window creation question

9. TPW 1.5 Debugger under Win95 question

10. LFN in TPW 1.5 - is that possible?

11. need help with TPW 1.5

12. TPW 1.5 using LPT1 to print with LEXMARK PRINTER

 

 
Powered by phpBB® Forum Software