Thread: Help!!!!!!!!!!!!!!!!!!1

  1. #1
    redsoxj69
    Guest

    Help!!!!!!!!!!!!!!!!!!1

    Hi, i wan't to put a program i wrote to show up under a windows program, not a dos program. HELP please.

  2. #2
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    Could you be more specific please? I'd like to help but I'm kind of confused.
    The world is waiting. I must leave you now.

  3. #3
    redsoxj69
    Guest
    I typed a windows skelton program but i can't get programs to compile in the windows skelton. the programs will be in a DOS window

  4. #4
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    > I typed a windows skelton program but i can't get programs to compile in the windows skelton. the programs will be in a DOS window.

    Hold on a second:

    I wrote a windows skeleton program but I can't get the programs to compile inside the windows skeleton. The programs will be in a DOS window.

    Could you show me any code at all that you've been working with? I'm way confused.
    The world is waiting. I must leave you now.

  5. #5
    redsoxj69
    Guest
    Here is the code for my skelton:

    #include <windows.h>

    LRESULT CALLBACK WindowFunc(HWND, UINT, WPARAM, LPARAM);
    char szWinName[] = "MyWin";
    int WINAPI WinMain(HINSTANCE hThisInst, HINSTANCE hPrevInst,
    LPSTR lpszArgs, int nWinMode)
    {
    HWND hwnd;
    MSG msg;
    WNDCLASSEX wcl;

    wcl.cbSize = sizeof(WNDCLASSEX);

    wcl.hInstance = hThisInst;
    wcl.lpszClassName = szWinName;
    wcl.lpfnWndProc = WindowFunc;
    wcl.style = 0;

    wcl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wcl.hIconSm = NULL;
    wcl.hCursor = LoadCursor(NULL, IDC_ARROW);

    wcl.lpszMenuName = NULL;
    wcl.cbClsExtra = 0;
    wcl.cbWndExtra = 0;

    wcl.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);

    if(!RegisterClassEx(&wcl)) return 0;

    hwnd = CreateWindow(
    szWinName,
    "Windows 2000 Skeleton",
    WS_OVERLAPPEDWINDOW,
    CW_USEDEFAULT,
    CW_USEDEFAULT,
    CW_USEDEFAULT,
    CW_USEDEFAULT,
    NULL,
    NULL,
    hThisInst,
    NULL
    );

    ShowWindow(hwnd, nWinMode);
    UpdateWindow(hwnd);

    while(GetMessage(&msg, NULL, 0, 0))
    {
    TranslateMessage(&msg);
    DispatchMessage(&msg);
    }
    return msg.wParam;
    }


    LRESULT CALLBACK WindowFunc(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;
    }


    i was looking at the code and i think that because there is no extra memory in the program then another program can't compile in it. am i right?

  6. #6
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    I don't know if you're right. I cannot answer that and refuse to mislead you and your program. Perhaps you should direct your post towards the Windows board. While posting it over there, use code tags please.
    The world is waiting. I must leave you now.

  7. #7
    redsoxj69
    Guest
    ok, thanks for your help.

    sorry for npt posting my code first

  8. #8
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    Don't be sorry. You have the code! It looks to me like you've put in the effort, now once you get it over on the windows board with some code tags, it'll be led in the right direction.
    The world is waiting. I must leave you now.

  9. #9
    Registered User bljonk's Avatar
    Join Date
    Oct 2001
    Posts
    70
    I know that piece of code!
    It's in the book : "C the complete reference"

    & that's a problem because I'm only guessing that u got a msgbox saying that that's not a valid win32 program.

    P.S.: by the way nice enhancement of the code.
    Ünicode¬>world = 10.0£

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help1
    By Joanna in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 11-03-2003, 12:13 AM
  2. Please Help!!!!1
    By GAMEPROJOE in forum C++ Programming
    Replies: 7
    Last Post: 07-14-2003, 02:23 AM
  3. Help!!!!!!!!!!!!!!!!!1
    By incognito in forum C++ Programming
    Replies: 9
    Last Post: 01-27-2002, 11:33 PM