fMain = Main form
frmClient = new window to be created on click.
StrArr[1] = The data being received (aka the socket ID, aka frmClient's title).
Both forms are in the same project (I've been asked that before).
The frmClient's caption is the Socket's ID. I'm having trouble applying data to a specific control in a window I'm searching for.
I've tried the following;
This gives me;Code:var WindowHandle : THandle; begin WindowHandle := FindWindow(nil, PAnsiChar(StrArr[1])); if WindowHandle = 0 then Exit; if WindowHandle <> 0 then begin Windows.SetForegroundWindow(WindowHandle); frmClient.Label1.Caption := 'abc'; end; end;
This successfully finds the given window, but how do I apply for example Label1's caption in that specific window?Code:--------------------------- Debugger Exception Notification --------------------------- Project Project1.exe raised exception class EAccessViolation with message 'Access violation at address 00475068 in module 'Project1.exe'. Read of address 000002F8'. Process stopped. Use Step or Run to continue. --------------------------- OK Help ---------------------------


LinkBack URL
About LinkBacks
Reply With Quote
