谁试过用C#+API挑战MessageBoxIndirect ?
我碰到两个麻烦: 1.先建个Console Application,定义了数据结构后
public struct MSGBOXPARAMS
{
public uint cbSize;
public IntPtr hwndOwner;
public IntPtr hInstance;
public string lpszText;
public string lpszCaption;
public uint dwStyle;
public string lpszIcon;
public int dwContextHelpId;
public string lpfnMsgBoxCallback;
public uint dwLanguageId;
};
MSGBOXPARAMS MsgBp = new MSGBOXPARAMS();
MsgBp.cbSize = (uint)sizeof(MSGBOXPARAMS);//因为没赋初值所以sizeof出错,其他语言怎么就行了.若有初值这个后也可能改变初值啊!
2.MsgBp.lpszIcon//指像Icon资源的指针,这个指针是string类型,我还是不会玩.