Over the past two years, Hollywood has been at the forefront of resistance to President Donald Trump.

After throwing their weight behind Hillary Clinton during the 2016 election to no avail, liberals in the industry have taken to the red carpet, the Broadway stage, the Academy Awards and social media to express their disgust with the president and promote issues such as immigration, a free press, gun control and sexual-harassment prevention.

These efforts have proved deeply polarizing, infuriating conservatives, who scream about politics overrunning everything, and invigorating liberals.

Thanks to Trump, celebrities also seem to capture Americans' political imaginations, spawning fantasies of future presidential campaigns from candidates such as Oprah and the Rock.

But this chatter reveals the mistaken tendency of the industry to focus on the biggest political prize: presidential elections. If Hollywood really wants to make a difference, it should seize on the lower-profile midterm elections not only to spotlight issues and candidates but also to use glitz and glamour to persuade people to vote.

And while Michelle Obama's organization "When We All Vote" has teamed up with superstars such as Lin-Manuel Miranda, Tom Hanks and Janelle Monáe to encourage voting in the midterms, the key to Hollywood's impact this election depends on whether the effort continues off-camera.

Hollywood has loved electioneering since the earliest days of the silver screen. Since the 1920s, studio executives have eagerly forged relationships with presidential administrations. Louis B. Mayer proudly slept in the Lincoln Bedroom after helping Herbert Hoover get elected, and Jack Warner used his dollars, his studio and the silver screen to promote Franklin Roosevelt's election and New Deal programs.

But during the 1940s, it was Hollywood's rank and file, many of whom were passionate about issues, who figured out how to achieve real political impact, burrowing down to the grass roots and demonstrating the value of entertainers in party politics.

Frustrated by the conservative gains in the 1942 congressional election in California, and firmly committed to advancing both Roosevelt and the progressive wing of the Democratic Party, Hollywood leftists formed a new organization, the Hollywood Democratic Committee (HDC), in January 1943.

For the 1944 election, the HDC researched potential down-ballot candidates and produced pamphlets and radio spots that highlighted "win-the-war candidates" and "win-the-war legislation."

At a time when they had yet to gain any real national political influence, these activists focused on issues closer to home. They started by tackling discrimination toward African-Americans and Mexican-Americans that had manifested itself in Los Angeles' "Zoot Suit Riots." In March 1944, the HDC joined with the Los Angeles Council for Civic Unity and other community groups for a star-studded event. James Cagney, Olivia de Havilland and Anthony Quinn headlined, performing a re-enactment of the devastating consequences of racial injustice. Media coverage of the event was national, propelling these local concerns onto the national stage.

The HDC also featured a deft political operation that aimed to bolster liberal candidates and to encourage registration, voter turnout and volunteering.

In California, the HDC ran 450 radio spots on nine stations, including several 15-minute programs that highlighted progressive candidates for office. A "Let's Go Out and Ring Door Bells" voter registration campaign featured stars including Cary Grant, Dinah Shore and Walter Huston. One radio spot centered on a rushed housewife who angrily answered the door, proclaiming she was too busy to vote. Then she realized she was talking to Cary Grant. Star-struck, the woman registered. Grant then graciously gave her an autograph as she promised to vote.

The script clearly overplayed the ability of celebrities to cultivate civic activism. But it also ended with each star promising to be at their district's registration office the following morning, an attempt to use their celebrity to lure listeners into registering and voting.

While the HDC began organizing in only seven local congressional districts, its glamour prompted requests from across the country. In Washington state, Warren G. Magnuson's campaign committee asked for "an outstanding movie star such as Orson Welles, Edward G. Robinson or Olivia de Havilland" to help craft radio spot endorsements and make campaign appearances.

The HDC granted requests such as this from candidates from Salt Lake City to Florida. Its goal: to combat "a discouraging tendency to tune out straight political harangues." Celebrity and entertainment could capture listeners' attention, enticing them to then hear a political message.

Commitment to liberal issues drove this effort. While the Hollywood activists wouldn't have turned down a dinner invitation to the White House, cultivating Roosevelt was not their only objective. And their effort was ideological, not partisan. They only aided progressive Democrats and actually ridiculed and attacked conservative Southern Democrats for their support for segregation.

Ultimately, this ideological commitment brought about the downfall of the HDC. Its efforts infuriated Republicans and conservative Democrats. During World War II, those politicians used their power in Congress to investigate "un-American activities," pinpointing the entertainment industry as a potentially powerful vehicle for communism to infiltrate the country. This investigation expanded in the House Un-American Activities Committee (HUAC) after Roosevelt's death left a vacuum filled by strident anticommunism that divided liberal networks in Hollywood.

HUAC targeted liberal actors such as Robinson, who made spots in Spanish to reach out to Mexican-American voters during the 1944 election, and Humphrey Bogart, who traveled across California to build crowds and recorded a range of radio advertisements for the Democratic National Committee. To survive professionally, they had to apologize and claim that they had been "suckers" and "dopes." Their experiences highlighted the high price of political activism.

But the Hollywood Democratic Committee activities also revealed that entertainment can raise money, awareness and excitement. While presidential elections draw saturation coverage in every possible forum, the midterms are exactly when candidates need such allies to excite voters who often ignore nonpresidential elections.

If Madonna, Tom Hanks, Robert De Niro, LeBron James and Meryl Streep actually pound the pavement and get minority and younger voters out to the polls in key races across the country, they may give the Democratic Party the lift it needs to reverse the trend that has always plagued it during midterm elections — low turnout.

Kathryn Cramer Brownell is assistant professor of history at Purdue University and author of "Showbiz Politics: Hollywood in American Political Life." She wrote this article for the Washington Post.