SetCursorPos and other Win32 Functions 
Author Message
 SetCursorPos and other Win32 Functions

For well over a decade, I've had routines that allow cursor positioning,
colors and a full screen data entry panel with menu bars etc. The code
is written in PL/I, Pascal and C.  In the last month or so, I've got a
version running as a Win32 GUI.

I've finally got myself by the scruff of the neck, and am busy
documenting them etc. to make them available to others (free to
individuals and charitable organisations) and will add them to Robin's
code library.

So, says I, wouldn't it be great to get it running under IBM's PL/I
compiler.  Alas, I have a failure that perhaps someone can help me
with.  My first attempt at calling a WIN32 function ended in failure.
Here it is:

========================

*PROCESS MACRO S A(F) X AG;
*PROCESS LANGLVL(SAA2);
*PROCESS MARGINS(1,100);

 /********************************************************************/
 /*                                                                  */
 /*  NAME - Tsetcurs.pli                                             */
 /*                                                                  */
 /*                                                                  */
 /********************************************************************/

 tsetcurs: proc options(main);    /* Test SetCursPos in Win32       */

    /* Declare external APIs called by program. */

   %if system() = ' WIN' %then %do;
       %INCLUDE WINDEF;
   /*  %INCLUDE WINBASE; */
       %INCLUDE WINuser;
       DCL X TYPE BOOL;
   %end; %else %do;
   %end;

    Call SetCursorPos(10,12);
    Put skip ediT('Should be on Line 10 Row 12 --- It isn''t!')(a);

 end;

==============
Here's the file I used to compile, link and run it:
==============
pli tsetcurs (test
ilink tsetcurs.obj _user32.lib /debug
tsetcurs
==============

But it doesn't work.  All it does is print the message on the screen and
totally ignores the cursor positioning.

Any ideas?

Thanks,

Clem Clarke

  ,-._|\  Clement V. Clarke - Author Jol, EASYJCL, EASYPANEL, OSCAR,
370TO486

http://www.*-*-*.com/ ~oscarptyltd
 \_,--.x/ P.O. Box 475, Toorak, Victoria, AUSTRALIA, 3142.
       v  Tel (61)-3-9815-2311, Fax (61)-3-9819-2848.



Mon, 05 Aug 2002 03:00:00 GMT  
 SetCursorPos and other Win32 Functions
I have programmed C++ DLL's to do all that screen stuff

How can I access Robin's code library ?

Is it possible to get that "version running under WIN32" ?

Thank you for your soon reply.

May be that I can help you, if possible ... ?

b rgds Markus Loew

--------------------------------------

---------------------------------------


Quote:
> For well over a decade, I've had routines that allow cursor positioning,
> colors and a full screen data entry panel with menu bars etc. The code
> is written in PL/I, Pascal and C.  In the last month or so, I've got a
> version running as a Win32 GUI.

> I've finally got myself by the scruff of the neck, and am busy
> documenting them etc. to make them available to others (free to
> individuals and charitable organisations) and will add them to Robin's
> code library.

> So, says I, wouldn't it be great to get it running under IBM's PL/I
> compiler.  Alas, I have a failure that perhaps someone can help me
> with.  My first attempt at calling a WIN32 function ended in failure.
> Here it is:

> ========================

> *PROCESS MACRO S A(F) X AG;
> *PROCESS LANGLVL(SAA2);
> *PROCESS MARGINS(1,100);

>  /********************************************************************/
>  /*                                                                  */
>  /*  NAME - Tsetcurs.pli                                             */
>  /*                                                                  */
>  /*                                                                  */
>  /********************************************************************/

>  tsetcurs: proc options(main);    /* Test SetCursPos in Win32       */

>     /* Declare external APIs called by program. */

>    %if system() = ' WIN' %then %do;
>        %INCLUDE WINDEF;
>    /*  %INCLUDE WINBASE; */
>        %INCLUDE WINuser;
>        DCL X TYPE BOOL;
>    %end; %else %do;
>    %end;

>     Call SetCursorPos(10,12);
>     Put skip ediT('Should be on Line 10 Row 12 --- It isn''t!')(a);

>  end;

> ==============
> Here's the file I used to compile, link and run it:
> ==============
> pli tsetcurs (test
> ilink tsetcurs.obj _user32.lib /debug
> tsetcurs
> ==============

> But it doesn't work.  All it does is print the message on the screen and
> totally ignores the cursor positioning.

> Any ideas?

> Thanks,

> Clem Clarke

>   ,-._|\  Clement V. Clarke - Author Jol, EASYJCL, EASYPANEL, OSCAR,
> 370TO486

> http://www.ozemail.com.au/~oscarptyltd
>  \_,--.x/ P.O. Box 475, Toorak, Victoria, AUSTRALIA, 3142.
>        v  Tel (61)-3-9815-2311, Fax (61)-3-9819-2848.



Mon, 05 Aug 2002 03:00:00 GMT  
 SetCursorPos and other Win32 Functions
Mark,

Thank you.  I am reasonably comfortable writing GUI's in C, and have used
Petzold for both Windows and even (gasp) OS/2.

Using main, I thought I would be in Win Console Mode.

You think I am in GUI mode, do you?

Do you know how to get into Console Charcter mode in Win PL/I?

And, how do I get into Windows GUI mode with PL/I?  Is there a sample Windows
PL/I program?

Many thanks,

Clem Clarke

Quote:

> You don't have any sort of failure. You are just completely mixed up about
> Windows.

> - PUT is writing to a file (stdout:).
> - SetCursorPos is part of the GUI API (winuser).
> - Your program is a command-line program (options (main)).

> To do "full screen", either code to the console API or the GUI API. Either
> way, forget PL/I file I/O.

> May I recommend reading the standard work on programming Windows by Petzold?
> The Microsoft documentation will also come in handy.

> --
> Regards, Mark Yudkin, Yudkin Consulting AG, Authors of Cogent/SQL for MVS,
> OS/2 and Windows NT.
> The simplest way to publish live data on the World Wide Web.



> > For well over a decade, I've had routines that allow cursor positioning,
> > colors and a full screen data entry panel with menu bars etc. The code
> > is written in PL/I, Pascal and C.  In the last month or so, I've got a
> > version running as a Win32 GUI.

> > I've finally got myself by the scruff of the neck, and am busy
> > documenting them etc. to make them available to others (free to
> > individuals and charitable organisations) and will add them to Robin's
> > code library.

> > So, says I, wouldn't it be great to get it running under IBM's PL/I
> > compiler.  Alas, I have a failure that perhaps someone can help me
> > with.  My first attempt at calling a WIN32 function ended in failure.
> > Here it is:

> > ========================

> > *PROCESS MACRO S A(F) X AG;
> > *PROCESS LANGLVL(SAA2);
> > *PROCESS MARGINS(1,100);

> >  /********************************************************************/
> >  /*                                                                  */
> >  /*  NAME - Tsetcurs.pli                                             */
> >  /*                                                                  */
> >  /*                                                                  */
> >  /********************************************************************/

> >  tsetcurs: proc options(main);    /* Test SetCursPos in Win32       */

> >     /* Declare external APIs called by program. */

> >    %if system() = ' WIN' %then %do;
> >        %INCLUDE WINDEF;
> >    /*  %INCLUDE WINBASE; */
> >        %INCLUDE WINuser;
> >        DCL X TYPE BOOL;
> >    %end; %else %do;
> >    %end;

> >     Call SetCursorPos(10,12);
> >     Put skip ediT('Should be on Line 10 Row 12 --- It isn''t!')(a);

> >  end;

> > ==============
> > Here's the file I used to compile, link and run it:
> > ==============
> > pli tsetcurs (test
> > ilink tsetcurs.obj _user32.lib /debug
> > tsetcurs
> > ==============

> > But it doesn't work.  All it does is print the message on the screen and
> > totally ignores the cursor positioning.

> > Any ideas?

> > Thanks,

> > Clem Clarke

> >   ,-._|\  Clement V. Clarke - Author Jol, EASYJCL, EASYPANEL, OSCAR,
> > 370TO486

> > http://www.ozemail.com.au/~oscarptyltd
> >  \_,--.x/ P.O. Box 475, Toorak, Victoria, AUSTRALIA, 3142.
> >        v  Tel (61)-3-9815-2311, Fax (61)-3-9819-2848.

--

  ,-._|\  Clement V. Clarke - Author Jol, EASYJCL, EASYPANEL, OSCAR, 370TO486

http://www.ozemail.com.au/~oscarptyltd
 \_,--.x/ P.O. Box 475, Toorak, Victoria, AUSTRALIA, 3142.
       v  Tel (61)-3-9818-8351, Fax (61)-3-9819-2848.



Fri, 09 Aug 2002 03:00:00 GMT  
 SetCursorPos and other Win32 Functions
For command / GUI, look up OPTIONS(MAIN) and OPTIONS(WINMAIN).

There are samples for GUI coding, but none for the console API. PL/I coding
is identical to C programming for GUI, etc, for both NT and OS/2; the
differences are linguistic, not logical.

I have done the Console API support in PL/I, try including wincon.


Quote:
> Mark,

> Thank you.  I am reasonably comfortable writing GUI's in C, and have used
> Petzold for both Windows and even (gasp) OS/2.

> Using main, I thought I would be in Win Console Mode.

> You think I am in GUI mode, do you?

> Do you know how to get into Console Charcter mode in Win PL/I?

> And, how do I get into Windows GUI mode with PL/I?  Is there a sample
Windows
> PL/I program?

> Many thanks,

> Clem Clarke


> > You don't have any sort of failure. You are just completely mixed up
about
> > Windows.

> > - PUT is writing to a file (stdout:).
> > - SetCursorPos is part of the GUI API (winuser).
> > - Your program is a command-line program (options (main)).

> > To do "full screen", either code to the console API or the GUI API.
Either
> > way, forget PL/I file I/O.

> > May I recommend reading the standard work on programming Windows by
Petzold?
> > The Microsoft documentation will also come in handy.

> > --
> > Regards, Mark Yudkin, Yudkin Consulting AG, Authors of Cogent/SQL for
MVS,
> > OS/2 and Windows NT.
> > The simplest way to publish live data on the World Wide Web.



> > > For well over a decade, I've had routines that allow cursor
positioning,
> > > colors and a full screen data entry panel with menu bars etc. The code
> > > is written in PL/I, Pascal and C.  In the last month or so, I've got a
> > > version running as a Win32 GUI.

> > > I've finally got myself by the scruff of the neck, and am busy
> > > documenting them etc. to make them available to others (free to
> > > individuals and charitable organisations) and will add them to Robin's
> > > code library.

> > > So, says I, wouldn't it be great to get it running under IBM's PL/I
> > > compiler.  Alas, I have a failure that perhaps someone can help me
> > > with.  My first attempt at calling a WIN32 function ended in failure.
> > > Here it is:

> > > ========================

> > > *PROCESS MACRO S A(F) X AG;
> > > *PROCESS LANGLVL(SAA2);
> > > *PROCESS MARGINS(1,100);

/********************************************************************/
Quote:
> > >  /*
*/
> > >  /*  NAME - Tsetcurs.pli
*/
> > >  /*
*/
> > >  /*
*/

/********************************************************************/

- Show quoted text -

Quote:

> > >  tsetcurs: proc options(main);    /* Test SetCursPos in Win32       */

> > >     /* Declare external APIs called by program. */

> > >    %if system() = ' WIN' %then %do;
> > >        %INCLUDE WINDEF;
> > >    /*  %INCLUDE WINBASE; */
> > >        %INCLUDE WINuser;
> > >        DCL X TYPE BOOL;
> > >    %end; %else %do;
> > >    %end;

> > >     Call SetCursorPos(10,12);
> > >     Put skip ediT('Should be on Line 10 Row 12 --- It isn''t!')(a);

> > >  end;

> > > ==============
> > > Here's the file I used to compile, link and run it:
> > > ==============
> > > pli tsetcurs (test
> > > ilink tsetcurs.obj _user32.lib /debug
> > > tsetcurs
> > > ==============

> > > But it doesn't work.  All it does is print the message on the screen
and
> > > totally ignores the cursor positioning.

> > > Any ideas?

> > > Thanks,

> > > Clem Clarke

> > >   ,-._|\  Clement V. Clarke - Author Jol, EASYJCL, EASYPANEL, OSCAR,
> > > 370TO486

> > > http://www.ozemail.com.au/~oscarptyltd
> > >  \_,--.x/ P.O. Box 475, Toorak, Victoria, AUSTRALIA, 3142.
> > >        v  Tel (61)-3-9815-2311, Fax (61)-3-9819-2848.

> --

>   ,-._|\  Clement V. Clarke - Author Jol, EASYJCL, EASYPANEL, OSCAR,
370TO486

> http://www.ozemail.com.au/~oscarptyltd
>  \_,--.x/ P.O. Box 475, Toorak, Victoria, AUSTRALIA, 3142.
>        v  Tel (61)-3-9818-8351, Fax (61)-3-9819-2848.



Tue, 13 Aug 2002 03:00:00 GMT  
 SetCursorPos and other Win32 Functions
Markus,

Sorry I missed you message till now.

Quote:

> I have programmed C++ DLL's to do all that screen stuff

Great.  Can PL/I call it?

Quote:

> How can I access Robin's code library ?

Try going Robin's homepage:    http://www.users.bigpond.com/robin_v
and work from there.

You see sample code, etc.

Quote:
> May be that I can help you, if possible ... ?

Great, let's see what can be done.

Cheers,

Clem Clarke

Quote:

> b rgds Markus Loew

> --------------------------------------

> ---------------------------------------


> > For well over a decade, I've had routines that allow cursor positioning,
> > colors and a full screen data entry panel with menu bars etc. The code
> > is written in PL/I, Pascal and C.  In the last month or so, I've got a
> > version running as a Win32 GUI.

> >   ,-._|\  Clement V. Clarke - Author Jol, EASYJCL, EASYPANEL, OSCAR,
> > 370TO486

> > http://www.ozemail.com.au/~oscarptyltd
> >  \_,--.x/ P.O. Box 475, Toorak, Victoria, AUSTRALIA, 3142.
> >        v  Tel (61)-3-9815-2311, Fax (61)-3-9819-2848.

--

  ,-._|\  Clement V. Clarke - Author Jol, EASYJCL, EASYPANEL, OSCAR, 370TO486

http://www.ozemail.com.au/~oscarptyltd
 \_,--.x/ P.O. Box 475, Toorak, Victoria, AUSTRALIA, 3142.
       v  Tel (61)-3-9818-8351, Fax (61)-3-9819-2848.



Sun, 25 Aug 2002 03:00:00 GMT  
 SetCursorPos and other Win32 Functions
Quote:


> > I have programmed C++ DLL's to do all that screen stuff

> Great.  Can PL/I call it?

> > How can I access Robin's code library ?

> Try going Robin's homepage:

   http://www.users.bigpond.com/robin_v/resource.htm
Quote:

> Cheers,

> Clem Clarke



Mon, 26 Aug 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Calling Win32 API functions with Gnat 3.09 (Win32 version)

2. Function / Procedure and "others" operator query

3. SetCursorPos for MLE

4. Function CloneForm is unavailable of Win32

5. Canvas.AcceptFocus doesn't function in Win32?

6. Prototype for all Win32.lib functions

7. filling a structure form a win32 function

8. Using Win2k, Win32 API functions

9. Win32 API Functions

10. Win32 API user32.dll SendInput function help

11. Calling Win32 API Functions

12. Calling Win32 functions resolved

 

 
Powered by phpBB® Forum Software