Thread: WinMain Paramaters.

  1. #1
    The N00b That Owns You!
    Join Date
    Jul 2005
    Location
    Canada!
    Posts
    178

    WinMain Paramaters.

    i have this:
    Code:
    int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
    i want to make it so id doesnt bring up the command line i figured a bit out but i wont be at my compiler (dev-c++) for a while and this is bugging me badly would this work and just show the window?

    Code:
    int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil)
    wow cant believe i rememberd that! so am i right?

  2. #2
    Registered User r1ck0r's Avatar
    Join Date
    Apr 2005
    Location
    UK
    Posts
    30
    Are you trying to make a windows application but when you execute your program a console window pops up?
    If so, you're creating the wrong type of project, you must be creating a win32 console project, I don't use dev-cpp so I'm not sure how you change the project type sorry.

  3. #3
    The N00b That Owns You!
    Join Date
    Jul 2005
    Location
    Canada!
    Posts
    178
    its a blank project (started out blank) there is a win32 ver. but i dont use it alwways do blank so....
    New Function!!!!

    glAddIdol(C+noob);

    The feeling of rusty spoons against my salad fingers is almost ORGASMIC

  4. #4
    Registered User r1ck0r's Avatar
    Join Date
    Apr 2005
    Location
    UK
    Posts
    30
    When you create a new project, it must ask you whether you would like to create a console project, windows project, DLL, etc... You must select windows project.

  5. #5
    The N00b That Owns You!
    Join Date
    Jul 2005
    Location
    Canada!
    Posts
    178
    in dev if you start a blank project you dont need to select win32 your code modifies what type of proj. it is
    New Function!!!!

    glAddIdol(C+noob);

    The feeling of rusty spoons against my salad fingers is almost ORGASMIC

  6. #6
    Registered User r1ck0r's Avatar
    Join Date
    Apr 2005
    Location
    UK
    Posts
    30
    Then what is your problem?
    If you get the console window apearing, obviously dev-cpp isn't doing what it's supposed to, so just select a windows project and problem solved.

  7. #7
    The N00b That Owns You!
    Join Date
    Jul 2005
    Location
    Canada!
    Posts
    178
    its the parameters of winmain if i change nCmdShow and the LPSTR it should work
    New Function!!!!

    glAddIdol(C+noob);

    The feeling of rusty spoons against my salad fingers is almost ORGASMIC

  8. #8
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,273
    Has anyone ever told you that they worry about your sanity, C+noob?

    Only joking, but here's a bit of Windows executable theory for you: there's a flag in the header of each Windows program that indicates whether it uses the console subsystem or just the Windows GUI subsystem.

    This isn't controlled by code, the different entry point functions are simply an indication of the project settings. To change this, you need to go into Project Options ("top right icon") and select "Win32 GUI" from the General tab. There may be more you need to change, but I don't know what (I don't use Dev C++, trudged around Google to find that info).

    Enjoy.

  9. #9
    The N00b That Owns You!
    Join Date
    Jul 2005
    Location
    Canada!
    Posts
    178
    thnbx but thew thing is i like to use blank projects to learn it the hard way and thus would like to know how to do it myself

    EDIT:

    i compiled it and it works
    New Function!!!!

    glAddIdol(C+noob);

    The feeling of rusty spoons against my salad fingers is almost ORGASMIC

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 04-30-2008, 11:14 AM
  2. WinMain entry point in .lib
    By cloudy in forum Windows Programming
    Replies: 8
    Last Post: 10-28-2006, 12:16 PM
  3. WinMain and return msg.wParam problems
    By Manaxter in forum C++ Programming
    Replies: 4
    Last Post: 01-08-2006, 11:58 AM
  4. Silly WinMain question
    By Magos in forum Windows Programming
    Replies: 2
    Last Post: 09-07-2002, 09:38 AM
  5. Is this necessary: int APIENTRY WinMain
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 06-26-2002, 07:09 PM