Results 1 to 1 of 1
  1. #1
    Vitrix Maggot
    Vitrix Maggot is offline
    Member-in-training Vitrix Maggot's Avatar
    Join Date
    2013 Apr
    Location
    Brasil
    Posts
    58
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    43
    Thanked in
    24 Posts
    Rep Power
    0

    FindWindow + CaptionName/ClassName

    Bom, nesse tutorial, eu vo mostrar como utilizar o FindWindow() do windows,que serve para Encontrar as janelas que estao abertas no seu computador, e também a como pegar o Caption Name (nome da janela) e o Class Name de um programa.
    1° Como funciona o FindWindow?
    Simples, ele sempre eh dessa forma:

    ''Well, in this tutorial, I show how to use the vo FindWindow () windows, which serves to find who are the windows open on your computer, and also how to get the Caption Name (name of the window) and the Class Name of a program.
    1 ° How does FindWindow?
    Simple, eh it always that way:''

    FindWindow(nil,nil);
    Mas assim ele não serve pra nada, pois os dois parametros dele estão nil :/
    o 1° Nil, pode ser substituido pela Class Name e o 2° Nil pode ser substituido pelo Caption.

    ''But so it is for nothing, because the two parameters are nil it :/
    1 ° Nil, can be replaced by Class Name and 2 ° Nil can be replaced by Caption.''

    FindWindow('WMplayerapp', nil) // Class Name do Windows Media Player.
    FindWindow(nil,'Windows Media Player'); // Caption do windows Media Player.
    Mas usando assim, ele tbm nao serve pra nada ¬¬
    Um exemplo de uso.

    ''But using so it does not serve for anything tbm ¬ ¬
    An example usage.''

    ClassName:

    if FindWindow('WMplayerapp', nil) then
    Label1.Caption:= 'Windows Media Player Encontrado.' ;
    Caption:

    if FindWindow(nil,'Windows Media Player'); then
    Label1.Caption:= 'Windows Media Player Encontrado.' ;


    Mas qual a diferença entre utilizar a ClassName e a CaptionBar ?
    Simples, alguem poderia usar SetWindowsText , para modificar a CaptionBar, de algum programa, e voce tera de usar o ClassName...Mas porem usar o captionbar sempre é mais prático, porque é só olhar o nome na barra do programa

    °Mas então como eu pego o ClassName de alguma aplicação?
    Abra seu delphi, e declare em Private :

    ''But what's the difference between using the ClassName and CaptionBar?
    Simple, someone could use SetWindowsText to modify CaptionBar in any program, and you will have to use the ClassName ... But however captionbar always use the most practical, because just look at the name on the bar of the program

    ° But then how do I get the ClassName in any application?
    Open your Delphi, and declare in Private:''

    private
    procedure ShowHwndAndClassName(CrPos: TPoint);
    Depois Adicione um timer,com um interval de 50 Milisegundos, e declare:
    ''Then Add a timer with an interval of 50 Milliseconds, and state ::''

    Spoiler



    E logo abaxo do timer, declare a seguinte Procedure:
    ''And then underneath: timer, declare the following Procedure:''

    Spoiler



    Assim , o timer vai ficar procurando as janelas em que seu mouse esta em cima e mostrando no label, o ClassName da janela.

    °E como eu pego o Caption?

    ''Thus, the timer will be looking in the windows that your mouse is over and showing the label, the classname of the window.

    ° And as I get the Caption?''
    ''Pode parece uma pergunta besta,porque voce vai dize, há é só olha pra janelinha de cima do programa.Mas e se tive um caracter especial? Um que voce nao saiba fazer?
    Eu jah cai nisso, precisava do caption de um jogo, e o nome da janela era uns 10921029102 caracters especiais --''

    Bom, primeiro declare em Var :
    ''Well, first declare in Var:''

    sJanelaAtiva,sJanelaOld : string;
    Depois declare a seguinte Function:
    ''Then declare the following Function:''

    Spoiler



    E depois declare em um timer o seguinte code, com um interval , de 50~100 ;
    ''And then declare a timer in the following code with an interval of 50 ~ 100;''

    Spoiler

    Last edited by Vitrix Maggot; 2013-04-20 at 06:10 PM.
    I admire most other programmers not paid any dick!!

    Admiro outros Programadores mais nao pago pau pra nenhum !!


    Skype: Vitor Monteiro

  2. The Following User Says Thank You to Vitrix Maggot For This Useful Post:


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •