Okay. I have found the solution here.
Just to clarify, I am running this on Windows 7 Ultimate 64bit.
Start off by installing the Generals game. Then create a folder in your documents folder called... Command and Conquer Generals Data
Then open up Notepad and copy and paste the following... AntiAliasing = 3
FirewallBehavior = 1
FirewallNeedToRefresh = FALSE
FirewallPortAllocationDelta = 0
GameSpyIPAddress = 0.0.0.0
Gamma = 50
IPAddress = 0.0.0.0
IdealStaticGameLOD = High
LanguageFilter = false
MusicVolume = 39
Resolution = 1440 900
Retaliation = yes
SFX3DVolume = 37
SFXVolume = 33
ScrollFactor = 42
SendDelay = no
StaticGameLOD = High
UseAlternateMouse = no
UseDoubleClickAttackMove = no
VoiceVolume = 40
Note: That the Resolution may differ on your monitor. Change this accordingly.
Now save this text file inside the folder you created and name the file... options.ini
Next, find your generals.exe file inside the installation folder and change the compatibility mode to Windows XP SP2.
You should now be able to run the game in Windows 7!
Please note that if you go into the 'options' menu screen of the game and change anything, the resolution will no longer be set as you set it above. If you do this then just open up options.ini file and edit! You may also want to use 'Right-click' for commanding your units in the game. If you do then in options.ini change the UseAlternateMouse
I also have Generals Zero Hour installed too. All I did to get this working was to create a folder called... Command and Conquer Generals Zero Hour Data
Then copy over the options.ini file that you put into the Generals data folder above.
Hope I've been of some help?