我是CLR的新手,我正在阅读setWindowPos的c ++ / CLI文档,函数定义如下。
BOOL WINAPI SetWindowPos(
_In_ HWND hWnd,
_In_opt_ HWND hWndInsertAfter,
_In_ int X,
_In_ int Y,
_In_ int cx,
_In_ int cy,
_In_ UINT uFlags
);
我有c ++经验,所以我理解,例如,“HWND”是数据类型,“hWnd”是变量名。
但 _“和”_in_opt_“中的 _ 是什么?
我猜他们是“输入变量”或其他东西的缩写。
文档中提到hWndInsertAfter是可选的。这是否意味着我可以简单地省略/不打扰在我的函数调用中将变量传递给此参数,如果我不需要?
e.g。
SetWindowPos(this,0,0,GetSystemMetrics(SM_CXMAXIMIZED),GetSystemMetrics(SM_CYMAXIMIZED),SWP_NOZORDER);
//Note that we're one parameter short here (the second is missing)
(这会让我感到困惑,因为我看到它在其他地方写的C ++不支持可选参数。只有默认参数和重载)