Página 1 de 1

sobre hacer prompts en C/C++

Publicado: 18 Nov 2012, 16:35
por valium7
Necesito hacer un script que haga prompt en diferentes lados coordenadas de la screen,
y si podeis un frame con un arcoiris de colores , se hace con un bucle ,respondan

Re: sobre hacer prompts en C/C++

Publicado: 05 Mar 2014, 21:47
por valium7
Bueno me respond a mí mismo desde el futuro ,eso se podía hacer con autoit o con la api de windows en c/c++

Re: sobre hacer prompts en C/C++

Publicado: 06 Mar 2014, 13:08
por Pink
Y el Codigo?

Re: sobre hacer prompts en C/C++

Publicado: 09 Mar 2014, 11:20
por valium7
xD claro man ,aquí el de la ventana prompt
#include <windows.h>
#include <stdlib.h>

LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
LPWSTR *CommandLineToArgvW(LPCWSTR lpCmdLine, int *pNumArgs);
char szClassName[ ] = "WindowsApplication";

int WINAPI WinMain (HINSTANCE hThisInstance,
                    HINSTANCE hPrevInstance,
                    LPSTR lpszArgument,
                    int nFunsterStil)

{           
 int argCount=0;


      
    HWND hwnd;               
    MSG messages;            
    WNDCLASSEX wincl;        

    wincl.hInstance = hThisInstance;
    wincl.lpszClassName = szClassName;
    wincl.lpfnWndProc = WindowProcedure;      
    wincl.style = CS_DBLCLKS;                 
    wincl.cbSize = sizeof (WNDCLASSEX);

    wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
        wincl.lpszMenuName = NULL;                 
    wincl.cbClsExtra = 0;                      
    wincl.cbWndExtra = 0;                      
    wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;

    if (!RegisterClassEx (&wincl))
        return 0;
int val = atoi(lpszArgument);
    hwnd = CreateWindowEx (
           0,                   
           szClassName,         
           "xD",       
           WS_OVERLAPPEDWINDOW, 
           val,       
           val,       
           170,                 
           70,                 
           HWND_DESKTOP,        
           NULL,                
           hThisInstance,       
           NULL                 
           );

    ShowWindow (hwnd, nFunsterStil);

    while (GetMessage (&messages, NULL, 0, 0))
    {
        TranslateMessage(&messages);
        DispatchMessage(&messages);
    }

    return messages.wParam;
}



LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)                  
    {
        case WM_DESTROY:
            PostQuitMessage (0);       
            break;
        default:                      
            return DefWindowProc (hwnd, message, wParam, lParam);
    }

    return 0;
}
Llamarlo ventanaeggs1.cpp
Y el lanzador
#include <stdlib.h>
#include <stdio.h>
#include <string>


using namespace std;


string convertirInt(int number)
{
    if (number == 0)
        return "0";
    string temp="";
    string returnvalue="";
    while (number>0)
    {
        temp+=number%10+48;
        number/=10;
    }
    for (int i=0;i<temp.length();i++)
        returnvalue+=temp[temp.length()-i-1];
    return returnvalue;
}
int main(){
    string temp;string result;string izq;
    int point =0;  
const char *cstr;
    for(int i=0;i<700;i+=100){
            

   temp = convertirInt(i);
   cstr =  temp.c_str();
   izq = "ventanaeggs1 ";
   result = std::string(izq) + temp;const char * xD=result.c_str();
            system(xD);
            }
    
system("pause");

    return 0;
    }
viteeee¿? xD

Re: sobre hacer prompts en C/C++

Publicado: 09 Mar 2014, 11:22
por valium7
doble post- si queréis por consola, llamadlo
"ventanaeggs1.exe 400" por ejemplo ,y así sale un prompt en diferentes lados de la pantalla xD