Creating Windows from Console

This is a discussion on Creating Windows from Console within the Windows Programming forums, part of the Platform Specific Boards category; Hi, Can we create a hidden window from console application?. I mean without using winMain() function. I want to receive ...

  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
    Posts
    5,439
    Code:
    #include <windows.h>
    
    int main() {
    MSG message;
    while( GetMessage(&message, NULL, 0, 0) > 0 ) {
     }
    return 0;
    }
    Code:
    int main(void){srand(time(0));for(double l=rand(),l0=0,l00=0;;l0+=0.1){for(double l000=0;l000
    <1;l000+=.001,l+=((double)rand()/RAND_MAX)/0x64,l00+=((sin(l*0x8*atan(l0)*l000-(l0*0x8*atan
    (l)))*0.5)+0.5)){l00-=floor(l00);for(size_t l0000=0,l00000=(size_t)(0x50*(l00));l0000<l00000;++l0000
    )putchar(0x20);putchar(0x61+(int)((double)rand()/RAND_MAX*0x1a));putchar('\n');}}return 0;}

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,783
    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, 03:13 PM
  3. [C] Creating a simple windows front-end
    By papagaio in forum Windows Programming
    Replies: 1
    Last Post: 01-05-2009, 07:24 PM
  4. Incorporating Console and Windows Forms
    By Junior89 in forum C++ Programming
    Replies: 2
    Last Post: 11-07-2007, 09: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21