+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Kool Kat envisiOn's Avatar
    Join Date
    Jul 2005
    Location
    www.seclude.us
    Posts
    119

    Applying data to found window

    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;

    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 gives me;

    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   
    ---------------------------
    This successfully finds the given window, but how do I apply for example Label1's caption in that specific window?

  2. #2
    Junior Member Pillus's Avatar
    Join Date
    Aug 2009
    Posts
    27
    Tried to check the eventviewer in windows?

    Also you can check out this http://www.madshi.net/madExceptDescription.htm

    The third thing is that the main form might try to access a datamodule that hasn't been made yet, though then you would normaly get the fancy 0x0000 instead :p But yeah, try the sofware, and you will get your answer pretty fast.

    EDIT: Also forgot, read this

    http://delphi.about.com/od/objectpas.../aa052201b.htm

  3. #3
    Kool Kat envisiOn's Avatar
    Join Date
    Jul 2005
    Location
    www.seclude.us
    Posts
    119
    It was created, when I double click my Listitem it creates a new form.

    With the code above it shows it, I just don't see what the problem is.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. why not found
    By xf0 in forum Malware Discussion and General Help
    Replies: 1
    Last Post: 06-12-2011, 16:46
  2. Compile Error: Method or Data member Not Found vb6
    By wanderers in forum Malware Discussion and General Help
    Replies: 1
    Last Post: 08-01-2009, 10:35
  3. Found this hum
    By emirej in forum Off-Topic
    Replies: 1
    Last Post: 01-09-2008, 23:22
  4. TServerSocket Not Found...
    By JustinCase in forum General Programming Help
    Replies: 6
    Last Post: 31-05-2006, 12:29

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.