Thanks for the quick response, I had seen references to ChangeDisplaySettingsEx but was unsure how to implement it.
Here is my attempt to get an Orientation function working.
#include "FWCE.ch"
#DEFINE DMDO_0 0
#DEFINE DMDO_90 1
#DEFINE DMDO_180 2
#DEFINE DMDO_270 4
function Main()
local oWnd, oBtn
DEFINE WINDOW oWnd TITLE "Orientation Test"
@ 2, 2 BUTTON oBtn PROMPT "0" SIZE 80, 25 ACTION Orientation( DMDO_0 )
@ 4, 2 BUTTON oBtn PROMPT "90" SIZE 80, 25 ACTION Orientation( DMDO_90 )
@ 6, 2 BUTTON oBtn PROMPT "180" SIZE 80, 25 ACTION Orientation( DMDO_180 )
@ 8, 2 BUTTON oBtn PROMPT "270" SIZE 80, 25 ACTION Orientation( DMDO_270 )
ACTIVATE WINDOW oWnd ON CLICK MsgInfo( "Click!" )
return nil
function CeSetmenu() ; return nil
function GetMenu() ; return nil
function ReadBitmap() ; return nil
function PalBmpRead() ; return nil
#pragma BEGINDUMP
#include "windows.h"
#include "hbapi.h"
HB_FUNC( ORIENTATION )
{
DEVMODE devmode;
memset( &devmode, 0, sizeof( devmode ) );
devmode.dmSize = sizeof( DEVMODE );
devmode.dmDisplayOrientation = hb_parnl( 1 ) );
devmode.dmFields = DM_DISPLAYORIENTATION;
ChangeDisplaySettingsEx( NULL, &devmode, NULL, 0, NULL );
}
#pragma ENDDUMP
However I get this from BUILDCE
Compiling...
Harbour Compiler Alpha build 46.2 (Flex)
Copyright 1999-2006,
http://www.harbour-project.org/
Compiling 'orientat.prg' and generating preprocessed output to 'orientat.ppo'...
Lines 43, Functions/Procedures 5
Generating C source output to 'orientat.c'... Done.
Microsoft (R) C/C++ Optimizing Compiler Version 12.20.9615 for ARM
Copyright (C) Microsoft Corp 1984-2002. All rights reserved.
orientat.c
orientat.prg(35) : error C2059: syntax error : ')'
Line 35 is the memset( &devmode, 0, sizeof( devmode ) );
My C knowledge is very limited so not sure what I am doing wrong.