[SOLVED] Retrieve Scintilla gadget handles in third-party applications?

Just starting out? Need help? Post your questions and find answers here.
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

[SOLVED] Retrieve Scintilla gadget handles in third-party applications?

Post by boddhi »

Hello,

From the following code, how do you find out whether or not each app contains a Scintilla gadget and, if so, retrieve the handle so you can insert text inside it?

Code: Select all

Procedure.i Fc_Test()
  Protected.i IDFenetreAppli
  Protected.s TitreFenetre
  
  IDFenetreAppli=FindWindow_(0,0)
  Repeat
    IDFenetreAppli=GetWindow_(IDFenetreAppli,#GW_HWNDNEXT)
    If IDFenetreAppli And IsWindowVisible_(IDFenetreAppli) And GetWindowLongPtr_(IDFenetreAppli,#GWL_HWNDPARENT)=0
      TitreFenetre=Space(#MAX_PATH)
      GetWindowText_(IDFenetreAppli,@TitreFenetre,#MAX_PATH)
      If TitreFenetre<>""
        Debug TitreFenetre
        ; [...]
      EndIf
    EndIf
  Until IDFenetreAppli=0
EndProcedure

Fc_Test()
 
Thanks.
Last edited by boddhi on Fri Aug 02, 2024 10:27 am, edited 1 time in total.
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
Axolotl
Addict
Addict
Posts: 872
Joined: Wed Dec 31, 2008 3:36 pm

Re: Retrieve Scintilla gadget handles in third-party applications?

Post by Axolotl »

Hello boddhi,

maybe my solution here is a good starting point.
I searched for an app with Scintilla Control inside to realize a typewriter simulation....
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: Retrieve Scintilla gadget handles in third-party applications?

Post by boddhi »

Axolotl wrote: maybe my solution here is a good starting point.
Hello Axolotl,

:shock: A recent code and I don't see it (even during my searches!) :oops: :)

I haven't studied your code in detail yet but, it seems, it should certainly satisfy my need.

While waiting for a possible answer, I had started to work from this very interresting Sparkie code but yours seems a little less “complex” and quicker to adapt.

I'll let you know (not immediately, immediately) if I've succeeded in my goal.

Many thanks to you. :wink:
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
Axolotl
Addict
Addict
Posts: 872
Joined: Wed Dec 31, 2008 3:36 pm

Re: Retrieve Scintilla gadget handles in third-party applications?

Post by Axolotl »

Hi boddhi,

you are welcome.
I had a little peek to sparkie's code. I would say that it is similar. It's just not designed to find the Scintilla Control.....
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: Retrieve Scintilla gadget handles in third-party applications?

Post by boddhi »

Hi,
Axolotl wrote: It's just not designed to find the Scintilla Control.....
It allowed me to retrieve Scintilla IDs.
For me, this was already a good starting point! One small step for humanity, one giant leap for me! :mrgreen: :wink:
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: Retrieve Scintilla gadget handles in third-party applications?

Post by boddhi »

Hi Axolotl,

I finally succeeded to obtain the searched result.

Thanks again for your contribution. :wink:
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [SOLVED] Retrieve Scintilla gadget handles in third-party applications?

Post by Fred »

Please always post a working solution for the record, just saying 'i finally found it' isn't helpful :)
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: [SOLVED] Retrieve Scintilla gadget handles in third-party applications?

Post by boddhi »

Fred wrote: Please always post a working solution for the record, just saying 'i finally found it' isn't helpful :)
Hi Fred,
With all due respect,
To understand my last message, you might have had to read the whole thread.
I provided a link to a Sparkie code and Axolotl provided a link to one of his codes, both of which, in different ways, perfectly answered my request and, more generally, all those who might have the same request.
What would have been the interest of posting a triplicate code, especially as it wouldn't have been very interesting for others.
To return to the content of my last message, it was only intended to inform Axolotl, as I had "promised" him earlier, that I had succeeded in adapting his code for my needs. That's all!

In French now:
Je trouve vraiment ta remarque infondée dans la mesure où, que ce soit sur le forum français ou le forum anglais, d'une part, je n'hésite pas à faire bénéficier la communauté de codes ou d'applis que j'estime être suffisamment intéressants pour pouvoir servir, et d'autre part, quand le temps et mes compétences programmatiques me le permettent de répondre à ceux qui font des demandes. Peut-être jugeras-tu que ce n'est pas énorme, suffisant, pertinent, mais je fais aussi avec les contraintes qui sont les miennes, au risque de me répéter, que sont le temps et les compétences.
J'évite de donner dans l'ultracrépidarianisme et souvent des réponses ont déjà été apportées par des personnes au niveau informatique bien plus élevé que le mien et, ce, de manière bien plus adaptée que je n'aurais su le faire et avant même, parfois, que j'ai eu pleinement le temps d'essayer de pondre un code techniquement viable.

Donc, pour résumer ce que j'ai déjà écrit en anglais, je demandais comment récupérer les handles des gadgets Scintilla d'applications tierces, ce que font le code de Sparkie et de manière encore plus directe une partie de celui d'Axolotl. Je n'ai pas vu l'intérêt d'y ajouter le mien qui ne fait que reprendre grosso-modo ce dernier !
J'ajouterais, pour finir, que je ne crois pas être le premier à avoir agi ainsi et, même si pour être honnête je ne lis pas tous les sujets, t'avoir déjà vu réagir de la sorte pour un tel fait.
Peut-être ai-je dit ou fait quelque chose, en d'autres temps, en d'autres lieux, qui t'aurait déplu. Auquel cas, même si je sais ton temps chargé, n'hésite-pas à me MP pour que nous échangions à ce sujet.
Cordialement.
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [SOLVED] Retrieve Scintilla gadget handles in third-party applications?

Post by Fred »

Au temps pour moi, comme ta reponse est formulée ça donne l'impression que tu as trouvé qqchose de nouveau. Je fais cette remarque a tout le monde, c'est bien-sûr pas personnel !
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: [SOLVED] Retrieve Scintilla gadget handles in third-party applications?

Post by boddhi »

Fred wrote: Au temps pour moi, comme ta reponse est formulée ça donne l'impression que tu as trouvé qqchose de nouveau. Je fais cette remarque a tout le monde, c'est bien-sûr pas personnel !
Salut Fred,

Je te remercie pour ta réponse.
Comme tu l'auras noté, l'anglais n'est pas ma langue maternelle et peut-être n'ai-je pas su clairement exprimer mon objectif initial.
Je te prie de m'excuser si j'ai mal compris ton intention et donné possiblement le sentiment de surinterpréter ou de surréagir.
Les choses ayant été dites, les doutes sont maintenant levés.
Avec tout mon respect.
Cordialement.
{Mode french : off]
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
Post Reply