Welcome, Guest. Please login or register.

Author Topic: [C] CLI Window Pointer  (Read 5675 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show all replies
    • http://www.nyteshade.com
[C] CLI Window Pointer
« on: February 11, 2018, 10:43:11 PM »
I have been failing to get a handle on the window the CLI is running from in C. The call to FindTask(0L) will land me both a structure to Task as well as Process, the overlapping technique a popular one, I%&$#?@!%&$#?@!%&$#?@!8217;m finding. However attempts to use the data in this structure do not work.

Process has .pr_WindowPtr which is typed as APTR. I thought it would be easy but thus far it hasn%&$#?@!%&$#?@!%&$#?@!8217;t worked.

*UPDATE*

I'm an idiot. I was trying to open dos.library with a DOSBase variable, guessing the name, when in fact, it was DosLibrary instead. Sigh. C'est la vie.
« Last Edit: February 12, 2018, 05:39:52 AM by nyteschayde »
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show all replies
    • http://www.nyteshade.com
Re: [C] CLI Window Pointer
« Reply #1 on: February 12, 2018, 04:15:49 PM »
I would love to see the right way to do this with 1.2/1.3 if possible. Also if you could list which structures the APTRs in struct Process are actually referencing that would be wonderful. None of the many books I have discuss this.

Almost everything in dosextens is this way. If you show a better way for 2.0+ as an alternative, that would be amazing. Thanks.  

Thomas and Olaf, thank you both. You two are some of the most knowledgeable and forthcoming folks here. Much appreciated.

Thomas, I am attempting to move and resize the window in question and possibly add some menus to it. Making some utilities to make my startup scripts more powerful under 1.2/1.3. I%&$#?@!%&$#?@!%&$#?@!8217;ll throw them on aminet when I%&$#?@!%&$#?@!%&$#?@!8217;m done.
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show all replies
    • http://www.nyteshade.com
Re: [C] CLI Window Pointer
« Reply #2 on: February 12, 2018, 04:21:25 PM »
What about the opposite? Can you programmatically attach a shell to a window you choose to open? Where on Earth did you find out how to do this?! Lol. I have been scouring the web and my books.

Finally, in your example, do I need to invoke/message ACTION_UNDISK_INFO as mentioned by Thomas?
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show all replies
    • http://www.nyteshade.com
Re: [C] CLI Window Pointer
« Reply #3 on: February 12, 2018, 09:43:18 PM »
@Thomas, I was planning on adding IDCMP code to the window. I figured that I could make some likely assumptions and document the caveats, maybe do some version checking.

Speaking of which, what is the best way to programmatically check the version of files. I also forgot how to specify the version of a file that is detectable from programs like 'Version'. Version under 1.2/1.3 doesn't seem to be check the version of files other than loaded libraries; or I am doing something wrong.

Again, thanks for your help. Can either of you confirm that ReadArgs was introduced in V36+?
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show all replies
    • http://www.nyteshade.com
Re: [C] CLI Window Pointer
« Reply #4 on: February 12, 2018, 10:44:23 PM »
Quote from: Thomas Richter;836070

Well. Ehem. Is this a trick question? Actually, the obvious answer is "yes", as it appears in dos.library in V36. However, it was always part of tripos, as "rdargs()", though not accessible by C programmer, not part of the dos.library, and only reachable through a lot of stunts via the mystical "GlobVec" of BCPL. So, in a sense "no, I cannot confirm that". But for all practical matters, you are right.


Care to document how and demystify it? Others look at these forums too. ;) If there is a way to use the call in 2.x+ compatible code that is being written to be 1.x compatible in many ways, it could be useful.
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show all replies
    • http://www.nyteshade.com
Re: [C] CLI Window Pointer
« Reply #5 on: February 12, 2018, 10:46:53 PM »
Quote from: Thomas Richter;836069

Please. Do. As said by Olaf, the original CON does not have an iconification button, so there it does not matter - but other shells do. But, all that feature will go away once you have borrowed the window pointer and haven't given it back. Anoyance to the user. Be kind, return what you have borrowed when you are done.


There is no define ACTION_UNDISK_INFO anywhere in the Amiga Developer's CD. How do I send that message.
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500