Thread: Creating Windows from Console

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    9

    Creating Windows from Console

    Hi,

    Can we create a hidden window from console application?. I mean without using winMain() function. I want to receive Windows message and my application will be console based (using main() function). Is it possible? if yes can someone post a samall sample code.

    Ashu

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Code:
    #include <windows.h>
    
    int main() {
    MSG message;
    while( GetMessage(&message, NULL, 0, 0) > 0 ) {
     }
    return 0;
    }
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    You still need a window of sorts to actually have messages sent to...

    What exactly are you trying to do?

  4. #4
    Registered User
    Join Date
    Sep 2002
    Posts
    9
    Hi Sebastiani,

    But how to interpret message received from GetMessage. Where to set switch statement. Actually i want some hidden window to send message to this console application. Please help. I am new to this area.

    Ashu

    Hi Fordy,

    i want to create a intermediate winsock application running in hidden window mode and console application will call this intermediate application. I require hidden window to send immediate WSSASyncSelect() notifications to console application.
    Is it possible.


    Ashu

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Creating a simple Windows game
    By ejohns85 in forum C Programming
    Replies: 1
    Last Post: 05-22-2009, 12:46 PM
  2. One process with two console windows
    By siavoshkc in forum Windows Programming
    Replies: 8
    Last Post: 01-30-2009, 04:13 PM
  3. [C] Creating a simple windows front-end
    By papagaio in forum Windows Programming
    Replies: 1
    Last Post: 01-05-2009, 08:24 PM
  4. Incorporating Console and Windows Forms
    By Junior89 in forum C++ Programming
    Replies: 2
    Last Post: 11-07-2007, 10:36 PM
  5. Creating fractals in C++ console mode
    By speedy in forum C++ Programming
    Replies: 2
    Last Post: 10-26-2001, 01:02 PM