William W. Hartnett, 44, assistant to the Clerk of the U.S. House of Representatives and a former Army major assigned to the White House Communications Office, died of cancer Thursday at the National Institutes of Health in Bethesda.

Mr. Hartnett, who lived in Kensington, joined the staff of the Clerk of the House in 1967. His duties involved communications. He was responsible for designing and installing the House's electronic voting system, an improved telephone system, the House recording studio and the House paging system. He also designed and put into operation the system that permits television coverage of proceedings on the House floor.

He joined the House after resigning his commission as a captain in the Army Signal Corps. It was during his military career that he was assigned to the White House Communications Office. He worked there under presidents Kennedy and Johnson.

A native of New York City, Mr. Hartnett grew up in Jersey City, N.j.

He graduated from Seton Hall University in 1960 with a bachelor's degree in communications and was commissioned a second lieutenant in the Army at the same time. He was assigned to television projects at Fort Monmouth, N.J., before being transferred to the White House.

His marriage to the former Joan Swyers ended in divorce.

Survivors include his wife, Deborah, and their son, Sean, both of Kensington; a son by his previous marriage, Billy Stephens of Alden, N.Y.; his mother, Mary Hartnett of Asbury Park, N.J.; three brothers, Cornelius of Lake Hopatcong, N.J., Vincent of Asbury Park, N.J., and John of Cranford, N.Y., and a sister, Marjorie Giambalvo of Marietta, Ga.

The family suggests that expressions of sympathy be in the form of contributions to the National Cancer Institute, Medicine Branch Medical Research Fund, Building 10, Room 12N 226, Bethesda, 20505.