AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi Anfängerfrage: InternalGetWindowText verwenden
Thema durchsuchen
Ansicht
Themen-Optionen

Anfängerfrage: InternalGetWindowText verwenden

Ein Thema von flotschie · begonnen am 3. Jul 2004 · letzter Beitrag vom 3. Jul 2004
 
flotschie

Registriert seit: 3. Jul 2004
8 Beiträge
 
#1

Anfängerfrage: InternalGetWindowText verwenden

  Alt 3. Jul 2004, 00:19
hallo,

also ich bin zwar kein delphi programmierer aber ich ich glaube meine frage kann ich auch hier stellen:

es gibt in der windows API die Funktion

Code:
int InternalGetWindowText(HWND hWnd,
    LPWSTR lpString,
    int nMaxCount
);
die einen Text liefern soll (von mir auch kann man hier auch GetWindowText verwenden )

Anfängerfrage: Wie man sehen kann liefert diese Funktion einen integer wert zurück und keinen string! Das versteh ich nicht ganz....

Wenn ich ein Code-Beispiel für vb verwende, nämlich

Code:
Dim textlen As Long ' receives length of text of the window
Dim wintext As String ' receives the text of the window
Dim slength As Long ' receives the length of the returned string

' Find out how many characters are in the window's text.
' Add 1 to compensate for the terminating null.
textlen = GetWindowTextLength(Form1.hWnd) + 1
' Make sufficient room in the buffer.
wintext = Space(textlen)
' Retrieve the text of window Form1.
slength = GetWindowText(Form1.hWnd, wintext, textlen)
' Remove the empty space from the string, if any.
wintext = Left(wintext, slength)
' Display the result.
Debug.Print "The title bar of window Form1 is: "; wintext

funktionierts bei mir nicht weil ich VB.NET programmiere und es da keine Left Anweisung mehr gibt - aber an dem solls nicht scheitern. Überhaupt liefert mir ja fast jede API funktion einen integer oder long wert zurück, auch wenn man strings haben will. Wie bekomme ich denn nun meinen string?
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:06 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz