yes,不如自己做一个窗体来的方便随意

解决方案 »

  1.   

    本来就是自己做的窗体
    不是InputBox
      

  2.   

    这种小事自己座就可以了,何必用他inputbox
      

  3.   

    MicroSoft调用的是FindText但是FindText只是显示查找对话框
    具体的查找还是需要自己写代码而且处理按键的点击还是要自己写个回调函数
    是消息触发的,而不是像VB那样有事件
    写起来复杂多了光那个调出那个对话框,在回调函数中处理按键点击,不处理查找这个功能,就起码要写10K
      

  4.   

    要是这样的话,你自己做一个要比改变inputbox简单得多,DIY吧
      

  5.   

    FindText
    The FindText function creates a system-defined modeless Find dialog box that lets the user specify a string to search for and options to use when searching for text in a document. HWND FindText(
      LPFINDREPLACE lpfr   // pointer to structure with initialization 
                           // data
    );
     
    Parameters
    lpfr 
    Pointer to a FINDREPLACE structure that contains information used to initialize the dialog box. The dialog box uses this structure to send information about the user's input to your application. For more information, see the following Res section. 
    Return Values
    If the function succeeds, the return value is the window handle to the dialog box. You can use the window handle to communicate with or to close the dialog box. If the function fails, the return value is NULL. To get extended error information, call the CommDlgExtendedError function. CommDlgExtendedError may return one of the following error codes: CDERR_FINDRESFAILURE CDERR_MEMLOCKFAILURE 
    CDERR_INITIALIZATION CDERR_NOHINSTANCE 
    CDERR_LOCKRESFAILURE CDERR_NOHOOK 
    CDERR_LOADRESFAILURE CDERR_NOTEMPLATE 
    CDERR_LOADSTRFAILURE CDERR_STRUCTSIZE 
    CDERR_MEMALLOCFAILURE FRERR_BUFFERLENGTHZERO 
    Res
    The FindText function does not perform a search operation. Instead, the dialog box sends FINDMSGSTRING registered messages to the window procedure of the owner window of the dialog box. When you create the dialog box, the hwndOwner member of the FINDREPLACE structure identifies the owner window. Before calling FindText, you must call the RegisterWindowMessage function to get the identifier for the FINDMSGSTRING message. The dialog box procedure uses this identifier to send messages when the user clicks the Find Next button, or when the dialog box is closing. The lParam parameter of the FINDMSGSTRING message contains a pointer to a FINDREPLACE structure. The Flags member of this structure indicates the event that caused the message. Other members of the structure indicate the user's input.If you create a Find dialog box, you must also use the IsDialogMessage function in the main message loop of your application to ensure that the dialog box correctly processes keyboard input, such as the tab and esc keys. IsDialogMessage returns a value that indicates whether the Find dialog box processed the message. You can provide an FRHookProc hook procedure for a Find dialog box. The hook procedure can process messages sent to the dialog box. To enable a hook procedure, set the FR_ENABLEHOOK flag in the Flags member of the FINDREPLACE structure and specify the address of the hook procedure in the lpfnHook member. QuickInfo
      Windows NT: Requires version 3.1 or later.
      Windows: Requires Windows 95 or later.
      Windows CE: Unsupported.
      Header: Declared in commdlg.h.
      Import Library: Use comdlg32.lib.
      Unicode: Implemented as Unicode and ANSI versions on Windows NT.
    FRHookProc
    The FRHookProc hook procedure is an application-defined or library-defined callback function that is used with the FindText or ReplaceText function. The hook procedure receives messages or notifications intended for the default dialog box procedure of the Find or Replace common dialog box. The LPFRHOOKPROC type defines a pointer to this callback function. FRHookProc is a placeholder for the application-defined function name. UINT CALLBACK FRHookProc(
      HWND hdlg,      // handle to the dialog box window
      UINT uiMsg      // message identifier
      WPARAM wParam,  // message parameter
      LPARAM lParam   // message parameter
    );
     
    Parameters
    hdlg 
    Handle to the Find or Replace common dialog box window for which the message is intended. 
    uiMsg 
    Identifies the message being received. 
    wParam 
    Specifies additional information about the message. The exact meaning depends on the value of the uiMsg parameter. 
    lParam 
    Specifies additional information about the message. The exact meaning depends on the value of the uiMsg parameter. 
    If the uiMsg parameter indicates the WM_INITDIALOG message, lParam is a pointer to a FINDREPLACE structure containing the values specified when the common dialog box was created. Return Values
    If the hook procedure returns zero, the default dialog box procedure processes the message.If the hook procedure returns a nonzero value, the default dialog box procedure ignores the message.Res
    When you use the FindText or ReplaceText functions to create a Find or Replace common dialog box, you can provide an FRHookProc hook procedure to process messages or notifications intended for the dialog box procedure. To enable the hook procedure, use the FINDREPLACE structure that you passed to the dialog creation function. Specify the address of the hook procedure in the lpfnHook member and specify the FR_ENABLEHOOK flag in the Flags member.The default dialog box procedure processes the WM_INITDIALOG message before passing it to the hook procedure. For all other messages, the hook procedure receives the message first. Then, the return value of the hook procedure determines whether the default dialog procedure processes the message or ignores it.If the hook procedure processes the WM_CTLCOLORDLG message, it must return a valid brush handle for painting the background of the dialog box. In general, if the hook procedure processes any WM_CTLCOLOR* message, it must return a valid brush handle for painting the background of the specified control.Do not call the EndDialog function from the hook procedure. Instead, the hook procedure can call the PostMessage function to post a WM_COMMAND message with the IDABORT value to the dialog box procedure. Posting IDABORT closes the dialog box and causes the dialog box function to return FALSE. If you need to know why the hook procedure closed the dialog box, you must provide your own communication mechanism between the hook procedure and your application.You can subclass the standard controls of the common dialog box. However, the common dialog box procedure may also subclass the controls. Because of this, you should subclass controls when your hook procedure processes the WM_INITDIALOG message. This ensures that your subclass procedure receives the control-specific messages before the subclass procedure set by the dialog box procedure. FRHookProc is a placeholder for the application-defined or library-defined function name. The LPFRHOOKPROC type is a pointer to an FRHookProc hook procedure.QuickInfo
      Windows NT: Requires version 3.1 or later.
      Windows: Requires Windows 95 or later.
      Windows CE: Unsupported.
      Header: Declared in commdlg.h.
      Import Library: User-defined.
      

  6.   

    FINDREPLACE
    The FINDREPLACE structure contains information that the FindText and ReplaceText functions use to initialize the Find and Replace common dialog boxes. The FINDMSGSTRING registered message uses this structure to pass the user's search or replacement input to the owner window of a Find or Replace common dialog box.typedef struct {    // fr 
        DWORD        lStructSize; 
        HWND         hwndOwner; 
        HINSTANCE    hInstance; 
        DWORD        Flags; 
        LPTSTR        lpstrFindWhat; 
        LPTSTR        lpstrReplaceWith; 
        WORD         wFindWhatLen; 
        WORD         wReplaceWithLen; 
        LPARAM        lCustData; 
        LPFRHOOKPROC lpfnHook; 
        LPCTSTR       lpTemplateName; 
    } FINDREPLACE; 
     
    Members
    lStructSize 
    Specifies the length, in bytes, of the structure. 
    hwndOwner 
    Identifies the window that owns the dialog box. The window procedure of the specified window receives FINDMSGSTRING messages from the dialog box. This member can be any valid window handle, but it must not be NULL. 
    hInstance 
    If the FR_ENABLETEMPLATEHANDLE flag is set in the Flags member, hInstance is the handle of a memory object containing a dialog box template. If the FR_ENABLETEMPLATE flag is set, hInstance identifies a module that contains a dialog box template named by the lpTemplateName member. If neither flag is set, this member is ignored. 
    Flags 
    A set of bit flags that you can use to initialize the dialog box. The dialog box sets these flags when it sends the FINDMSGSTRING registered message to indicate the user's input. This member can be a combination of the following flags: Flag Meaning 
    FR_DIALOGTERM 
     If set in a FINDMSGSTRING message, indicates that the dialog box is closing. When you receive a message with this flag set, the dialog box window handle returned by the FindText or ReplaceText function is no longer valid. 
    FR_DOWN 
     If set, the Down button of the direction radio buttons in a Find dialog box is selected indicating that you should search from the current location to the end of the document. If not set, the Up button is selected so you should search to the beginning of the document. You can set this flag to initialize the dialog box. If set in a FINDMSGSTRING message, indicates the user's selection. 
    FR_ENABLEHOOK 
     Enables the hook function specified in the lpfnHook member. This flag is used only to initialize the dialog box. 
    FR_ENABLETEMPLATE 
     Indicates that the hInstance and lpTemplateName members specify a dialog box template to use in place of the default template. This flag is used only to initialize the dialog box. 
    FR_ENABLETEMPLATEHANDLE 
     Indicates that the hInstance member identifies a data block that contains a preloaded dialog box template. The system ignores the lpTemplateName member if this flag is specified. 
    FR_FINDNEXT 
     If set in a FINDMSGSTRING message, indicates that the user clicked the Find Next button in a Find or Replace dialog box. The lpstrFindWhat member specifies the string to search for. 
    FR_HIDEUPDOWN 
     If set when initializing a Find dialog box, hides the search direction radio buttons. 
    FR_HIDEMATCHCASE 
     If set when initializing a Find or Replace dialog box, hides the Match Case check box. 
    FR_HIDEWHOLEWORD 
     If set when initializing a Find or Replace dialog box, hides the Match Whole Word Only check box. 
    FR_MATCHCASE 
     If set, the Match Case check box is checked indicating that the search should be case-sensitive. If not set, the check box is unchecked so the search should be case-insensitive. You can set this flag to initialize the dialog box. If set in a FINDMSGSTRING message, indicates the user's selection. 
    FR_NOMATCHCASE 
     If set when initializing a Find or Replace dialog box, disables the Match Case check box. 
    FR_NOUPDOWN 
     If set when initializing a Find dialog box, disables the search direction radio buttons. 
    FR_NOWHOLEWORD 
     If set when initializing a Find or Replace dialog box, disables the Whole Word check box. 
    FR_REPLACE 
     If set in a FINDMSGSTRING message, indicates that the user clicked the Replace button in a Replace dialog box. The lpstrFindWhat member specifies the string to be replaced and the lpstrReplaceWith member specifies the replacement string. 
    FR_REPLACEALL 
     If set in a FINDMSGSTRING message, indicates that the user clicked the Replace All button in a Replace dialog box. The lpstrFindWhat member specifies the string to be replaced and the lpstrReplaceWith member specifies the replacement string. 
    FR_SHOWHELP 
     Causes the dialog box to display the Help button. The hwndOwner member must specify the window to receive the HELPMSGSTRING registered messages that the dialog box sends when the user clicks the Help button. 
    FR_WHOLEWORD 
     If set, the Match Whole Word Only check box is checked indicating that you should search only for whole words that match the search string. If not set, the check box is unchecked so you should also search for word fragments that match the search string. You can set this flag to initialize the dialog box. If set in a FINDMSGSTRING message, indicates the user's selection. 
    lpstrFindWhat 
    Pointer to a buffer that a FINDMSGSTRING message uses to pass the null terminated search string that the user typed in the Find What edit control. You must dynamically allocate the buffer or use a global or static array so it does not go out of scope before the dialog box closes. The buffer should be at least 80 characters long. If the buffer contains a string when you initialize the dialog box, the string is displayed in the Find What edit control. 
    If a FINDMSGSTRING message specifies the FR_FINDNEXT flag, lpstrFindWhat contains the string to search for. The FR_DOWN, FR_WHOLEWORD, and FR_MATCHCASE flags indicate the direction and type of search. If a FINDMSGSTRING message specifies the FR_REPLACE or FR_REPLACE flags, lpstrFindWhat contains the string to be replaced. lpstrReplaceWith 
    Pointer to a buffer that a FINDMSGSTRING message uses to pass the null terminated replacement string that the user typed in the Replace With edit control. You must dynamically allocate the buffer or use a global or static array so it does not go out of scope before the dialog box closes. If the buffer contains a string when you initialize the dialog box, the string is displayed in the Replace With edit control. 
    If a FINDMSGSTRING message specifies the FR_REPLACE or FR_REPLACEALL flags, lpstrReplaceWith contains the replacement string . 
      

  7.   

    The FindText function ignores this member. wFindWhatLen 
    Specifies the length, in bytes, of the buffer pointed to by the lpstrFindWhat member. 
    wReplaceWithLen 
    Specifies the length, in bytes, of the buffer pointed to by the lpstrReplaceWith member. 
    lCustData 
    Specifies application-defined data that the system passes to the hook procedure identified by the lpfnHook member. When the system sends the WM_INITDIALOG message to the hook procedure, the message's lParam parameter is a pointer to the FINDREPLACE structure specified when the dialog was created. The hook procedure can use this pointer to get the lCustData value. 
    lpfnHook 
    Pointer to an FRHookProc hook procedure that can process messages intended for the dialog box. This member is ignored unless the FR_ENABLEHOOK flag is set in the Flags member. 
    If the hook procedure returns FALSE in response to the WM_INITDIALOG message, the hook procedure must display the dialog box or else the dialog box will not be shown. To do this, first perform any other paint operations, and then call the ShowWindow and UpdateWindow functions. lpTemplateName 
    Pointer to a null-terminated string that names the dialog box template resource in the module identified by the hInstance member. This template is substituted for the standard dialog box template. For numbered dialog box resources, this can be a value returned by the MAKEINTRESOURCE macro. This member is ignored unless the FR_ENABLETEMPLATE flag is set in the Flags member. 
    QuickInfo
      Windows NT: Requires version 3.1 or later.
      Windows: Requires Windows 95 or later.
      Windows CE: Unsupported.
      Header: Declared in commdlg.h.
      Unicode: Defined as Unicode and ANSI structures.