pedrix21 Posted January 17, 2009 at 01:25 AM Report #238798 Posted January 17, 2009 at 01:25 AM Boas, Alguem me podia dizer se em C existe alguma função que se possa mudar o tamanho do ecran quando esta invocada? Obrigada! @Pedro Lopes
TheDark Posted January 17, 2009 at 04:29 AM Report #238804 Posted January 17, 2009 at 04:29 AM Existe(m). Se for em Windows, vê isto. Desaparecido.
pedrix21 Posted January 17, 2009 at 04:25 PM Author Report #238871 Posted January 17, 2009 at 04:25 PM Eu estou a utilizar o Dev-C++, o meu programa e escrito em C. E com esse código não dá! Obrigado @Pedro Lopes
TheDark Posted January 17, 2009 at 07:53 PM Report #238903 Posted January 17, 2009 at 07:53 PM "esse código não dá" significa exactamente o quê? Desaparecido.
Peterv5 Posted January 17, 2009 at 08:45 PM Report #238923 Posted January 17, 2009 at 08:45 PM Este código permite-te por a janela em ecrã inteiro, não é bem o queres mas poderá dar-te jeito: #include <stdio.h> #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0502 #endif #include <windows.h> #define FULL_SCREEN TRUE #define WINDOWED FALSE BOOL setScreenMode( BOOL b ) { COORD coord; BOOL success = 0; HANDLE hConsole = GetStdHandle( STD_OUTPUT_HANDLE ); if(hConsole == NULL || hConsole == INVALID_HANDLE_VALUE ) return success; if(b) success = SetConsoleDisplayMode( hConsole, CONSOLE_FULLSCREEN_MODE, &coord); else success = SetConsoleDisplayMode( hConsole, CONSOLE_WINDOWED_MODE, &coord); return success; } int main() { BOOL mode; mode = setScreenMode( FULL_SCREEN ); if(mode) printf("Modo FullScreen"); else printf("Falha no modo de FullScreen"); getchar(); mode = setScreenMode( WINDOWED ); if(mode) printf("Modo Janela"); else printf("Falha no modo de Janela"); getchar(); return 0; }
pedrix21 Posted January 17, 2009 at 10:11 PM Author Report #238955 Posted January 17, 2009 at 10:11 PM dá um erro com esse código, SOL_WORK.c In function `setScreenMode': (Each undeclared identifier is reported only once SOL_WORK.c `CONSOLE_FULLSCREEN_MODE' undeclared (first use in this function) SOL_WORK.c `CONSOLE_WINDOWED_MODE' undeclared (first use in this function) @Pedro Lopes
Peterv5 Posted January 17, 2009 at 10:51 PM Report #238964 Posted January 17, 2009 at 10:51 PM Dá erro, comigo compilou e correu na boa, e também estou a utilizar o Dev-C++. Disses-te ali encima que também não conseguiste compilar o código do link que o TheDark te deu, poderás ter um problema no Dev-C++, tenta reinstala-lo.
TheDark Posted January 18, 2009 at 04:24 AM Report #239007 Posted January 18, 2009 at 04:24 AM O código que estava no link que mostrei é C++. Era apenas um exemplo de como utilizar as funções SetConsoleWindowInfo e SetConsoleScreenBufferSize. Desaparecido.
Peterv5 Posted January 18, 2009 at 11:06 AM Report #239032 Posted January 18, 2009 at 11:06 AM o meu era mesmo em C, talvez sejam versões diferentes do Dev-C++. Já aconteceu em casa poder utilizar certas função incluindo só o stdio.h e na escola tenho mesmo de incluir o string.h o stdlib.h e assim. Não sei exactamente porquê. Mas tirei aquele código da net á uns tempos, entre tanto já o modifiquei.
n3lThon Posted January 18, 2009 at 04:42 PM Report #239066 Posted January 18, 2009 at 04:42 PM Experimenta assim: keybd_event(VK_MENU,0x38, 0, 0); keybd_event(VK_RETURN,0x1c,0,0); keybd_event(VK_RETURN,0x1c,KEYEVENTF_KEYUP,0); keybd_event(VK_MENU,0x38,KEYEVENTF_KEYUP,0); dreams.each do |dream| dream.make_it_happen end
pedrix21 Posted January 18, 2009 at 07:42 PM Author Report #239085 Posted January 18, 2009 at 07:42 PM Obrigadão, foi o unico código que resolveu o problema 🙂 Podem fechar o tópico!! @Pedro Lopes
n3lThon Posted January 18, 2009 at 07:50 PM Report #239087 Posted January 18, 2009 at 07:50 PM Esse código simula o Alt+Enter. 🙂 dreams.each do |dream| dream.make_it_happen end
TheDark Posted January 18, 2009 at 09:03 PM Report #239097 Posted January 18, 2009 at 09:03 PM Então formulaste mal a pergunta. O que querias era colocar a consola em ecrã inteiro. Para isso utiliza-se a função SetConsoleDisplayMode, como está no código do Peterv5. O código do SONIC_ é um hack algo feio 🙂 Desaparecido.
n3lThon Posted January 18, 2009 at 09:25 PM Report #239101 Posted January 18, 2009 at 09:25 PM (...) O código do SONIC_ é um hack algo feio 🙂 Foi um amigo meu que encontrou, e a partir dai comecei a usar quando precisava e nem me lembrei de ver ser havia outra forma de o fazer. 😄 dreams.each do |dream| dream.make_it_happen end
Peterv5 Posted January 19, 2009 at 10:10 PM Report #239329 Posted January 19, 2009 at 10:10 PM Pelo menos aprendi uma cena, haha, a do hack
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now