Thanks Jim...Your answer sparked me into a few more tests and after changing the anything I fired in the hardcoded dimensions and presto it worked.
Changed the ref to devmode instead of anything and went in and double checked my values. I should be ashamed to say this but my values were indeed correct....except...I had them reversed in the storage variable..ie 1024 x 768 as 768 x 1024....no wonder I couldn't get it to work....In my defense, it was 5:00 am after being up all night with my granddaughter so Fatigue has to be factered in...LOL..
retval = 1
Public Declare Function ChangeDisplaySettings Lib "user32.dll" _
Alias "ChangeDisplaySettingsA" (ByRef lpDevMode As Devmode, ByVal dwFlags As Long) As Long.
..right now the only thing I don't like is that it flashes the screed twice before doing the conversion...but I'll do a little more testing on the matter and include a form level message or something so the user doesn't panic with the thought that I just killed his precious little pc.
Later,
Wayne




Reply With Quote