![]() |
|
#1
|
|||
|
|||
|
Hey im trying to set the tet of a Edit control to a String and pass it to the FindWindow API as the windowname to get the handle but i get Incompatible Type error when trying to run the app.
How can i fix this? |
|
#2
|
|||
|
|||
|
Hello
You must do a type cast. like this: var S:String; Begin S:=Edit1.Text; FindWindow(Pchar(S) , emptyParam); Hope it hepls. Aref |
|
#3
|
|||
|
|||
|
Ok i did this and it seems to be working fine.
FindWidnow(Nil, Pchar(Variable)); Is there anything extra/at all i should know about Pchar(). |
|
#4
|
|||
|
|||
|
Hi
Pchar is a null-terminated string type which Delphi uses due to compatibility issues with Windows APIs. You should reffer to Delphi help to get to know all functions related to Pchar , then click to accept my answer ![]() Aref |
![]() |
| Thread Tools | |
| Display Modes | |
|
|