Thread: WinMain()

  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    39

    WinMain()

    Hello

    I'm writing a windows application, and i must use WinMain()


    Well MSDN syntax is: WinMain(HINSTANCE,HINSTANCE,LPSTR,int)


    The last parameter is the mode to show the window(Hidden, Visible...)
    I'm tried to hide my Window but it does not Work, i tried this way:


    Code:
    int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow=SW_HIDE)
    {
    
    DialogBox(hInstance,MAKEINTRESOURCE(DLG_MAIN),NULL,(DLGPROC)WinProc);
    
    
    }



    PS: I'm writing using resources
    How i can solve this?
    Thanks


    Thanks

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Well, if that is how you tried to change nCmdShow, you're not ready for Windows programming.

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    39
    So...

    How i solve this?

  4. #4
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Get yourself a good book or something and start with the basics. Windows programming (and GUI programming in general) is a monster if you aren't really familiar with C or C++.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WinMain entry point in .lib
    By cloudy in forum Windows Programming
    Replies: 8
    Last Post: 10-28-2006, 12:16 PM
  2. WinMain Paramaters.
    By C+noob in forum Windows Programming
    Replies: 8
    Last Post: 07-11-2005, 11:44 AM
  3. Understanding the Window WinMain Cycle
    By BillBoeBaggins in forum Windows Programming
    Replies: 4
    Last Post: 12-06-2003, 12:49 PM
  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