Win32 App not running in window but in console

I've created a windows application in c++ through platinum SDK. When i run this app, it'll run in command prompt Now, i want to run it from windows so i managed it to run in windows But, the problem is that i can't run the app in command prompt and windows concurrently. It only allows me to run either in windows or in command prompt (not both) Can anybody lead me to the correct path.
See this: http://www.cplusplus.com/forum/windows/77686/#msg418924

Also, a Windows app uses WinMain, the message loop and all that stuff. A Console app will look like a Unix app, with main() ...
Thanks,


now i'm using win api application

CreateWindow(TEXT("Edit"), TEXT("test"), WS_CHILD | WS_VISIBLE | WS_BORDER, 100, 20, 140, 20, hWnd, NULL, NULL, NULL);

how to access this text from another class
I'm not sure what you mean.
Example1.Cpp

1
2
3
4
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
CreateWindow(TEXT("Edit"), TEXT("test"), WS_CHILD | WS_VISIBLE | WS_BORDER, 100, 20, 140, 20, hWnd, NULL, NULL, NULL);
}

Example2.cpp

Form1->textBox1->Text = "Some Content" (This code can be valid in windows form application)

But, i'm developing Win32 app. since the above code is not valid, how can i change the textbox value from the example2.cpp

Ultimately, I hope you understand i'm trying to say
Last edited on
WndProc is the window's callback function.

The idea is that you're responding to events, and you are notified of these events thru that callback function. So the system calls your WndProc and tells you the object that generated the callback (hWnd), the event (message), and event/message specific parameters (wParam, lParam).

The callback will have different handlers for each message type and might look like:
1
2
3
4
5
6
7
8
9
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)
    {
    case WM_CREATE:
        // handle WM_CREATE
        break;
    }
}


So that CreateWindow() call you have, will be called in response to something happening. So it needs to be in the correct handler.

That's why the question is confusing because you're ignoring the context in which you want to create a Windows. If that is the first window being created, then of course, it doesn't get called in response to something, but perhaps part of the application startup sequence.
Thanks again
I already did coded as exact as you stated above.
And i just wanna let you know that i'm creating one.cpp from that code.
It worked fine but this wasn't my problem.

Okay. Let's say
I created a textbox with the above code.
Now, i supposed to another create cpp file (second.cpp)
Again and again my question from the beginning is
how to get the textbox value from the second.cpp
Topic archived. No new replies allowed.