Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Parameters to "WinMain"

Hello.

I would like to know, if "Windows OS" pushes/sends the four parameters known as: hInstance, HprevInstance, CmdLine, and CmdShow, when it calls a program. or if they are pushed by C with the API functions like: GetModuleHandle.


Thank You.

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : Hello.
    :
    : I would like to know, if "Windows OS" pushes/sends the four
    : parameters known as: hInstance, HprevInstance, CmdLine, and CmdShow,
    : when it calls a program. or if they are pushed by C with the API
    : functions like: GetModuleHandle.
    :
    :
    : Thank You.
    :
    [color=Blue]
    For all parameters there is an API involved, except hPrevInstance - it is ALWAYS NULL. Windows simply calls these functions and pushes them with a simple PUSH opcodes and voila! - WinMain() call is born!
    [/color]
  • SephirothSephiroth Fayetteville, NC, USAMember Posts: 1,035
    : : Hello.
    : :
    : : I would like to know, if "Windows OS" pushes/sends the four
    : : parameters known as: hInstance, HprevInstance, CmdLine, and CmdShow,
    : : when it calls a program. or if they are pushed by C with the API
    : : functions like: GetModuleHandle.
    : :
    : :
    : : Thank You.
    : :
    : [color=Blue]
    : For all parameters there is an API involved, except hPrevInstance -
    : it is ALWAYS NULL. Windows simply calls these functions and pushes
    : them with a simple PUSH opcodes and voila! - WinMain() call is born!
    : [/color]
    Just a side-note, though probably irrelevant, the hPrevInstance is used if you're working with Windows 3.11 or prior. They left the parameter in when Win9X came around for backwards-compatibility, but all modern apps should ignore it.

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
Sign In or Register to comment.