int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow) {

This is a discussion on int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow) { within the Windows Programming forums, part of the Platform Specific Boards category; int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow) what are these 4 parameters for , i always see ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    319

    int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow) {

    int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow)

    what are these 4 parameters for , i always see them

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    The first one, hInst, is needed for creating windows, controls etc. and much more. But you can always use GetModuleHandle(NULL) anywhere you need to put a HISTANCE.
    hPrevInst is for console programs mostly (instance of the last console program in the same window).
    lpCmd is the command line for the program (for parameters).
    nShow is needed for ShowWindow(windowhandle,nShow).
    I assume you didn't understand anything in my explanations. I am so bad explanator.

  4. #4
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,264
    hPrevInst is for console programs mostly (instance of the last console program in the same window).
    Actually hPrevInst is depreciated, and always NULL.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. can some one please tell me the cause of the error ?
    By broli86 in forum C Programming
    Replies: 8
    Last Post: 06-26-2008, 09:36 PM
  2. Replies: 8
    Last Post: 03-10-2008, 12:57 PM
  3. Moving Average Question
    By GCNDoug in forum C Programming
    Replies: 4
    Last Post: 04-24-2007, 12:05 AM
  4. Working with random like dice
    By SebastionV3 in forum C++ Programming
    Replies: 10
    Last Post: 05-26-2006, 10:16 PM
  5. A Simple (?) Problem
    By Unregistered in forum C++ Programming
    Replies: 8
    Last Post: 10-12-2001, 05:28 AM

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