Jump to content
Fivewin Brasil

VMudaVideo - Vagner Wirts


kapiaba

Recommended Posts

Vagner de uma olhadinha para nosostros, please.

   // PROBLEMAS EM MAQUINAS MAIS NOVAS - COM WINDOWS 10 DE 64 BITS TRAVA.

	   VMudaVideo(aResolucaoAtual[1],aResolucaoAtual[2])  // Vagner Wirts
	/********************************************************* 
 * Função      : Funcao em C para mudar a Resolução da Tela se Menor da Necessária para trabalhar
 * Data        : 13/03/2013 às 12:05:26 por Vagner
 * Revisado em : 13/03/2013 às 12:05:35 por Vagner
 * Parâmetros :
 * iWidthNew  - Largura Mínima Necessária
 * iHeightNew - Altura Mínima Necessária
**********************************************************/ 
#Pragma BEGINDUMP
#include <Windows.h>
#include <ShellApi.h>
#include <Wingdi.h>
#include <hbapi.h>
HB_FUNC (VMUDAVIDEO)
{
 int iWidthNew  = hb_parni(1);
 int iHeightNew = hb_parni(2);
 int iWidth,iHeight ;
 //Pega a Configuração Atual
 DEVMODE DeviceMode = { 0 };
 EnumDisplaySettings( NULL,
        ENUM_CURRENT_SETTINGS,
        &DeviceMode );
 iWidth  = DeviceMode.dmPelsWidth;
 iHeight = DeviceMode.dmPelsHeight;
	// if(iWidth < iWidthNew || iHeight < iHeightNew) {  
//Desculpem eu retirei isso pois só serve para eu, senão vcs não conseguirão retorar o monitor 
	  //Muda para a nova Configuração
  DeviceMode.dmPelsWidth  = iWidthNew ;
  DeviceMode.dmPelsHeight = iHeightNew;
  ChangeDisplaySettings( &DeviceMode, 0 );
// }
 hb_reta( 2 );
 hb_storni( iWidth , -1, 1 );
 hb_storni( iHeight, -1, 2 );
}
#pragma ENDDUMP
/*
Para Usar é simples :
aResolucaoAtual := VMudaVideo(1024,768)
Isso fará mudar para a nova configuração, lhe retornando um array, para que qndo sair do sistema retornar para a incial
 
VMudaVideo(aResolucaoAtual[1],aResolucaoAtual[2])
 
Abraços,
Vagner Wirts
*/
	//----------------------------------------------------------------------------//
	


 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...