After Curtis Lopez killed his wife and her son last year in Montgomery County, he tried to mislead police as he fled by sending text messages impersonating the victims, prosecutors said Thursday.

Pretending to be Jane McQuain, who had been bludgeoned with a 30-pound weight and stabbed in the back, Lopez texted that she’d be late for work because she was with sick relatives, according to prosecutors.

Pretending to be 11-year-old William McQuain, Lopez texted one of the boy’s school friends.

The ruse failed, prosecutors said, and Lopez’s own cellphone ended up leading investigators to an associate’s house where they found bloody gloves with William’s DNA on them and bloody shoes bearing Jane McQuain’s DNA.

The details emerged in court filings and a Thursday hearing ahead of Lopez’s murder trial, which is scheduled for October. Volunteers helped police lead a days-long search for William after his mother was found dead in her Germantown apartment.

Curtis Maruice Lopez. (Charlotte-Mecklenburg Police Department)

During Thursday’s trial, Lopez watched as prosecutors and his public defenders sparred over a series of defense motions, including an unsuccessful one to split the two murders into separate trials.

The judge has yet to rule on motions meant to block cellphone-related evidence. Defense attorney Alan C. Drew argued that detectives should have gotten a court order for Lopez’s phone records rather than requesting them from service provider Cricket. The records helped narrow the search for William’s body.

Prosecutors said Lopez, who was living in North Carolina, came to Montgomery with the idea of stealing McQuain’s new Honda CR-V, which she had purchased with money inherited from an uncle. Deputy State’s Attorney John Maloney said McQuain told people more money was still to come, which also motivated Lopez.

Lopez thought he had to kill both Jane McQuain and her son to get the inheritance, Maloney said. He also said Lopez was trying to cover up his wife’s death when he killed William.

Drew declined additional comment on the hearing.

When police seized Lopez’s cellphone from the stolen CR-V, they found a photo of a Tiffany lamp McQuain had inherited and that Lopez was trying to sell. Location data associated with the cellphone image helped lead them to the bloody evidence, prosecutors said.