int WINAPI WinMain(
HINSTANCE hInstance, //handle of current instance
HINSTANCE hPrevInstance,//handle of prev instance
LPSTR     pszCmdLine,   //command line
int  nCmdShow //show state of window
)
nCmdShow如何传递进程序?

解决方案 »

  1.   

    CreateProcess时可传入。另:VC编程中给人的感觉WinMain是应用程序的入口点,但从汇编编程角度来说,WinMain是在执行一些初始化步骤后才调用的一个子过程,传入的参数是在初始化是获取的,同时"WinMain"也可改成任意的名称。不知你是否指的是这种情况。.code
    start:
    invoke GetModuleHandle, NULL
    mov g_hInst, eax
    invoke GetCommandLine, NULL
    mov g_CmdLine, eax
    ...
    invoke WinMain, g_hInst, NULL, g_CmdLine, SW_SHOWDEFAULT
    invoke ExitProcess, eax
    WinMain proc hInstance:DWORD, hInstPrev:DWORD, lpCmdLine:DWORD, nCmdShow:DWORD 
      ...
      xor eax, eax
      ret
    WinMain endp
    end start
      

  2.   

    我是指生成的可执行文件,直接用nCmdShow方式显示:ShowWindow(hWnd,nCmdShow);int WINAPI WinMain(
    HINSTANCE hInstance,//handle of current instance
    HINSTANCE hPrevInstance,//handle of prev instance
    LPSTR     pszCmdLine,   //command line
    int nCmdShow//show state of window
    )
    {
    ..........
    ShowWindow(hWnd,nCmdShow);
    ........
    }
    这个nCmdShow如何传递进程序作为参数,如何以不同的方式显示
      

  3.   

    CreateProcess时可传入。,把指针强制转换为VOID *,在进程里面再强制转回来
      

  4.   

    nCmdShow允许你在快捷方式的属性里改动显示方式,一般默认都是正常显示
      

  5.   

    nCmdShow允许你在快捷方式的属性里改动显示方式,一般默认都是正常显示