windows下,弹出的消息窗体是用那个api?能否提供使用的sample程序?
mail:[email protected]

解决方案 »

  1.   

    Public Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long
      

  2.   

    Option Explicit
    Private Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As LongPrivate Sub Command1_Click()
    MessageBox Me.hwnd, "just a test string", "aaa", 0
    End Sub
      

  3.   

    HRESULT MessageBox(
      LPCWSTR lpszText,  // pointer to the text to be displayed
      LPCWSTR lpszTitle, // pointer to the title of the box
      UINT fuStyle,      // style of the message box
      int * piRetval     // pointer to the return value
    );
      

  4.   

    其实都是一样的!
    你的效果是弹出一个窗体吗!你可以用SendMessage给那个窗体发个消息,让其弹出!
      

  5.   

    哪个窗体呀?像画面一样的窗体,你自己做一个不就完了吗,干嘛用API?莫名其妙
      

  6.   

    是不是Splash(展示窗体?)可以通过模版新建后学习
      

  7.   

    BOOL InitWindow(  HINSTANCE hInstance, int nCmdShow )
    {
    WNDCLASS wc;
    HWND hWnd;

    wc.style = 0;
        wc.lpfnWndProc = WinProc;
        wc.cbClsExtra = 0;
        wc.cbWndExtra = 0;
        wc.hInstance = hInstance;
        wc.hIcon = LoadIcon( hInstance, IDI_APPLICATION );
        wc.hCursor = LoadCursor( NULL, IDC_ARROW );
        wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
        wc.lpszMenuName = NULL;
        wc.lpszClassName = "dxHello"; RegisterClass(&wc); hWnd=CreateWindowEx(
    0,
    "dxHello",
    "",
    WS_POPUP,
    0,
    0,
    GetSystemMetrics(SM_CXSCREEN),
    GetSystemMetrics(SM_CYSCREEN),
    NULL,
    NULL,
    hInstance,
    NULL);
    if ( !hWnd )  return FALSE;

    ShowWindow(hWnd,nCmdShow);
    UpdateWindow(hWnd);
    return TRUE;
    }
    createwindowex函数可以生成一个popup窗体。
    把他转成相应的vb代码